fMRIPrep/FreeSurfer longitudinal workflow for T1w sequences

I’m working on a morphological study (cortical thickness, etc) with a longitudinal dataset where each subject contains 6 scan sessions. Using fMRIPrep version 23.2.1 (via Apptainer), I used the following command:

"unset PYTHONPATH; apptainer run 							\
-B ${bids_root_dir}:${bids_root_dir} 										\
-B ${templateflow_home_dir}:/opt/templateflow 								\
-B ${work_dir}:${work_dir} 													\
${bids_root_dir}/derivatives/fmriprep-${fmriprep_version}.simg 				\
$bids_root_dir $output_dir													\
    participant																\
    --participant-label $s 													\
    --skip-bids-validation 													\
    --md-only-boilerplate													\
    --anat-only																\
    --longitudinal															\
    --fs-license-file $FREESURFER_HOME/license.txt							\
    --output-spaces fsaverage fsLR											\
    --nthreads $cores														\
    --stop-on-first-crash 													\
    --resource-monitor 														\
    --mem_mb $reduced_mem 													\
    --use-plugin $bids_root_dir/fmriprep_plugin_${s}.yml 					\
    --verbose 																\
    --output-layout bids 													\
    -w $work_dir/sub-${s}" 

This provides an unbiased anatomical template in my subject’s output anat folder; however, within the subject’s session anat folders there is only a transform file *from-orig_to-T1w_mode-image_xfm.txt.

I’m a bit unsure how to proceed. Given the longitudinal nature of this dataset, I need to compare morphological measures across subjects’ scan sessions, yet fMRIPrep only generates a single template. My initial thought was to use --bids-filter-file to specify a specific session T1w; however, I worry this is excessive, as for each subject I’d have 6 separate jobs.

Hi @dlevitas,

If you’re just interested in morphometry, you might be better off just using freesurfer standalone with the qcache flag which normalizes your images to fsaverage and produces several morohometric maps already smoothed.


Thanks for this suggestion, @Steven, I wasn’t aware of this FreeSurfer feature. Just to clarify, you’re suggesting something like recon-all -s sub-01 -i sub-01_ses-01_T1w.nii.gz -all -qcache, where the -qcache flag accounts for the various subject sessions?

Hi @dlevitas,

You’ll still need one recon all command per t1, but the qcache flag will make all the files you need to run morphometry.


1 Like

That makes sense, thanks again for the assistance.