FMRIPrep: running in derivatives folder

Hi,
I am new to using fMRIPrep, and after reading the documentation (at https://fmriprep.readthedocs.io/en/latest/), I still have a few questions. Which level of my bids directory can I run the docker version at? I would like to avoid touching my sourcedata directory, and just run this program in the derivatives directory. Is this possible?

Thank you,
Lauren Ericksen
University of Utah

Fmriprep should never modify a file outside of the derivatives directory, but it will need to be able to read files out side of the derivatives directory in order to work properly. Are you seeing fmriprep modify sourcedata files?

Otherwise do you want to preprocess data in the sourcedata directory or is there some kind of data in the derivatives directory that you were looking to preprocess?

Okay, perfect! I was hoping to only preprocess data in my derivatives directory, so that I have an untouched version in sourcedata (in case something goes wrong). I wanted to double-check before I ran anything.

Thank you,
Lauren

Ah so if the data being processed is in derivatives you can mount that dirvatives directory directly into the container by passing the source data:

docker run -ti --rm \ -v filepath/to/data/dir:/data:ro \ -v filepath/to/output/dir:/out \ poldracklab/fmriprep:latest \ /data /out/out \ participant

That first argument to the first -v would become something along the lines of filepath/to/derivatives_dir_with_data/

Regardless whether you are using containers or not, you should make sure you revoke write permissions to the input dataset. If you want to follow BIDS and write under <your_dataset>/derivatives, then make sure that only one is writable.