10
10
11
11
12
12
@click .command ()
13
- @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." ,
19
- default = None
20
- )
13
+ @click .option ('--participant-label' ,
14
+ help = "The label(s) of the participant(s) that should be"
15
+ "analyzed. The label corresponds to"
16
+ "sub-<participant_label> from the BIDS spec (so it does"
17
+ "not include 'sub-'). If this parameter is not provided"
18
+ "all subjects will be analyzed. Multiple participants"
19
+ "can be specified with a space separated list." ,
20
+ default = None )
21
+ @click .option ('--eddy-niter' ,
22
+ help = "Fixed number of eddy iterations. See "
23
+ "https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddy/UsersGuide"
24
+ "#A--niter" ,
25
+ default = 5 , type = (int ))
26
+ @click .option ('--slice-outlier-threshold' ,
27
+ help = "Number of allowed outlier slices per volume. "
28
+ "If this is exceeded the volume is dropped from analysis. "
29
+ "If an int is provided, it is treated as number of allowed "
30
+ "outlier slices. If a float between 0 and 1 "
31
+ "(exclusive) is provided, it is treated the fraction of "
32
+ "allowed outlier slices." ,
33
+ default = 0.02 )
21
34
@click .argument ('bids_dir' ,
22
35
)
23
36
@click .argument ('output_dir' ,
24
37
)
25
38
@click .argument ('analysis_level' ,
26
39
type = click .Choice (['participant' , 'group' ]),
27
40
default = 'participant' )
28
- def main (participant_label , bids_dir , output_dir , analysis_level = "participant" ):
41
+ def main (participant_label , bids_dir , output_dir ,
42
+ eddy_niter = 5 , slice_outlier_threshold = 0.02 ,
43
+ analysis_level = "participant" ):
29
44
"""
30
- BIDS_DIR: The directory with the input dataset formatted according to the BIDS standard.
45
+ BIDS_DIR: The directory with the input dataset formatted according to
46
+ the BIDS standard.
31
47
32
48
OUTPUT_DIR: The directory where the output files should be stored.
33
49
If you are running a group level analysis, this folder
@@ -38,16 +54,18 @@ def main(participant_label, bids_dir, output_dir, analysis_level="participant"):
38
54
participant level analyses can be run independently
39
55
(in parallel).
40
56
"""
41
-
42
57
if analysis_level is not 'participant' :
43
- raise NotImplementedError ('The only valid analysis level for dmriprep is participant at the moment.' )
58
+ raise NotImplementedError ('The only valid analysis level for dmriprep '
59
+ 'is participant at the moment.' )
44
60
45
61
inputs = io .get_bids_files (participant_label , bids_dir )
46
62
47
63
for subject_inputs in inputs :
48
64
run .run_dmriprep_pe (** subject_inputs ,
49
65
working_dir = os .path .join (output_dir , 'scratch' ),
50
- out_dir = output_dir )
66
+ out_dir = output_dir ,
67
+ eddy_niter = eddy_niter ,
68
+ slice_outlier_threshold = slice_outlier_threshold )
51
69
52
70
return 0
53
71
0 commit comments