Fmriprep: How to break up into stages to facilitate practical reprocessing on failures

One of my frustrations with the current generation of resting-state fMRI pipelines is 1) nipype seems to want to rerun everything on already processed outputs that are being re-run (say for a bad registration), and 2) their run and done tooling. By this I mean that there aren’t clear cut stages that you can check outputs before further processing, which for example, freesurfer offers with their recon 1 2 and 3 staging. This ends up wasting a bunch of cycles.

How difficult would it be for me to split fmriprep into clear processing stages from which I can start and stop, then continue?

Hi @Joshua_Lee,

I would imagine it would be difficult to code custom stopping points that are not already defined by the --level flag without Nipype fluency. What stopping point did you have in mind?

Best,
Steven

Perhaps I misunderstood what the levels flag means. I’ll review.

I’m rerunning fmriprep where the only thing that I changed was the dof of bbregister from 12 to 6. So I thought that it wouldn’t take that long to rerun, with the functional and structural masks done, the T1 transform to the output space done, it seemed to me that it would basically be bbregister, computing the nuisance variables, and applying the transforms, but its running T1 ants registration again. Is this expected?

antsRegistration --collapse-output-transforms 1 --dimensionality 3 --float 1
–initial-moving-transform [ /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/transform.mat, 0 ]
`–initialize-transforms-per-stage 0
–interpolation LanczosWindowedSinc
–output [ ants_t1_to_mni, ants_t1_to_mni_Warped.nii.gz ]
–transform Rigid[ 0.05 ]
–metric Mattes[ /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/fixed_masked.nii.gz, /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/moving_masked.nii.gz, 1, 56, Regular, 0.25 ]
–convergence [ 100x100, 1e-06, 20 ]
–smoothing-sigmas 2.0x1.0vox
–shrink-factors 2x1
–use-histogram-matching 1
–transform Affine[ 0.08 ]
–metric Mattes[ /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/fixed_masked.nii.gz, /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/moving_masked.nii.gz, 1, 56, Regular, 0.25 ]
–convergence [ 100x100, 1e-06, 20 ]
–smoothing-sigmas 1.0x0.0vox -
-shrink-factors 2x1
–use-histogram-matching 1
–transform SyN[ 0.1, 3.0, 0.0 ]
–metric CC[ /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/fixed_masked.nii.gz, /scratch/fmriprep_24_1_wf/sub_108471100_wf/anat_fit_wf/register_template_wf/_template_MNI152NLin2009cAsym/registration/moving_masked.nii.gz, 1, 4, None, 1 ]
–convergence [ 100x70x50x20, 1e-06, 10 ]
–smoothing-sigmas 3.0x2.0x1.0x0.0vox
–shrink-factors 8x4x2x1
–use-histogram-matching 1
–winsorize-image-intensities [ 0.005, 0.995 ]
–write-composite-transform 1

What level are you running?

the level is set to full.

Thanks for clarifying this for me.
IMO, the current explanation is difficult to parse in the first read, particularly the interaction between selecting output spaces and the level flag. I see now that there is only one default output space, and that if I want intermediate spaces e.g. T1 then I need to supply that.

Overall, I am extremely happy with what the fmriprep team has accomplished, its reliability it top-tier which comes from your clearly defined mission (minimally processed).