nibabies icon indicating copy to clipboard operation
nibabies copied to clipboard

RF: Move to fit/apply workflow

Open mgxd opened this issue 2 months ago • 0 comments

The goal of this PR is mirror workflow changes in fMRIPrep, splitting the processing into "fit" and "apply" modes.

This is still a work-in-progress.

New features:

  • --level {minimal, resampling, full} to specify levels of outputs:

    • minimal produces anatomical template, mask, anatomical -> template registrations, surface reconstruction. These can then be further processed and/or manually edited and reused as --derivatives inputs.
    • full produces all outputs, like previous versions of nibabies
  • Increased control in the use of previously computed derivatives

    • Derivatives no longer need to be in native T1w/T2w space, as long as a T1w/T2w preprocessed template is include.
  • Selective anatomical reference preference with --reference-anatomical flag

    • Previously, T1w was preferred as the output space.
    • If no option is specified, will select based on
        1. surface reconstruction method
        1. participant age

Example MCRIBS derivatives input and command

Generating surfaces with MCRIBS still requires precomputed segmentations - this is an example directory layout that can be used:

data/derivatives/anat
├── dataset_description.json
└── sub-01
    └── ses-1mo
        └── anat
            ├── sub-01_ses-1mo_desc-preproc_T1w.nii.gz
            ├── sub-01_ses-1mo_desc-preproc_T2w.nii.gz
            ├── sub-01_ses-1mo_space-T2w_desc-aseg_dseg.nii.gz
            └── sub-01_ses-1mo_space-T2w_desc-brain_mask.nii.gz
  • Note that sub-01_ses-1mo_desc-preproc_T2w.nii.gz is a denoised and INU corrected image, and is used as space-T2w. The aseg and mask are in that image space.
nibabies /data /data/derivatives/nibabies participant \
-w /work --participant-label 01 \
--fs-subjects-dir /opt/freesurfer/subjects \
--derivatives anat=/data/derivatives/anat \
--anat-only --surface-recon-method mcribs --cifti-output -s 1mo

mgxd avatar Apr 29 '24 15:04 mgxd