Skip to content

Commit 9dac174

Browse files
committed
ENH: Persist M-CRIB-S output directory when used
1 parent e71444a commit 9dac174

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

nibabies/cli/parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,11 @@ def parse_args(args=None, namespace=None):
767767
config.execution.nibabies_dir = output_dir
768768
elif output_layout == "legacy":
769769
config.execution.nibabies_dir = output_dir / "nibabies"
770+
if config.workflow.surface_recon_method == "mcribs":
771+
if output_layout == "bids":
772+
config.execution.mcribs_dir = output_dir / "sourcedata" / "mcribs"
773+
elif output_layout == "legacy":
774+
config.execution.mcribs_dir = output_dir / "mcribs"
770775

771776
# Wipe out existing work_dir
772777
if opts.clean_workdir and work_dir.exists():

nibabies/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ class execution(_Config):
394394
"""Output verbosity."""
395395
low_mem = None
396396
"""Utilize uncompressed NIfTIs and other tricks to minimize memory allocation."""
397+
mcribs_dir = None
398+
"""M-CRIB-S processing and output directory."""
397399
md_only_boilerplate = False
398400
"""Do not convert boilerplate from MarkDown to LaTex and HTML."""
399401
nibabies_dir = None
@@ -439,6 +441,7 @@ class execution(_Config):
439441
"fs_subjects_dir",
440442
"layout",
441443
"log_dir",
444+
"mcribs_dir",
442445
"nibabies_dir",
443446
"output_dir",
444447
"segmentation_atlases_dir",

nibabies/workflows/anatomical/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ def init_infant_anat_wf(
417417
elif config.workflow.surface_recon_method == 'mcribs':
418418
from .surfaces import init_mcribs_surface_recon_wf
419419

420-
surface_recon_wf = init_mcribs_surface_recon_wf(use_aseg=bool(precomp_aseg))
420+
surface_recon_wf = init_mcribs_surface_recon_wf(
421+
use_aseg=bool(precomp_aseg),
422+
mcribs_dir=config.execution.mcribs_dir, # Needed to preserve runs
423+
)
421424

422425
# fmt:off
423426
wf.connect([

0 commit comments

Comments
 (0)