@@ -36,8 +36,10 @@ def pickvol(filenames, fileidx, which):
3636 idx = 0
3737 elif which .lower () == 'middle' :
3838 idx = int (np .ceil (load (filenames [fileidx ]).get_shape ()[3 ]/ 2 ))
39+ elif which .lower () == 'last' :
40+ idx = load (filenames [fileidx ]).get_shape ()[3 ]- 1
3941 else :
40- raise Exception ('unknown value for volume selection : %s' % which )
42+ raise Exception ('unknown value for volume selection : %s' % which )
4143 return idx
4244
4345def getbtthresh (medianvals ):
@@ -381,7 +383,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
381383
382384 name : name of workflow (default: featpreproc)
383385 highpass : boolean (default: True)
384- whichvol : which volume of the first run to register to ('first', 'middle', 'mean')
386+ whichvol : which volume of the first run to register to ('first', 'middle', 'last', ' mean')
385387
386388 Inputs::
387389
@@ -467,6 +469,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
467469 run.
468470 """
469471
472+
470473 img2float = pe .MapNode (interface = fsl .ImageMaths (out_data_type = 'float' ,
471474 op_string = '' ,
472475 suffix = '_dtype' ),
@@ -475,7 +478,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
475478 featpreproc .connect (inputnode , 'func' , img2float , 'in_file' )
476479
477480 """
478- Extract the first volume of the first run as the reference
481+ Extract the middle (or what whichvol points to) volume of the first run as the reference
479482 """
480483
481484 if whichvol != 'mean' :
@@ -488,7 +491,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
488491
489492
490493 """
491- Realign the functional runs to the reference (1st volume of first run)
494+ Realign the functional runs to the reference (`whichvol` volume of first run)
492495 """
493496
494497 motion_correct = pe .MapNode (interface = fsl .MCFLIRT (save_mats = True ,
@@ -518,7 +521,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
518521 featpreproc .connect (plot_motion , 'out_file' , outputnode , 'motion_plots' )
519522
520523 """
521- Extract the mean volume of the first functional run
524+ Extract the mean volume of the first functional runpreproc
522525 """
523526
524527 meanfunc = pe .Node (interface = fsl .ImageMaths (op_string = '-Tmean' ,
@@ -1093,7 +1096,7 @@ def create_fsl_fs_preproc(name='preproc', highpass=True, whichvol='middle'):
10931096 return featpreproc
10941097
10951098def create_reg_workflow (name = 'registration' ):
1096- """Create a FEAT preprocessing workflow together with freesurfer
1099+ """Create a FEAT preprocessing workflow
10971100
10981101 Parameters
10991102 ----------
0 commit comments