fMRIPREP 22.0.2 - Process single run at a time (memory limits)

Hi all,

I am currently trying to preprocess an fMRI dataset where data was recorded with a low TR, so I have very large EPIs (up to 3000 images), of which I have multiple per session. I am using fmriprep 22.0.2 and singularity.

One problem I run into (I think) is that internal memory handlers are not working well in estimating the necessary RAM for certain preprocessing steps, thus exceeding the memory limits and in the worst case getting the job killed on the HPC.
This is especially an issue, when I assign more than one processor to fmriprep (–nprocs), as multiple of the very memory intensive steps are scheduled at the same time, even if they exceed limits set by --mem_mb significantly. So for now I only use --nprocs 1 (also for memory profiling), however, that feels a bit like a waste (and takes very long).

Unfortunately, fmriprep 22.0.2 does not have --run-id and --ses-id arguments anymore, with which I could have put limits on the amount of acquisitions. Limiting using --task-id is not enough.

I am wondering if there’s a way to force fMRIPREP to somehow only process a single acquisition (run) at a time?

Hi and welcome to Neurostars!

Yes, you can limit what fMRIPrep processes with a --bids-filter-file input. See here for an example: Documentation of --bids-filter-file input · Issue #2027 · nipreps/fmriprep · GitHub


Thank you, it seems to work :slight_smile:

Don’t know why I overlooked it but just for completion, here’s the link to the documentation in fmriprep itself:

This json seems to do the trick for me:

  "bold": {"datatype": "func", "suffix": "bold", "session": "01", "run": "1"}