From b3c1b8dbc9663134ab59ae808fc37da06cfc78a4 Mon Sep 17 00:00:00 2001 From: Mathias Goncalves Date: Fri, 23 Aug 2024 16:42:50 -0400 Subject: [PATCH 1/2] FIX: Ensure 2mm template is added when running CIFTI --- nibabies/workflows/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nibabies/workflows/base.py b/nibabies/workflows/base.py index 14c83e1f..a195fb78 100644 --- a/nibabies/workflows/base.py +++ b/nibabies/workflows/base.py @@ -840,7 +840,7 @@ def init_workflow_spaces(execution_spaces: SpatialReferences, age_months: int): spaces.add(Reference('MNI152NLin6Asym', {'res': vol_res})) # Ensure a non-native version of MNIInfant is added as a target cohort = cohort_by_months('MNIInfant', age_months) - spaces.add(Reference('MNIInfant', {'cohort': cohort})) + spaces.add(Reference('MNIInfant', {'cohort': cohort, 'res': 2})) return spaces @@ -955,10 +955,10 @@ def get_MNIInfant_key(spaces: SpatialReferences) -> str: key = None for space in spaces.references: # str formats as : - if 'MNIInfant' in str(space) and 'res-native' not in str(space): + if 'MNIInfant' in str(space) and 'res-2' in str(space): key = str(space) break if key is None: - raise KeyError(f'MNIInfant not found in SpatialReferences: {spaces}') + raise KeyError(f'MNIInfant (resolution 2x2x2) not found in SpatialReferences: {spaces}') return key From c63ebb353b8f523dd15f21e9427fa6bf068462d4 Mon Sep 17 00:00:00 2001 From: Mathias Goncalves Date: Mon, 26 Aug 2024 09:50:59 -0400 Subject: [PATCH 2/2] TST: Update configuration test --- nibabies/tests/test_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nibabies/tests/test_config.py b/nibabies/tests/test_config.py index d0003e51..13e0f1a2 100644 --- a/nibabies/tests/test_config.py +++ b/nibabies/tests/test_config.py @@ -94,13 +94,14 @@ def test_config_spaces(): assert [str(s) for s in spaces.get_standard(full_spec=True)] == [ 'MNIInfant:cohort-1:res-native', # Default output space 'MNI152NLin6Asym:res-2', + 'MNIInfant:cohort-1:res-2', # CIFTI: MNIInfant (2x2x2) -> MNI152NLin6Asym (2x2x2) ] assert [ format_reference((s.fullname, s.spec)) for s in spaces.references if s.standard and s.dim == 3 - ] == ['MNIInfant_cohort-1_res-native', 'MNI152NLin6Asym_res-2', 'MNIInfant_cohort-1'] + ] == ['MNIInfant_cohort-1_res-native', 'MNI152NLin6Asym_res-2', 'MNIInfant_cohort-1_res-2'] _reset_config()