@@ -92,7 +92,7 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"):
92
92
BOLD series mask
93
93
movpar_file
94
94
SPM-formatted motion parameters file
95
- n_volumes_to_discard
95
+ skip_vols
96
96
number of non steady state volumes
97
97
t1_mask
98
98
Mask of the skull-stripped template image
@@ -138,7 +138,7 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"):
138
138
placed within the corresponding confounds file.
139
139
"""
140
140
inputnode = pe .Node (niu .IdentityInterface (
141
- fields = ['bold' , 'bold_mask' , 'movpar_file' , 'n_volumes_to_discard ' ,
141
+ fields = ['bold' , 'bold_mask' , 'movpar_file' , 'skip_vols ' ,
142
142
't1_mask' , 't1_tpms' , 't1_bold_xform' ]),
143
143
name = 'inputnode' )
144
144
outputnode = pe .Node (niu .IdentityInterface (
@@ -253,13 +253,13 @@ def _pick_wm(files):
253
253
254
254
# tCompCor
255
255
(inputnode , tcompcor , [('bold' , 'realigned_file' )]),
256
- (inputnode , tcompcor , [('n_volumes_to_discard ' , 'ignore_initial_volumes' )]),
256
+ (inputnode , tcompcor , [('skip_vols ' , 'ignore_initial_volumes' )]),
257
257
(tcc_tfm , tcc_msk , [('output_image' , 'roi_file' )]),
258
258
(tcc_msk , tcompcor , [('out' , 'mask_files' )]),
259
259
260
260
# aCompCor
261
261
(inputnode , acompcor , [('bold' , 'realigned_file' )]),
262
- (inputnode , acompcor , [('n_volumes_to_discard ' , 'ignore_initial_volumes' )]),
262
+ (inputnode , acompcor , [('skip_vols ' , 'ignore_initial_volumes' )]),
263
263
(acc_tfm , acc_msk , [('output_image' , 'roi_file' )]),
264
264
(acc_msk , acompcor , [('out' , 'mask_files' )]),
265
265
@@ -466,7 +466,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads,
466
466
Affine transform from ``ref_bold_brain`` to T1 space (ITK format)
467
467
movpar_file
468
468
SPM-formatted motion parameters file
469
- n_volumes_to_discard
469
+ skip_vols
470
470
number of non steady state volumes
471
471
name_source
472
472
BOLD series NIfTI file
@@ -506,7 +506,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads,
506
506
'itk_bold_to_t1' ,
507
507
't1_2_mni_forward_transform' ,
508
508
'name_source' ,
509
- 'n_volumes_to_discard ' ,
509
+ 'skip_vols ' ,
510
510
'bold_split' ,
511
511
'bold_mask' ,
512
512
'hmc_xforms' ,
@@ -584,7 +584,7 @@ def _getbtthresh(medianval):
584
584
('fieldwarp' , 'inputnode.fieldwarp' )]),
585
585
(inputnode , ica_aroma , [('movpar_file' , 'motion_parameters' )]),
586
586
(inputnode , rm_non_steady_state , [
587
- ('n_volumes_to_discard ' , 'n_volumes ' )]),
587
+ ('skip_vols ' , 'skip_vols ' )]),
588
588
(bold_mni_trans_wf , rm_non_steady_state , [
589
589
('outputnode.bold_mni' , 'bold_file' )]),
590
590
(bold_mni_trans_wf , calc_median_val , [
@@ -613,7 +613,7 @@ def _getbtthresh(medianval):
613
613
# generate tsvs from ICA-AROMA
614
614
(ica_aroma , ica_aroma_confound_extraction , [('out_dir' , 'in_directory' )]),
615
615
(inputnode , ica_aroma_confound_extraction , [
616
- ('n_volumes_to_discard ' , 'n_volumes ' )]),
616
+ ('skip_vols ' , 'skip_vols ' )]),
617
617
# output for processing and reporting
618
618
(ica_aroma_confound_extraction , outputnode , [('aroma_confounds' , 'aroma_confounds' ),
619
619
('aroma_noise_ics' , 'aroma_noise_ics' ),
@@ -624,15 +624,15 @@ def _getbtthresh(medianval):
624
624
(bold_mni_trans_wf , add_non_steady_state , [
625
625
('outputnode.bold_mni' , 'bold_file' )]),
626
626
(inputnode , add_non_steady_state , [
627
- ('n_volumes_to_discard ' , 'n_volumes ' )]),
627
+ ('skip_vols ' , 'skip_vols ' )]),
628
628
(add_non_steady_state , outputnode , [('bold_add' , 'nonaggr_denoised_file' )]),
629
629
(ica_aroma , ds_report_ica_aroma , [('out_report' , 'in_file' )]),
630
630
])
631
631
632
632
return workflow
633
633
634
634
635
- def _remove_volumes (bold_file , n_volumes ):
635
+ def _remove_volumes (bold_file , skip_vols ):
636
636
import nibabel as nb
637
637
from nipype .utils .filemanip import fname_presuffix
638
638
@@ -641,11 +641,11 @@ def _remove_volumes(bold_file, n_volumes):
641
641
bold_data = bold_img .get_data ()
642
642
643
643
# cut off the beginning volumes
644
- bold_data_cut = bold_data [..., n_volumes :]
644
+ bold_data_cut = bold_data [..., skip_vols :]
645
645
646
646
# modify header with new shape (fewer volumes)
647
647
data_shape = list (bold_img .header .get_data_shape ())
648
- data_shape [- 1 ] -= n_volumes
648
+ data_shape [- 1 ] -= skip_vols
649
649
bold_img .header .set_data_shape (tuple (data_shape ))
650
650
651
651
# save the resulting bold file
@@ -654,8 +654,8 @@ def _remove_volumes(bold_file, n_volumes):
654
654
return out
655
655
656
656
657
- def _add_volumes (bold_file , bold_cut_file , n_volumes ):
658
- """prepend n_volumes from bold_file onto bold_cut_file"""
657
+ def _add_volumes (bold_file , bold_cut_file , skip_vols ):
658
+ """prepend skip_vols from bold_file onto bold_cut_file"""
659
659
import nibabel as nb
660
660
from nipype .utils .filemanip import fname_presuffix
661
661
@@ -665,8 +665,8 @@ def _add_volumes(bold_file, bold_cut_file, n_volumes):
665
665
bold_cut_img = nb .load (bold_cut_file )
666
666
bold_cut_data = bold_cut_img .get_data ()
667
667
668
- # assign everything from n_volumes foward to bold_cut_data
669
- bold_data [..., n_volumes :] = bold_cut_data
668
+ # assign everything from skip_vols foward to bold_cut_data
669
+ bold_data [..., skip_vols :] = bold_cut_data
670
670
671
671
out = fname_presuffix (bold_cut_file , suffix = '_addnonsteady' )
672
672
bold_img .__class__ (bold_data , bold_img .affine , bold_img .header ).to_filename (out )
0 commit comments