Skip to content

Commit 91c5fc3

Browse files
authored
Merge pull request #453 from nipreps/docker/test-syn
FIX: SyN workflow
2 parents d14da28 + 34348f8 commit 91c5fc3

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

nibabies/workflows/base.py

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ def init_single_subject_wf(
604604
omp_nthreads=omp_nthreads,
605605
output_dir=output_dir,
606606
subject=subject_id,
607+
sd_prior=False, # No priors for infants yet
607608
)
608609
fmap_wf.__desc__ = f"""
609610
@@ -618,17 +619,18 @@ def init_single_subject_wf(
618619
if node.split('.')[-1].startswith('ds_'):
619620
fmap_wf.get_node(node).interface.out_path_base = ''
620621

621-
fmap_select_std = pe.Node(
622-
KeySelect(fields=['std2anat_xfm'], key='MNI152NLin2009cAsym'),
623-
name='fmap_select_std',
624-
run_without_submitting=True,
625-
)
626-
if any(estimator.method == fm.EstimatorType.ANAT for estimator in fmap_estimators):
627-
workflow.connect([
628-
(anat_fit_wf, fmap_select_std, [
629-
('outputnode.std2anat_xfm', 'std2anat_xfm'),
630-
('outputnode.template', 'keys')]),
631-
]) # fmt:skip
622+
# MG: No prior is used ATM, so no need for xfm
623+
# fmap_select_std = pe.Node(
624+
# KeySelect(fields=['std2anat_xfm'], key='MNI152NLin2009cAsym'),
625+
# name='fmap_select_std',
626+
# run_without_submitting=True,
627+
# )
628+
# if any(estimator.method == fm.EstimatorType.ANAT for estimator in fmap_estimators):
629+
# workflow.connect([
630+
# (anat_fit_wf, fmap_select_std, [
631+
# ('outputnode.std2anat_xfm', 'std2anat_xfm'),
632+
# ('outputnode.template', 'keys')]),
633+
# ]) # fmt:skip
632634

633635
for estimator in fmap_estimators:
634636
config.loggers.workflow.info(
@@ -663,6 +665,7 @@ def init_single_subject_wf(
663665
debug=config.execution.sloppy,
664666
auto_bold_nss=True,
665667
t1w_inversion=False,
668+
sd_prior=False,
666669
name=f'syn_preprocessing_{estimator.bids_id}',
667670
)
668671
syn_preprocessing_wf.inputs.inputnode.in_epis = sources
@@ -673,9 +676,10 @@ def init_single_subject_wf(
673676
('outputnode.anat_preproc', 'inputnode.in_anat'),
674677
('outputnode.anat_mask', 'inputnode.mask_anat'),
675678
]),
676-
(fmap_select_std, syn_preprocessing_wf, [
677-
('std2anat_xfm', 'inputnode.std2anat_xfm'),
678-
]),
679+
# MG: No prior is used ATM, so no need for xfm
680+
# (fmap_select_std, syn_preprocessing_wf, [
681+
# ('std2anat_xfm', 'inputnode.std2anat_xfm'),
682+
# ]),
679683
(syn_preprocessing_wf, fmap_wf, [
680684
('outputnode.epi_ref', f'in_{estimator.bids_id}.epi_ref'),
681685
('outputnode.epi_mask', f'in_{estimator.bids_id}.epi_mask'),
@@ -920,6 +924,7 @@ def map_fieldmap_estimation(
920924
fmapless=bool(use_syn) or ignore_fieldmaps and force_syn,
921925
force_fmapless=force_syn or ignore_fieldmaps and use_syn,
922926
bids_filters=filters,
927+
anat_suffix=['T1w', 'T2w'],
923928
)
924929

925930
if not fmap_estimators:
@@ -933,12 +938,16 @@ def map_fieldmap_estimation(
933938
raise ValueError(message)
934939
return [], {}
935940

936-
if ignore_fieldmaps and any(f.method == fm.EstimatorType.ANAT for f in fmap_estimators):
937-
config.loggers.workflow.info(
938-
'Option "--ignore fieldmaps" was set, but either "--use-syn-sdc" '
939-
'or "--force-syn" were given, so fieldmap-less estimation will be executed.'
940-
)
941-
fmap_estimators = [f for f in fmap_estimators if f.method == fm.EstimatorType.ANAT]
941+
if ignore_fieldmaps:
942+
if any(f.method == fm.EstimatorType.ANAT for f in fmap_estimators):
943+
config.loggers.workflow.info(
944+
'Option "--ignore fieldmaps" was set, but either "--use-syn-sdc" '
945+
'or "--force-syn" were given, so fieldmap-less estimation will be executed.'
946+
)
947+
fmap_estimators = [f for f in fmap_estimators if f.method == fm.EstimatorType.ANAT]
948+
else:
949+
config.loggers.workflow.info('Ignoring fieldmaps - no estimators will be used.')
950+
return [], {}
942951

943952
# Pare down estimators to those that are actually used
944953
# If fmap_estimators == [], all loops/comprehensions terminate immediately

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies = [
3434
"pybids >= 0.15.0",
3535
"requests",
3636
"SimpleITK",
37-
"sdcflows >= 2.10.0",
37+
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
3838
"smriprep >= 0.17.0",
3939
"tedana >= 23.0.2",
4040
"templateflow >= 24.2.0",

0 commit comments

Comments
 (0)