Skip to content

Commit

Permalink
FEAT: Make multi-step registration optional
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Dec 13, 2024
1 parent aaa7cc9 commit 5eee41a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions nibabies/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ def _str_none(val):
action='store_true',
help='Replace low intensity voxels in CSF mask with average',
)
g_baby.add_argument(
'--multi-step-reg',
action='store_true',
help='For certain adult templates (MNI152NLin6Asym), perform two step '
'registrations (native -> MNIInfant -> template) and concatenate into a single xfm',
)
return parser


Expand Down
3 changes: 3 additions & 0 deletions nibabies/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ class workflow(_Config):
"""Run FreeSurfer ``recon-all`` with the ``-logitudinal`` flag."""
medial_surface_nan = None
"""Fill medial surface with :abbr:`NaNs (not-a-number)` when sampling."""
multi_step_reg = False
"""Perform multiple registrations (native -> MNIInfant -> template) and concatenate into a
single transform"""
norm_csf = False
"""Replace low intensity voxels in CSF mask with average."""
project_goodvoxels = False
Expand Down
10 changes: 7 additions & 3 deletions nibabies/workflows/anatomical/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,13 @@ def init_infant_anat_fit_wf(
concat_xfms = []

Check warning on line 889 in nibabies/workflows/anatomical/fit.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/fit.py#L889

Added line #L889 was not covered by tests
found_xfms = {}
intermediate = None # The intermediate space when concatenating xfms - includes cohort
intermediate_targets = {
'MNI152NLin6Asym',
} # TODO: 'MNI152NLin2009cAsym'
intermediate_targets = (

Check warning on line 892 in nibabies/workflows/anatomical/fit.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/fit.py#L891-L892

Added lines #L891 - L892 were not covered by tests
{
'MNI152NLin6Asym', # TODO: 'MNI152NLin2009cAsym'
}
if config.workflow.multi_step_reg
else set()
)

for template in spaces.get_spaces(nonstandard=False, dim=(3,)):
# resolution / spec will not differentiate here
Expand Down

0 comments on commit 5eee41a

Please sign in to comment.