@@ -243,6 +243,9 @@ def run_dmriprep_pe(subject_id, dwi_file, dwi_file_AP, dwi_file_PA, bvec_file, b
243
243
inputspec .inputs .subjects_dir = subjects_dir
244
244
inputspec .inputs .out_dir = op .abspath (out_dir )
245
245
246
+ # write the graph (this is saved to the working dir)
247
+ wf .write_graph ()
248
+
246
249
wf .run ()
247
250
248
251
@@ -469,14 +472,18 @@ def get_orig(subjects_dir, sub='freesurfer'):
469
472
import os .path as op
470
473
return op .join (subjects_dir , sub , "mri" , "orig.mgz" )
471
474
475
+
476
+ def get_aparc_aseg (subjects_dir , sub = 'freesurfer' ):
477
+ import os .path as op
478
+ return op .join (subjects_dir , sub , "mri" , "aparc+aseg.mgz" )
479
+
472
480
# transform the dropped volume version to anat space w/ out resampling
473
481
voltransform = pe .Node (fs .ApplyVolTransform (no_resample = True ),
474
482
iterfield = ['source_file' , 'reg_file' ],
475
483
name = 'transform' )
476
- #voltransform.inputs.subjects_dir = subjects_dir
484
+
477
485
wf .connect (inputspec , 'subjects_dir' , voltransform , 'subjects_dir' )
478
- #voltransform.inputs.target_file = get_orig(subjects_dir, 'freesurfer')
479
- wf .connect (inputspec , ('subjects_dir' , get_orig ), voltransform , 'target_file' )
486
+ wf .connect (inputspec , ('subjects_dir' , get_aparc_aseg ), voltransform , 'target_file' )
480
487
wf .connect (prep , "outputnode.out_file" , voltransform , "source_file" )
481
488
wf .connect (bbreg , "out_reg_file" , voltransform , "reg_file" )
482
489
@@ -559,9 +566,6 @@ def binarize_aparc(aparc_aseg):
559
566
function = binarize_aparc ),
560
567
name = "bin_aparc" )
561
568
562
- def get_aparc_aseg (subjects_dir , sub = 'freesurfer' ):
563
- import os .path as op
564
- return op .join (subjects_dir , sub , "mri" , "aparc+aseg.mgz" )
565
569
566
570
getB0Anat = fslroi .clone ('getB0Anat' )
567
571
wf .connect (voltransform , 'transformed_file' , getB0Anat , 'in_file' )
@@ -724,7 +728,6 @@ def name_files_nicely(dwi_file, subject_id):
724
728
wf .connect (inputspec , 'subject_id' , node_name_files_nicely , 'subject_id' )
725
729
wf .connect (node_name_files_nicely , 'substitutions' , datasink , 'substitutions' )
726
730
727
- # write the graph (this is saved to the working dir)
728
- wf .write_graph ()
731
+
729
732
730
733
return wf
0 commit comments