Skip to content

Commit a01b1c8

Browse files
authored
Merge pull request #381 from mgxd/fix/cifti-resample
FIX: Ensure 2mm template is added when running CIFTI
2 parents bdf9679 + c63ebb3 commit a01b1c8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

nibabies/tests/test_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@ def test_config_spaces():
9494
assert [str(s) for s in spaces.get_standard(full_spec=True)] == [
9595
'MNIInfant:cohort-1:res-native', # Default output space
9696
'MNI152NLin6Asym:res-2',
97+
'MNIInfant:cohort-1:res-2', # CIFTI: MNIInfant (2x2x2) -> MNI152NLin6Asym (2x2x2)
9798
]
9899

99100
assert [
100101
format_reference((s.fullname, s.spec))
101102
for s in spaces.references
102103
if s.standard and s.dim == 3
103-
] == ['MNIInfant_cohort-1_res-native', 'MNI152NLin6Asym_res-2', 'MNIInfant_cohort-1']
104+
] == ['MNIInfant_cohort-1_res-native', 'MNI152NLin6Asym_res-2', 'MNIInfant_cohort-1_res-2']
104105
_reset_config()
105106

106107

nibabies/workflows/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ def init_workflow_spaces(execution_spaces: SpatialReferences, age_months: int):
840840
spaces.add(Reference('MNI152NLin6Asym', {'res': vol_res}))
841841
# Ensure a non-native version of MNIInfant is added as a target
842842
cohort = cohort_by_months('MNIInfant', age_months)
843-
spaces.add(Reference('MNIInfant', {'cohort': cohort}))
843+
spaces.add(Reference('MNIInfant', {'cohort': cohort, 'res': 2}))
844844

845845
return spaces
846846

@@ -955,10 +955,10 @@ def get_MNIInfant_key(spaces: SpatialReferences) -> str:
955955
key = None
956956
for space in spaces.references:
957957
# str formats as <reference.name>:<reference.spec>
958-
if 'MNIInfant' in str(space) and 'res-native' not in str(space):
958+
if 'MNIInfant' in str(space) and 'res-2' in str(space):
959959
key = str(space)
960960
break
961961

962962
if key is None:
963-
raise KeyError(f'MNIInfant not found in SpatialReferences: {spaces}')
963+
raise KeyError(f'MNIInfant (resolution 2x2x2) not found in SpatialReferences: {spaces}')
964964
return key

0 commit comments

Comments
 (0)