Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 21df2b0

Browse files
author
Adam Richie-Halford
committed
Add eddy-niter and slice-outlier-threshold to the CLI args
1 parent 4903e9e commit 21df2b0

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

dmriprep/cli.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,34 @@
1111

1212
@click.command()
1313
@click.option('--participant-label', help="The label(s) of the participant(s) that should be"
14-
"analyzed. The label corresponds to"
15-
"sub-<participant_label> from the BIDS spec (so it does"
16-
"not include 'sub-'). If this parameter is not provided"
17-
"all subjects will be analyzed. Multiple participants"
18-
"can be specified with a space separated list.",
14+
"analyzed. The label corresponds to"
15+
"sub-<participant_label> from the BIDS spec (so it does"
16+
"not include 'sub-'). If this parameter is not provided"
17+
"all subjects will be analyzed. Multiple participants"
18+
"can be specified with a space separated list.",
1919
default=None
2020
)
21+
@click.option('--eddy-niter',
22+
help="Fixed number of eddy iterations. See"
23+
"https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy/UsersGuide#A--niter",
24+
default=5)
25+
@click.option('--slice-outlier-threshold',
26+
help="Number of allowed outlier slices per volume."
27+
"If this is exceeded the volume is dropped from analysis. If"
28+
"`slice_outlier_threshold` is an int, it is treated as number of allowed"
29+
"outlier slices. If `slice_outlier_threshold` is a float between 0 and 1"
30+
"(exclusive), it is treated the fraction of allowed outlier slices.",
31+
default=0.02)
2132
@click.argument('bids_dir',
2233
)
2334
@click.argument('output_dir',
2435
)
2536
@click.argument('analysis_level',
2637
type=click.Choice(['participant', 'group']),
2738
default='participant')
28-
def main(participant_label, bids_dir, output_dir, analysis_level="participant"):
39+
def main(participant_label, bids_dir, output_dir,
40+
eddy_niter=5, slice_outlier_threshold=0.02,
41+
analysis_level="participant"):
2942
"""
3043
BIDS_DIR: The directory with the input dataset formatted according to the BIDS standard.
3144
@@ -38,7 +51,6 @@ def main(participant_label, bids_dir, output_dir, analysis_level="participant"):
3851
participant level analyses can be run independently
3952
(in parallel).
4053
"""
41-
4254
if analysis_level is not 'participant':
4355
raise NotImplementedError('The only valid analysis level for dmriprep is participant at the moment.')
4456

@@ -47,7 +59,9 @@ def main(participant_label, bids_dir, output_dir, analysis_level="participant"):
4759
for subject_inputs in inputs:
4860
run.run_dmriprep_pe(**subject_inputs,
4961
working_dir=os.path.join(output_dir, 'scratch'),
50-
out_dir=output_dir)
62+
out_dir=output_dir,
63+
eddy_niter=eddy_niter,
64+
slice_outlier_threshold=slice_outlier_threshold)
5165

5266
return 0
5367

0 commit comments

Comments
 (0)