Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
de6dcde6
Commit
de6dcde6
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Fix to fsl.data.mesh.findReferenceImage
parent
f52857e3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/mesh.py
+14
-4
14 additions, 4 deletions
fsl/data/mesh.py
with
14 additions
and
4 deletions
fsl/data/mesh.py
+
14
−
4
View file @
de6dcde6
...
...
@@ -243,7 +243,7 @@ def loadVTKPolydataFile(infile):
def
getFIRSTPrefix
(
modelfile
):
"""
If the given ``vtk`` file was generated by `FIRST
<https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FIRST>`_, this function
will return the file prefix. Otherwise a
n
``
Exception
`` will be
will return the file prefix. Otherwise a ``
ValueError
`` will be
raised.
"""
...
...
@@ -268,8 +268,18 @@ def findReferenceImage(modelfile):
try
:
prefix
=
getFIRSTPrefix
(
modelfile
)
return
fslimage
.
addExt
(
prefix
,
mustExist
=
True
)
dirname
=
op
.
dirname
(
modelfile
)
prefixes
=
[
getFIRSTPrefix
(
modelfile
)]
except
:
return
None
if
prefixes
[
0
].
endswith
(
'
_first
'
):
prefixes
.
append
(
prefixes
[
0
][:
-
6
])
for
p
in
prefixes
:
try
:
return
fslimage
.
addExt
(
op
.
join
(
dirname
,
p
),
mustExist
=
True
)
except
:
continue
return
None
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment