@@ -63,35 +63,20 @@ def init_bold_stc_wf(metadata, name='bold_stc_wf'):
63
63
inputnode = pe .Node (niu .IdentityInterface (fields = ['bold_file' , 'skip_vols' ]), name = 'inputnode' )
64
64
outputnode = pe .Node (niu .IdentityInterface (fields = ['stc_file' ]), name = 'outputnode' )
65
65
66
- def create_custom_slice_timing_file_func (metadata ):
67
- import os
68
- slice_timings_sec = ["%f" % t for t in metadata ["SliceTiming" ]]
69
- out_file = os .path .abspath ("timings.1D" )
70
- with open (out_file , "w" ) as fp :
71
- fp .write ("\t " .join (slice_timings_sec ))
72
- return out_file
73
-
74
- create_custom_slice_timing_file = pe .Node (
75
- niu .Function (function = create_custom_slice_timing_file_func ),
76
- name = "create_custom_slice_timing_file" ,
77
- mem_gb = DEFAULT_MEMORY_MIN_GB )
78
- create_custom_slice_timing_file .inputs .metadata = metadata
66
+ LOGGER .log (25 , 'Slice-timing correction will be included.' )
79
67
80
68
# It would be good to fingerprint memory use of afni.TShift
81
69
slice_timing_correction = pe .Node (
82
- afni .TShift (outputtype = 'NIFTI_GZ' , tr = '{}s' .format (metadata ["RepetitionTime" ])),
70
+ afni .TShift (outputtype = 'NIFTI_GZ' ,
71
+ tr = '{}s' .format (metadata ["RepetitionTime" ]),
72
+ slice_timing = metadata ['SliceTiming' ]),
83
73
name = 'slice_timing_correction' )
84
74
85
75
copy_xform = pe .Node (CopyXForm (), name = 'copy_xform' , mem_gb = 0.1 )
86
76
87
- def _prefix_at (x ):
88
- return "@%s" % x
89
-
90
77
workflow .connect ([
91
78
(inputnode , slice_timing_correction , [('bold_file' , 'in_file' ),
92
79
('skip_vols' , 'ignore' )]),
93
- (create_custom_slice_timing_file , slice_timing_correction , [
94
- (('out' , _prefix_at ), 'tpattern' )]),
95
80
(slice_timing_correction , copy_xform , [('out_file' , 'in_file' )]),
96
81
(inputnode , copy_xform , [('bold_file' , 'hdr_file' )]),
97
82
(copy_xform , outputnode , [('out_file' , 'stc_file' )]),
0 commit comments