Longitudinal Processing with sMRIPrep and QSIPrep

Hi all! I have some subjects in my dataset that have multiple MRI scans, but I’m struggling to understand the output structure of sMRIPrep (and QSIPrep for that matter) for these longitudinal cases.

For a subject with one scan, the “smriprep” output and “freesurfer” output generated by sMRIPrep looks like this:

For subjects with multiple scans, inside “smriprep” there is a set of processed files (nii.gz, .gii, etc.) I assume from one of the scans (the first? last? I’m unsure) under “anat”, and then inside each session folder is a single text file.

I would like to obtain the smriprep and freesurfer output for each scanning session, so that I can obtain metrics for each timepoint, and then subsequently perform QSIPrep on each scan to generate white matter tracts for each timepoint. I’ve tried running QSIPrep on a longitudinal case (with freesurfer-input set to sMRIPrep’s freesurfer output) and it fails, giving me a FileNotFoundError:

FileNotFoundError: /out/workdir/qsirecon_wf/sub-{PIDN}mrtrix_multishell_msmt_pyafq_tractometry/sub{PIDN}ses{DATE}_space_T1w_desc_preproc_recon_wf/qsirecon_anat_wf/resample_mask/result_resample_mask.pklz

Thank you so much in advance to anyone who can help provide some insight on this!

Hi @mkersey ,

When there are multiple sessions, the default for smriprep, qsiprep and fmriprep is to merge the anatomical image into what it is called a robust template, with the FreeSurfer methodology. There are different ways to merge several images into such a template. Here again, the default is to align this template on the first image (according to the name of the session in alphabetical order).
More details here.

If you want to process each session separately, you can follow the recommendation from @Steven from another thread:

For more details on the creation of the robust template within fmriprep (and also what happens to the T2w images), you can look at this other discussion:

1 Like

Thank you @jsein! This makes more sense now. So the default is to create a “robust template” which merges the sessions, but if I want to process each session separately I can use “–bids-filter-file” and this will automatically created the longitudinal file structure that would go along with it. I will try this out. Thanks again.

1 Like