Skip to content

Commit 8067223

Browse files
authored
Merge pull request #82 from effigies/fix/syn
FIX: Connect SyN outputs whenever SyN is run
2 parents 4125c2f + eafd46a commit 8067223

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ jobs:
8787
name: Install ds001600
8888
command: |
8989
datalad install https://github.com/OpenNeuroDatasets/ds001600.git
90-
datalad update --merge ds001600/
91-
datalad get -r ds001600/*
90+
datalad update --merge -d ds001600/
91+
datalad get -r -d ds001600/
9292
- run:
9393
name: Get testdata
9494
command: |

sdcflows/workflows/base.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ def init_sdc_estimate_wf(fmaps, epi_meta, omp_nthreads=1, debug=False):
233233
('epi_brain', 'inputnode.in_reference_brain'),
234234
('t1w_brain', 'inputnode.t1w_brain'),
235235
('std2anat_xfm', 'inputnode.std2anat_xfm')]),
236+
(syn_sdc_wf, outputnode, [
237+
('outputnode.out_reference', 'syn_ref')]),
236238
])
237239

238240
# XXX Eliminate branch when forcing isn't an option
@@ -241,10 +243,6 @@ def init_sdc_estimate_wf(fmaps, epi_meta, omp_nthreads=1, debug=False):
241243
sdc_unwarp_wf = syn_sdc_wf
242244
else: # --force-syn was called when other fieldmap was present
243245
sdc_unwarp_wf.__desc__ = None
244-
workflow.connect([
245-
(syn_sdc_wf, outputnode, [
246-
('outputnode.out_reference', 'syn_ref')]),
247-
])
248246

249247
workflow.connect([
250248
(sdc_unwarp_wf, outputnode, [
@@ -287,6 +285,10 @@ def fieldmap_wrangler(layout, target_image, use_syn=False, force_syn=False):
287285
for k in sorted(fmap.keys()) if k.startswith('phase')],
288286
})
289287

290-
if force_syn is True or (not fieldmaps and use_syn is True):
291-
fieldmaps['syn'] = force_syn
288+
if fieldmaps and force_syn:
289+
# syn: True -> Run SyN in addition to fieldmap-based SDC
290+
fieldmaps['syn'] = True
291+
elif not fieldmaps and (force_syn or use_syn):
292+
# syn: False -> Run SyN as only SDC
293+
fieldmaps['syn'] = False
292294
return fieldmaps

0 commit comments

Comments
 (0)