Is there documentation available for which stage of the fmriprep workflow each file in the working directory corresponds to?

Using the fmriprep command with a working directory option generates a large number of subfolders. I wanted to check the intermediate files at several stages of the workflow, but I’m unsure what step each file in this working directory corresponds to.

Is there any documentation available for the same - mapping the file names within the working directory to stages of the fmriprep workflow?

The work directory follows Nipype’s structure, as that is the framework we use to build the workflow.

However, those intermediate steps are not intended for consumption. Meaning, the development team will not make large efforts to document those, assuming that advanced users who want to play around these intermediate results really know what they are doing.

Alternatively, you can check the design of fMRIPrep with the documentation and the paper and build alternative workflows using the tools we provide (smriprep, sdcflows, niworkflows, and fmriprep itself). Those are currently documented, and if not, we will decidedly make an effort to document them.

The overarching principle is that, if you decide to use the intermediate results there is no way to assess the reproducibility of what you’ve done. If you use the API we offer (and I’m aware this option can turn out too tedious), then reproducibility will be easier to achieve.

EDIT: I’d like to pull @mattcieslak into this interesting discussion, as he is leading the comparison of SDC methods. He might be already doing what you intend.

@Shreya_13 which files are you hoping to check? We’ve been pulling out the ants warps from distortion correction.

Hi @mattcieslak and @oesteban,

Thanks for your response. Our lab has been using a custom fMRI preprocessing workflow for quite some time now, but we wanted to make a switch to fmriprep, given its reproducibility. Before doing so however, we wanted to see if the time series returned by the two pipelines are more or less comparable.

The voxels were combined into regions of interest (ROI) using the AAL atlas. On comparing time series of the corresponding ROIs of the preprocessed bold outputs, of both the lab pipeline and fmriprep, we noticed that though most ROIs were correlated, there were still visible differences in the time series.

Consequently, we are trying to re-order our pipeline in the same order as fmriprep, to compare the outputs at each stage of the pipeline, to see which stage contributes maximally to the differences between the pipelines. On going through the fmriprep documentation, I saw that slice timing correction is applied first to the BOLD image and then computed mappings (head motion correction, SDC, BOLD to T1 registration, T1 to MNI space registration) are concatenated and applied to the image in in one go.

This suggests that there will be two intermediate BOLD files to which changes have been applied - one after slice timing correction, and one after the concatenated mapping is applied. These are the two files I’m looking for. If the files after each individual step - HMC, SDC, T1 to BOLD registration etc. - do exist, it would be great if you could direct me to those.