Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
16a98f34
Commit
16a98f34
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
isFEATImage and isMelodicImage functions cleaned up. Adjustements to other
melodicanalysis functions - .gica suffix no longer recognised.
parent
1d8aba54
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/data/featanalysis.py
+1
-3
1 addition, 3 deletions
fsl/data/featanalysis.py
fsl/data/melodicanalysis.py
+19
-9
19 additions, 9 deletions
fsl/data/melodicanalysis.py
with
20 additions
and
12 deletions
fsl/data/featanalysis.py
+
1
−
3
View file @
16a98f34
...
...
@@ -70,9 +70,7 @@ def isFEATImage(path):
dirname
=
op
.
dirname
(
path
)
filename
=
op
.
basename
(
path
)
return
filename
.
startswith
(
'
filtered_func_data
'
)
and
\
fslimage
.
looksLikeImage
(
filename
)
and
\
isFEATDir
(
dirname
)
return
filename
.
startswith
(
'
filtered_func_data
'
)
and
isFEATDir
(
dirname
)
def
isFEATDir
(
path
):
...
...
This diff is collapsed.
Click to expand it.
fsl/data/melodicanalysis.py
+
19
−
9
View file @
16a98f34
...
...
@@ -46,19 +46,23 @@ def isMelodicImage(path):
component image file, ``False`` otherwise.
"""
try
:
path
=
fslimage
.
addExt
(
path
,
mustExist
=
True
)
except
:
return
False
dirname
=
op
.
dirname
(
path
)
filename
=
op
.
basename
(
path
)
return
fslimage
.
removeExt
(
filename
)
==
'
melodic_IC
'
and
\
isMelodicDir
(
dirname
)
return
filename
.
startswith
(
'
melodic_IC
'
)
and
isMelodicDir
(
dirname
)
def
isMelodicDir
(
path
):
"""
Returns ``True`` if the given path looks like it is contained within
a MELODIC directory, ``False`` otherwise. A melodic directory:
- Must be named ``*.ica``
or ``*.gica``
.
- Must be named ``*.ica``.
- Must contain a file called ``melodic_IC.nii.gz``.
- Must contain a file called ``melodic_mix``.
- Must contain a file called ``melodic_FTmix``.
...
...
@@ -69,7 +73,7 @@ def isMelodicDir(path):
if
op
.
isdir
(
path
):
dirname
=
path
else
:
dirname
=
op
.
dirname
(
path
)
sufs
=
[
'
.ica
'
,
'
.gica
'
]
sufs
=
[
'
.ica
'
]
if
not
any
([
dirname
.
endswith
(
suf
)
for
suf
in
sufs
]):
return
False
...
...
@@ -93,7 +97,7 @@ def getAnalysisDir(path):
to that MELODIC directory is returned. Otherwise, ``None`` is returned.
"""
meldir
=
fslpath
.
deepest
(
path
,
[
'
.ica
'
,
'
.gica
'
])
meldir
=
fslpath
.
deepest
(
path
,
[
'
.ica
'
])
if
meldir
is
not
None
and
isMelodicDir
(
meldir
):
return
meldir
...
...
@@ -140,12 +144,18 @@ def getICFile(meldir):
def
getMixFile
(
meldir
):
"""
Returns the path to the melodic mix file.
"""
return
op
.
join
(
meldir
,
'
melodic_mix
'
)
mixfile
=
op
.
join
(
meldir
,
'
melodic_mix
'
)
if
op
.
exists
(
mixfile
):
return
mixfile
else
:
return
None
def
getFTMixFile
(
meldir
):
"""
Returns the path to the melodic FT mix file.
"""
return
op
.
join
(
meldir
,
'
melodic_FTmix
'
)
ftmixfile
=
op
.
join
(
meldir
,
'
melodic_FTmix
'
)
if
op
.
exists
(
ftmixfile
):
return
ftmixfile
else
:
return
None
def
getReportFile
(
meldir
):
...
...
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