@@ -69,6 +69,12 @@ def run_preAFQ(dwi_file, dwi_file_AP, dwi_file_PA, bvec_file, bval_file,
69
69
# prep.inputs.inputnode.alt_file = dwi_file_PA
70
70
prep .inputs .inputnode .in_bvec = bvec_file
71
71
prep .inputs .inputnode .in_bval = bval_file
72
+ eddy = prep .get_node ('fsl_eddy' )
73
+ eddy .inputs .repol = True
74
+ eddy .inputs .niter = 1
75
+
76
+
77
+
72
78
# print(prep.inputs)
73
79
74
80
merge = pe .Node (fsl .Merge (dimension = 't' ), name = "mergeAPPA" )
@@ -78,7 +84,7 @@ def run_preAFQ(dwi_file, dwi_file_AP, dwi_file_PA, bvec_file, bval_file,
78
84
fslroi = pe .Node (fsl .ExtractROI (t_min = 0 , t_size = 1 ), name = "fslroi" )
79
85
wf .connect (prep , "outputnode.out_file" , fslroi , "in_file" )
80
86
81
- bbreg = pe .Node (fs .BBRegister (contrast_type = "t2" , init = "fsl " ,
87
+ bbreg = pe .Node (fs .BBRegister (contrast_type = "t2" , init = "coreg " ,
82
88
out_fsl_file = True ,
83
89
subjects_dir = subjects_dir ,
84
90
epi_mask = True ),
@@ -151,27 +157,6 @@ def get_orig(subjects_dir, sub):
151
157
name = 'threshold2' )
152
158
wf .connect (voltransform , "transformed_file" , threshold2 , "in_file" )
153
159
154
- # art detect stuff
155
-
156
- motion = pe .Node (niu .Function (input_names = ['eddy_params' ],
157
- output_names = ['motion_file' ],
158
- function = get_flirt_motion_parameters ),
159
- name = "reformat_motion" )
160
-
161
- wf .connect (prep , "fsl_eddy.out_parameter" , motion , "eddy_params" )
162
-
163
- art = pe .Node (interface = ArtifactDetect (), name = "art" )
164
- art .inputs .use_differences = [True , True ]
165
- art .inputs .save_plot = False
166
- art .inputs .use_norm = True
167
- art .inputs .norm_threshold = 3
168
- art .inputs .zintensity_threshold = 9
169
- art .inputs .mask_type = 'spm_global'
170
- art .inputs .parameter_source = 'FSL'
171
-
172
- wf .connect (motion , "motion_file" , art , "realignment_parameters" )
173
- wf .connect (prep , "outputnode.out_file" , art , "realigned_files" )
174
-
175
160
datasink = pe .Node (nio .DataSink (), name = "sinker" )
176
161
datasink .inputs .base_directory = out_dir
177
162
datasink .inputs .substitutions = [
@@ -193,17 +178,24 @@ def get_orig(subjects_dir, sub):
193
178
# ("eddy_corrected_", dwi_fname.replace("dwi", "")),
194
179
("stats.eddy_corrected" , dwi_fname .replace ("dwi" , "artStats" )),
195
180
("eddy_corrected.eddy_parameters" , dwi_fname + ".eddy_parameters" ),
181
+ ("qc/eddy_corrected" , "qc/" + dwi_fname ),
196
182
("derivatives/preafq" , "derivatives/{}/preafq" .format (bids_sub_name ))
197
183
]
198
184
199
- wf .connect (art , "statistic_files" , datasink , "preafq.qc.@artstat" )
200
- wf .connect (art , "outlier_files" , datasink , "preafq.qc.@artoutlier" )
201
-
202
185
wf .connect (prep , "outputnode.out_file" , datasink , "preafq.dwi.@corrected" )
203
186
wf .connect (prep , "outputnode.out_bvec" , datasink , "preafq.dwi.@rotated" )
204
187
wf .connect (prep , "fsl_eddy.out_parameter" ,
205
188
datasink , "preafq.qc.@eddyparams" )
206
189
190
+ wf .connect (prep , "fsl_eddy.out_movement_rms" ,
191
+ datasink , "preafq.qc.@eddyparamsrms" )
192
+ wf .connect (prep , "fsl_eddy.out_outlier_report" ,
193
+ datasink , "preafq.qc.@eddyparamsreport" )
194
+ wf .connect (prep , "fsl_eddy.out_restricted_movement_rms" ,
195
+ datasink , "preafq.qc.@eddyparamsrestrictrms" )
196
+ wf .connect (prep , "fsl_eddy.out_shell_alignment_parameters" ,
197
+ datasink , "preafq.qc.@eddyparamsshellalign" )
198
+
207
199
wf .connect (get_tensor , "out_file" , datasink , "preafq.dti.@tensor" )
208
200
wf .connect (get_tensor , "fa_file" , datasink , "preafq.dti.@fa" )
209
201
wf .connect (get_tensor , "md_file" , datasink , "preafq.dti.@md" )
0 commit comments