@@ -79,7 +79,7 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
79
79
from fmriprep.workflows.fieldmap import init_sdc_wf
80
80
wf = init_sdc_wf(
81
81
fmaps=[{
82
- 'type ': 'phasediff',
82
+ 'suffix ': 'phasediff',
83
83
'phasediff': 'sub-03/ses-2/fmap/sub-03_ses-2_run-1_phasediff.nii.gz',
84
84
'magnitude1': 'sub-03/ses-2/fmap/sub-03_ses-2_run-1_magnitude1.nii.gz',
85
85
'magnitude2': 'sub-03/ses-2/fmap/sub-03_ses-2_run-1_magnitude2.nii.gz',
@@ -140,7 +140,7 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
140
140
"""
141
141
142
142
# TODO: To be removed (filter out unsupported fieldmaps):
143
- fmaps = [fmap for fmap in fmaps if fmap ['type ' ] in FMAP_PRIORITY ]
143
+ fmaps = [fmap for fmap in fmaps if fmap ['suffix ' ] in FMAP_PRIORITY ]
144
144
145
145
workflow = Workflow (name = 'sdc_wf' if fmaps else 'sdc_bypass_wf' )
146
146
inputnode = pe .Node (niu .IdentityInterface (
@@ -170,15 +170,15 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
170
170
"""
171
171
172
172
# In case there are multiple fieldmaps prefer EPI
173
- fmaps .sort (key = lambda fmap : FMAP_PRIORITY [fmap ['type ' ]])
173
+ fmaps .sort (key = lambda fmap : FMAP_PRIORITY [fmap ['suffix ' ]])
174
174
fmap = fmaps [0 ]
175
175
176
176
# PEPOLAR path
177
- if fmap ['type ' ] == 'epi' :
177
+ if fmap ['suffix ' ] == 'epi' :
178
178
outputnode .inputs .method = 'PEB/PEPOLAR (phase-encoding based / PE-POLARity)'
179
179
# Get EPI polarities and their metadata
180
180
epi_fmaps = [(fmap_ ['epi' ], fmap_ ['metadata' ]["PhaseEncodingDirection" ])
181
- for fmap_ in fmaps if fmap_ ['type ' ] == 'epi' ]
181
+ for fmap_ in fmaps if fmap_ ['suffix ' ] == 'epi' ]
182
182
sdc_unwarp_wf = init_pepolar_unwarp_wf (
183
183
bold_meta = bold_meta ,
184
184
epi_fmaps = epi_fmaps ,
@@ -193,11 +193,11 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
193
193
])
194
194
195
195
# FIELDMAP path
196
- if fmap ['type ' ] in ['fieldmap' , 'phasediff' ]:
197
- outputnode .inputs .method = 'FMB (%s-based)' % fmap ['type ' ]
196
+ if fmap ['suffix ' ] in ['fieldmap' , 'phasediff' ]:
197
+ outputnode .inputs .method = 'FMB (%s-based)' % fmap ['suffix ' ]
198
198
# Import specific workflows here, so we don't break everything with one
199
199
# unused workflow.
200
- if fmap ['type ' ] == 'fieldmap' :
200
+ if fmap ['suffix ' ] == 'fieldmap' :
201
201
from .fmap import init_fmap_wf
202
202
fmap_estimator_wf = init_fmap_wf (
203
203
omp_nthreads = omp_nthreads ,
@@ -206,7 +206,7 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
206
206
fmap_estimator_wf .inputs .inputnode .fieldmap = fmap ['fieldmap' ]
207
207
fmap_estimator_wf .inputs .inputnode .magnitude = fmap ['magnitude' ]
208
208
209
- if fmap ['type ' ] == 'phasediff' :
209
+ if fmap ['suffix ' ] == 'phasediff' :
210
210
from .phdiff import init_phdiff_wf
211
211
fmap_estimator_wf = init_phdiff_wf (omp_nthreads = omp_nthreads )
212
212
# set inputs
@@ -235,7 +235,7 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
235
235
])
236
236
237
237
# FIELDMAP-less path
238
- if any (fm ['type ' ] == 'syn' for fm in fmaps ):
238
+ if any (fm ['suffix ' ] == 'syn' for fm in fmaps ):
239
239
syn_sdc_wf = init_syn_sdc_wf (
240
240
bold_pe = bold_meta .get ('PhaseEncodingDirection' , None ),
241
241
omp_nthreads = omp_nthreads )
@@ -250,7 +250,7 @@ def init_sdc_wf(fmaps, bold_meta, omp_nthreads=1,
250
250
])
251
251
252
252
# XXX Eliminate branch when forcing isn't an option
253
- if fmap ['type ' ] == 'syn' : # No fieldmaps, but --use-syn
253
+ if fmap ['suffix ' ] == 'syn' : # No fieldmaps, but --use-syn
254
254
outputnode .inputs .method = 'FLB ("fieldmap-less", SyN-based)'
255
255
sdc_unwarp_wf = syn_sdc_wf
256
256
else : # --force-syn was called when other fieldmap was present
0 commit comments