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