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
c6beb86d
Commit
c6beb86d
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
BF: Couple of small tweaks
parent
f8f758ae
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/scripts/extract_noise.py
+10
-7
10 additions, 7 deletions
fsl/scripts/extract_noise.py
with
10 additions
and
7 deletions
fsl/scripts/extract_noise.py
+
10
−
7
View file @
c6beb86d
...
...
@@ -118,6 +118,8 @@ def parseArgs(args):
# Convert confound files to absolute
# paths, error if any do not exist.
if
args
.
conffile
is
None
:
args
.
conffile
=
[]
for
i
,
cf
in
enumerate
(
args
.
conffile
):
if
not
op
.
exists
(
cf
):
print
(
'
Confound file does not exist: {}
'
.
format
(
cf
))
...
...
@@ -153,8 +155,8 @@ def genComponentIndexList(comps, ncomps):
allcomps
.
extend
([
c
-
1
for
c
in
ccomps
])
if
any
([
c
c
<
0
or
c
c
>=
ncomps
for
c
c
in
c
comps
]):
raise
ValueError
(
'
Invalid component indices: {}
'
.
format
(
c
comps
))
if
any
([
c
<
0
or
c
>=
ncomps
for
c
in
all
comps
]):
raise
ValueError
(
'
Invalid component indices: {}
'
.
format
(
all
comps
))
return
list
(
sorted
(
set
(
allcomps
)))
...
...
@@ -214,12 +216,13 @@ def main(argv=None):
args
=
parseArgs
(
argv
)
try
:
comps
=
genComponentIndexList
(
args
.
components
)
ts
=
melanalysis
.
getComponentTimeSeries
(
args
.
icadir
)
ts
=
ts
[:,
comps
]
confs
=
loadConfoundFiles
(
args
.
conffiles
,
ts
.
shape
[
0
])
ts
=
melanalysis
.
getComponentTimeSeries
(
args
.
icadir
)
npts
,
ncomps
=
ts
.
shape
confs
=
loadConfoundFiles
(
args
.
conffile
,
npts
)
comps
=
genComponentIndexList
(
args
.
components
,
ncomps
)
ts
=
ts
[:,
comps
]
except
ValueError
as
e
:
except
Exception
as
e
:
print
(
e
)
sys
.
exit
(
1
)
...
...
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