@@ -36,8 +36,10 @@ def pickvol(filenames, fileidx, which):
36
36
idx = 0
37
37
elif which .lower () == 'middle' :
38
38
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
39
41
else :
40
- raise Exception ('unknown value for volume selection : %s' % which )
42
+ raise Exception ('unknown value for volume selection : %s' % which )
41
43
return idx
42
44
43
45
def getbtthresh (medianvals ):
@@ -381,7 +383,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
381
383
382
384
name : name of workflow (default: featpreproc)
383
385
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')
385
387
386
388
Inputs::
387
389
@@ -467,6 +469,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
467
469
run.
468
470
"""
469
471
472
+
470
473
img2float = pe .MapNode (interface = fsl .ImageMaths (out_data_type = 'float' ,
471
474
op_string = '' ,
472
475
suffix = '_dtype' ),
@@ -475,7 +478,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
475
478
featpreproc .connect (inputnode , 'func' , img2float , 'in_file' )
476
479
477
480
"""
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
479
482
"""
480
483
481
484
if whichvol != 'mean' :
@@ -488,7 +491,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
488
491
489
492
490
493
"""
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)
492
495
"""
493
496
494
497
motion_correct = pe .MapNode (interface = fsl .MCFLIRT (save_mats = True ,
@@ -518,7 +521,7 @@ def create_featreg_preproc(name='featpreproc', highpass=True, whichvol='middle')
518
521
featpreproc .connect (plot_motion , 'out_file' , outputnode , 'motion_plots' )
519
522
520
523
"""
521
- Extract the mean volume of the first functional run
524
+ Extract the mean volume of the first functional runpreproc
522
525
"""
523
526
524
527
meanfunc = pe .Node (interface = fsl .ImageMaths (op_string = '-Tmean' ,
@@ -1093,7 +1096,7 @@ def create_fsl_fs_preproc(name='preproc', highpass=True, whichvol='middle'):
1093
1096
return featpreproc
1094
1097
1095
1098
def create_reg_workflow (name = 'registration' ):
1096
- """Create a FEAT preprocessing workflow together with freesurfer
1099
+ """Create a FEAT preprocessing workflow
1097
1100
1098
1101
Parameters
1099
1102
----------
0 commit comments