@@ -65,8 +65,8 @@ def get_affine(volume):
65
65
"""
66
66
67
67
info = dict (dwi = [['subject_id' , 'data' ]],
68
- bvecs = [['subject_id' ,'bvecs' ]],
69
- bvals = [['subject_id' ,'bvals' ]])
68
+ bvecs = [['subject_id' , 'bvecs' ]],
69
+ bvals = [['subject_id' , 'bvals' ]])
70
70
71
71
infosource = pe .Node (interface = util .IdentityInterface (fields = ['subject_id' ]),
72
72
name = "infosource" )
@@ -125,7 +125,7 @@ def get_affine(volume):
125
125
Second, diffusion tensors are fit to the voxel-order data.
126
126
"""
127
127
128
- dtifit = pe .Node (interface = camino .DTIFit (),name = 'dtifit' )
128
+ dtifit = pe .Node (interface = camino .DTIFit (), name = 'dtifit' )
129
129
130
130
"""
131
131
Next, a lookup table is generated from the schemefile and the
@@ -196,15 +196,15 @@ def get_affine(volume):
196
196
fractional anisotropy and diffusivity trace maps and their associated headers.
197
197
"""
198
198
199
- fa = pe .Node (interface = camino .ComputeFractionalAnisotropy (),name = 'fa' )
200
- trace = pe .Node (interface = camino .ComputeTensorTrace (),name = 'trace' )
199
+ fa = pe .Node (interface = camino .ComputeFractionalAnisotropy (), name = 'fa' )
200
+ trace = pe .Node (interface = camino .ComputeTensorTrace (), name = 'trace' )
201
201
dteig = pe .Node (interface = camino .ComputeEigensystem (), name = 'dteig' )
202
202
203
203
analyzeheader_fa = pe .Node (interface = camino .AnalyzeHeader (), name = "analyzeheader_fa" )
204
204
analyzeheader_fa .inputs .datatype = "double"
205
205
analyzeheader_trace = analyzeheader_fa .clone ('analyzeheader_trace' )
206
206
207
- fa2nii = pe .Node (interface = misc .CreateNifti (),name = 'fa2nii' )
207
+ fa2nii = pe .Node (interface = misc .CreateNifti (), name = 'fa2nii' )
208
208
trace2nii = fa2nii .clone ("trace2nii" )
209
209
210
210
"""
@@ -213,7 +213,7 @@ def get_affine(volume):
213
213
214
214
tractography = pe .Workflow (name = 'tractography' )
215
215
216
- tractography .connect ([(inputnode , bet ,[("dwi" ,"in_file" )])])
216
+ tractography .connect ([(inputnode , bet , [("dwi" , "in_file" )])])
217
217
218
218
"""
219
219
File format conversion
@@ -228,29 +228,29 @@ def get_affine(volume):
228
228
Tensor fitting
229
229
"""
230
230
231
- tractography .connect ([(image2voxel , dtifit ,[['voxel_order' ,'in_file' ]]),
232
- (fsl2scheme , dtifit ,[['scheme' ,'scheme_file' ]])
231
+ tractography .connect ([(image2voxel , dtifit , [['voxel_order' , 'in_file' ]]),
232
+ (fsl2scheme , dtifit , [['scheme' , 'scheme_file' ]])
233
233
])
234
234
235
235
"""
236
236
Workflow for applying DT streamline tractogpahy
237
237
"""
238
238
239
- tractography .connect ([(bet , trackdt ,[("mask_file" ,"seed_file" )])])
240
- tractography .connect ([(dtifit , trackdt ,[("tensor_fitted" ,"in_file" )])])
239
+ tractography .connect ([(bet , trackdt , [("mask_file" , "seed_file" )])])
240
+ tractography .connect ([(dtifit , trackdt , [("tensor_fitted" , "in_file" )])])
241
241
242
242
"""
243
243
Workflow for applying PICo
244
244
"""
245
245
246
- tractography .connect ([(bet , trackpico ,[("mask_file" ,"seed_file" )])])
247
- tractography .connect ([(fsl2scheme , dtlutgen ,[("scheme" ,"scheme_file" )])])
248
- tractography .connect ([(dtlutgen , picopdfs ,[("dtLUT" ,"luts" )])])
249
- tractography .connect ([(dtifit , picopdfs ,[("tensor_fitted" ,"in_file" )])])
250
- tractography .connect ([(picopdfs , trackpico ,[("pdfs" ,"in_file" )])])
246
+ tractography .connect ([(bet , trackpico , [("mask_file" , "seed_file" )])])
247
+ tractography .connect ([(fsl2scheme , dtlutgen , [("scheme" , "scheme_file" )])])
248
+ tractography .connect ([(dtlutgen , picopdfs , [("dtLUT" , "luts" )])])
249
+ tractography .connect ([(dtifit , picopdfs , [("tensor_fitted" , "in_file" )])])
250
+ tractography .connect ([(picopdfs , trackpico , [("pdfs" , "in_file" )])])
251
251
252
252
# ProcStreamlines might throw memory errors - comment this line out in such case
253
- tractography .connect ([(trackdt , procstreamlines ,[("tracked" ,"in_file" )])])
253
+ tractography .connect ([(trackdt , procstreamlines , [("tracked" , "in_file" )])])
254
254
255
255
256
256
"""
@@ -262,31 +262,31 @@ def get_affine(volume):
262
262
will be correct and readable.
263
263
"""
264
264
265
- tractography .connect ([(dtifit , fa ,[("tensor_fitted" ,"in_file" )])])
266
- tractography .connect ([(fa , analyzeheader_fa ,[("fa" ,"in_file" )])])
267
- tractography .connect ([(inputnode , analyzeheader_fa ,[(('dwi' , get_vox_dims ), 'voxel_dims' ),
265
+ tractography .connect ([(dtifit , fa , [("tensor_fitted" , "in_file" )])])
266
+ tractography .connect ([(fa , analyzeheader_fa , [("fa" , "in_file" )])])
267
+ tractography .connect ([(inputnode , analyzeheader_fa , [(('dwi' , get_vox_dims ), 'voxel_dims' ),
268
268
(('dwi' , get_data_dims ), 'data_dims' )])])
269
- tractography .connect ([(fa , fa2nii ,[('fa' ,'data_file' )])])
270
- tractography .connect ([(inputnode , fa2nii ,[(('dwi' , get_affine ), 'affine' )])])
271
- tractography .connect ([(analyzeheader_fa , fa2nii ,[('header' , 'header_file' )])])
269
+ tractography .connect ([(fa , fa2nii , [('fa' , 'data_file' )])])
270
+ tractography .connect ([(inputnode , fa2nii , [(('dwi' , get_affine ), 'affine' )])])
271
+ tractography .connect ([(analyzeheader_fa , fa2nii , [('header' , 'header_file' )])])
272
272
273
273
274
- tractography .connect ([(dtifit , trace ,[("tensor_fitted" ,"in_file" )])])
275
- tractography .connect ([(trace , analyzeheader_trace ,[("trace" ,"in_file" )])])
276
- tractography .connect ([(inputnode , analyzeheader_trace ,[(('dwi' , get_vox_dims ), 'voxel_dims' ),
274
+ tractography .connect ([(dtifit , trace , [("tensor_fitted" , "in_file" )])])
275
+ tractography .connect ([(trace , analyzeheader_trace , [("trace" , "in_file" )])])
276
+ tractography .connect ([(inputnode , analyzeheader_trace , [(('dwi' , get_vox_dims ), 'voxel_dims' ),
277
277
(('dwi' , get_data_dims ), 'data_dims' )])])
278
- tractography .connect ([(trace , trace2nii ,[('trace' ,'data_file' )])])
279
- tractography .connect ([(inputnode , trace2nii ,[(('dwi' , get_affine ), 'affine' )])])
280
- tractography .connect ([(analyzeheader_trace , trace2nii ,[('header' , 'header_file' )])])
278
+ tractography .connect ([(trace , trace2nii , [('trace' , 'data_file' )])])
279
+ tractography .connect ([(inputnode , trace2nii , [(('dwi' , get_affine ), 'affine' )])])
280
+ tractography .connect ([(analyzeheader_trace , trace2nii , [('header' , 'header_file' )])])
281
281
282
- tractography .connect ([(dtifit , dteig ,[("tensor_fitted" ,"in_file" )])])
282
+ tractography .connect ([(dtifit , dteig , [("tensor_fitted" , "in_file" )])])
283
283
284
- tractography .connect ([(trackpico , cam2trk_pico , [('tracked' ,'in_file' )])])
285
- tractography .connect ([(trackdt , cam2trk_dt , [('tracked' ,'in_file' )])])
286
- tractography .connect ([(inputnode , cam2trk_pico ,[(('dwi' , get_vox_dims ), 'voxel_dims' ),
284
+ tractography .connect ([(trackpico , cam2trk_pico , [('tracked' , 'in_file' )])])
285
+ tractography .connect ([(trackdt , cam2trk_dt , [('tracked' , 'in_file' )])])
286
+ tractography .connect ([(inputnode , cam2trk_pico , [(('dwi' , get_vox_dims ), 'voxel_dims' ),
287
287
(('dwi' , get_data_dims ), 'data_dims' )])])
288
288
289
- tractography .connect ([(inputnode , cam2trk_dt ,[(('dwi' , get_vox_dims ), 'voxel_dims' ),
289
+ tractography .connect ([(inputnode , cam2trk_dt , [(('dwi' , get_vox_dims ), 'voxel_dims' ),
290
290
(('dwi' , get_data_dims ), 'data_dims' )])])
291
291
292
292
@@ -298,10 +298,10 @@ def get_affine(volume):
298
298
299
299
workflow = pe .Workflow (name = "workflow" )
300
300
workflow .base_dir = os .path .abspath ('camino_dti_tutorial' )
301
- workflow .connect ([(infosource ,datasource ,[('subject_id' , 'subject_id' )]),
302
- (datasource ,tractography ,[('dwi' ,'inputnode.dwi' ),
303
- ('bvals' ,'inputnode.bvals' ),
304
- ('bvecs' ,'inputnode.bvecs' )
301
+ workflow .connect ([(infosource , datasource , [('subject_id' , 'subject_id' )]),
302
+ (datasource , tractography , [('dwi' , 'inputnode.dwi' ),
303
+ ('bvals' , 'inputnode.bvals' ),
304
+ ('bvecs' , 'inputnode.bvecs' )
305
305
])
306
306
])
307
307
"""
0 commit comments