Fmriprep: how to run new task without rerunning other things?

Hello,

I ran fmriprep previously on resting state data. I had converted raw T1 data and resting data to bids format in a bids folder. fmriprep ran well with it.

I now have converted raw task data into the same bids folder. I would like to run fmriprep only on this task data, and let it use what it already has saved from when it ran the original resting state data with the T1. I don’t want it to rerun ants or any of the steps of normalizing the T1 structurals etc. since it had already done that previously with the resting.

I have tried running it like this:
fmriprep-docker ${bidsdata} ${preproc}/derivatives participant --participant-label ${l} --task-id ${taskid} --fs-license-file ~/freesurferlicense.txt

thinking that by telling it the task ID it would at least ignore redoing the resting data and then hopefully it wouldn’t also redo any of the structural aspects that it doesn’t need to.

However, I can see right away it is apply ANTs.

How can I best run my new task data while making sure it doesn’t run unnecessary aspects all over again?

fmriprep 21.0.1 and fmriprep docker 21.0.1.

Thanks!

  1. Reuse the work directory from your first run (specified by the -w argument)
  2. Specify the --anat-derivatives argument pointing to the subjects fMRIPrep anat folder

Regardless, it should not be a problem if things are recomputed, since the software is built around reproducibility. It will just add some more time (but in the grand scheme of things, are a few extra hours or so really that big of deal? :slight_smile: ).

Best,
Steven

Thank you. I wish it wasn’t a problem but each subject takes a couple of hours on my computer, with most of the time spent on normalization, so saving an hour per subject translates to a several day difference which can be an issue with deadlines.

The -w flag confuses me a bit. I would think since there is a default working directory it would just keep using the same one? Or how do I find the previous working directory that was used? I assume that is not the same thing as pointing to the same output directory? How do I know where to point the -w and how does that help?

The --anat-derivatives option makes sense. I was a bit worried since it says not recommended, but I assume that’s just because if there is time, it doesn’t hurt to rerun all of it?

Thanks!

I think it is only not recommended to use anatomical derivatives from a different software (e.g. not fmriprep/smriprep).

You should be able to find the working directory from the log of the last run. I’ve always specified -w so I do not know if it would find the last run you did. In the work directory, you should find folders such as SUBJECTNAME_wf.

Have you considered analyzing data on brainlife.io? You can take advantage of a cloud-based computational architecture for free, preloaded with software such as fmriprep.

Best,
Steven

I will definitely look more into brainlife.io now to see how that can help. That all helps. Thanks!