Only one t1w image found with fmriprep

I have a dataset consisting of a mix of controls with one baseline scanning session and patients with baseline and followup (posttreatment) scans.
I got the impression that fmriprep would detect multiple anatomical images and treat as longitudinal. However, it seems that freesurfer was only run on baseline scan, and the output html states that “A total of 1 T1-weighted (T1w) images were found” and followup fmri scans seems to be normalised to baseline anatomical.

Q1. What am I doing wrong here?

Q2. What would be the best approach given that I want to treat the dataset as either crossectional (controls vs patients) or longitudinal (pre and post treatment) depending on research question: 1) keep as is, using baseline as reference, 2) use average of pre and post as reference for patients (if I figure out how) or 3) use both preprocessing pipelines, one for crossectional and one for longitudinal?

I appreciate any input!

Where do we say this? Because we must fix that right away. fMRIPrep treats all T1w scans as cross-sectional (i.e., registers them altogether and calculates a template average of them).

Probably you’re not correctly encoding your T1w images with BIDS - fMRIPrep would tell you if it found more than one.

Do you expect to have substantial differences in anatomy post-treatmen (e.g., surgery)? If so, then you’ll need to split the data of your subjects and generate two subject IDs so that fMRIPrep believes they are indeed different subjects and deals with them separately (“longitudinal”).

Otherwise, see Q&A 1.

In any case, you should first fix the design of your study and then determine whether fMRIPrep is the right tool, and if so, then how to leverage fMRIPrep to carry out such design - not the other way around.

Thank you for replying!

I got that from here:

“In the case of multiple T1w images (across sessions and/or runs), T1w images are merged into a single template image using FreeSurfer’s mri_robust_template. This template may be unbiased , or equidistant from all source images, or aligned to the first image (determined lexicographically by session label). For two images, the additional cost of estimating an unbiased template is trivial and is the default behavior…”

However, after specifying the --longitudinal flag the behavior was the same.

I did validate the dataset with different tools. An exerpt tree is provided below:

├── ses-baseline
│ ├── anat
│ │ ├── sub-107_ses-baseline_T1w.json
│ │ └── sub-107_ses-baseline_T1w.nii.gz
│ ├── dwi
│ │ ├── sub-107_ses-baseline_dwi.bval
│ │ ├── sub-107_ses-baseline_dwi.bvec
│ │ ├── sub-107_ses-baseline_dwi.json
│ │ └── sub-107_ses-baseline_dwi.nii.gz
│ ├── func
│ │ ├── sub-107_ses-baseline_task-rest_bold.json
│ │ ├── sub-107_ses-baseline_task-rest_bold.nii.gz
│ │ ├── sub-107_ses-baseline_task-rest_physio.json
│ │ └── sub-107_ses-baseline_task-rest_physio.tsv.gz
│ ├── sub-107_ses-baseline_scans.json
│ └── sub-107_ses-baseline_scans.tsv
├── ses-followup
│ ├── anat
│ │ ├── sub-107_ses-followup_T1w.json
│ │ └── sub-107_ses-followup_T1w.nii.gz
│ ├── dwi
│ │ ├── sub-107_ses-followup_dwi.bval
│ │ ├── sub-107_ses-followup_dwi.bvec
│ │ ├── sub-107_ses-followup_dwi.json
│ │ └── sub-107_ses-followup_dwi.nii.gz
│ ├── func
│ │ ├── sub-107_ses-followup_task-rest_bold.json
│ │ ├── sub-107_ses-followup_task-rest_bold.nii.gz
│ │ ├── sub-107_ses-followup_task-rest_physio.json
│ │ └── sub-107_ses-followup_task-rest_physio.tsv.gz
│ ├── sub-107_ses-followup_scans.json
│ └── sub-107_ses-followup_scans.tsv
└── sub-107_sessions.tsv

I think the unbiased template approach is fine for pre/post comparisons, my concern was whether this would introduce bias when doing a baseline comparison vs healthy controls.

Maybe worth mentioning, when I run the separate Freesurfer BIDS app, it identifies both t1:s and does a longitudinal preprocessing without any additional flags.