Skip to content

Commit e71444a

Browse files
committed
ENH: Allow for mcribs surface processing
1 parent 30861e7 commit e71444a

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

nibabies/workflows/anatomical/base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,19 +401,23 @@ def init_infant_anat_wf(
401401
if not freesurfer:
402402
return wf
403403

404-
if config.workflow.force_reconall:
404+
if config.workflow.surface_recon_method == 'freesurfer':
405405
from smriprep.workflows.surfaces import init_surface_recon_wf
406406

407407
surface_recon_wf = init_surface_recon_wf(omp_nthreads=omp_nthreads, hires=hires)
408-
else:
409-
from .surfaces import init_infant_surface_recon_wf
408+
elif config.workflow.surface_recon_method == 'infantfs':
409+
from .surfaces import init_infantfs_surface_recon_wf
410410

411411
# if running with precomputed aseg, or JLF, pass the aseg along to FreeSurfer
412412
use_aseg = bool(precomp_aseg or segmentation_atlases)
413-
surface_recon_wf = init_infant_surface_recon_wf(
413+
surface_recon_wf = init_infantfs_surface_recon_wf(
414414
age_months=age_months,
415415
use_aseg=use_aseg,
416416
)
417+
elif config.workflow.surface_recon_method == 'mcribs':
418+
from .surfaces import init_mcribs_surface_recon_wf
419+
420+
surface_recon_wf = init_mcribs_surface_recon_wf(use_aseg=bool(precomp_aseg))
417421

418422
# fmt:off
419423
wf.connect([

nibabies/workflows/anatomical/surfaces.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
]
3131

3232

33-
def init_mcribs_surface_recon_wf(*, mcribs_dir=None, name="mcribs_surface_recon_wf"):
33+
def init_mcribs_surface_recon_wf(*, use_aseg, mcribs_dir=None, name="mcribs_surface_recon_wf"):
34+
"""
35+
Reconstruct cortical surfaces using the M-CRIB-S pipeline.
36+
37+
This workflow injects a precomputed segmentation into the M-CRIB-S pipeline, bypassing the
38+
DrawEM segmentation step that is normally performed.
39+
"""
3440
from niworkflows.interfaces.nibabel import MapLabels, ReorientImage
3541

3642
from ...interfaces.mcribs import MCRIBReconAll
@@ -136,6 +142,7 @@ def init_mcribs_surface_recon_wf(*, mcribs_dir=None, name="mcribs_surface_recon_
136142
# fmt:on
137143
return wf
138144

145+
139146
from nipype.interfaces import fsl
140147
from nipype.interfaces import utility as niu
141148
from nipype.pipeline import engine as pe
@@ -144,7 +151,9 @@ def init_mcribs_surface_recon_wf(*, mcribs_dir=None, name="mcribs_surface_recon_
144151
from ...interfaces.workbench import CreateSignedDistanceVolume
145152

146153

147-
def init_infant_surface_recon_wf(*, age_months, use_aseg=False, name="infant_surface_recon_wf"):
154+
def init_infantfs_surface_recon_wf(
155+
*, age_months, use_aseg=False, name="infantfs_surface_recon_wf"
156+
):
148157
from nibabies.interfaces.freesurfer import InfantReconAll
149158

150159
# Synchronized inputs to smriprep.workflows.surfaces.init_surface_recon_wf

0 commit comments

Comments
 (0)