Missing FreeSurfer functional and anatomical derivatives using existing SUBJECTS_DIR

Summary of what happened:

When we run fmriprep, passing in an existing FreeSurfer run OR without, we don’t get certain derivatives mentioned in the docs. This may just be a misunderstanding on our part, with not enough context.

The missing bits are:

  • missing functional derivatives:

    • sub-<subject_label>_[specifiers]_space-T1w_desc-aparcaseg_dseg.nii.gz
      sub-<subject_label>_[specifiers]_space-T1w_desc-aseg_dseg.nii.gz
      sub-<subject_label>_[specifiers]_hemi-[LR]_space-<space_label>_bold.func.gii
  • missing anatomical derivatives:

    • sub-<subject_label>[_space-<space_label>]_desc-preproc_T2w.nii.gz

Command used (and if a helper script was used, a link to the helper script or the command generated):

fmriprep $bids_directory $derivatives_directory participant \
--skip-bids-validation \
--participant-label $participant_label \
--fs-license-file $Freesurfer_licence_path"/Freesurfer_License.txt" \
--fs-subjects-dir $singularity_bind_directory"/intermediate_data/BIDS/derivatives/freesurfer/" \
--work-dir $temp_work_directory \
--n_cpus $number_of_CPUs \
--mem_mb $allocated_memory_in_MB

Version:

  • fmriprep: v23.2.1
  • previous FreeSurfer runs passed via --fs-subjects-dir were generated by v7.1.1

Environment (Docker, Singularity / Apptainer, custom installation):

Singularity

Data formatted according to a validatable standard? Please provide the output of the validator:

Our input BIDS is not 100% compliant and has some warnings in DWI portions.

Relevant log outputs (up to 20 lines):

240715-11:40:57,917 nipype.workflow IMPORTANT:
   Building fMRIPrep's workflow:
           * BIDS dataset path: /mnt/afchron/processed_data/BIDS.
           * Participant list: ['1001'].
           * Run identifier: 20240715-113925_65dfe757-36c9-425d-a39f-4d275c882d89.
           * Output spaces: MNI152NLin2009cAsym:res-native.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /mnt/afchron/intermediate_data/BIDS/derivatives/freesurfer.

(so it is correctly detecting and passing in the FreeSurfer SUBJECTS_DIR. I’m really not at all an expert on fmriprep so I don’t know what other parts of the log would be helpful to put here?)

Screenshots / relevant information:

This is happening on two different (but similar) BIDS datasets.

The anat bits missing seem strange because we do get some of the files, e.g. sub-1001_space-MNI152NLin2009cAsym_dseg.nii.gz.

Not sure if it’s helpful, but I can dump what files we DO get.

Here’s ls anat:

sub-1001_desc-brain_mask.json
sub-1001_desc-brain_mask.nii.gz
sub-1001_desc-preproc_T1w.json
sub-1001_desc-preproc_T1w.nii.gz
sub-1001_desc-preproc_T2w.json
sub-1001_desc-preproc_T2w.nii.gz
sub-1001_desc-ribbon_mask.json
sub-1001_desc-ribbon_mask.nii.gz
sub-1001_dseg.nii.gz
sub-1001_from-fsnative_to-T1w_mode-image_xfm.txt
sub-1001_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
sub-1001_from-T1w_to-fsnative_mode-image_xfm.txt
sub-1001_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
sub-1001_hemi-L_desc-reg_sphere.surf.gii
sub-1001_hemi-L_midthickness.surf.gii
sub-1001_hemi-L_pial.surf.gii
sub-1001_hemi-L_space-fsLR_desc-msmsulc_sphere.surf.gii
sub-1001_hemi-L_space-fsLR_desc-reg_sphere.surf.gii
sub-1001_hemi-L_sphere.surf.gii
sub-1001_hemi-L_sulc.shape.gii
sub-1001_hemi-L_thickness.shape.gii
sub-1001_hemi-L_white.surf.gii
sub-1001_hemi-R_desc-reg_sphere.surf.gii
sub-1001_hemi-R_midthickness.surf.gii
sub-1001_hemi-R_pial.surf.gii
sub-1001_hemi-R_space-fsLR_desc-msmsulc_sphere.surf.gii
sub-1001_hemi-R_space-fsLR_desc-reg_sphere.surf.gii
sub-1001_hemi-R_sphere.surf.gii
sub-1001_hemi-R_sulc.shape.gii
sub-1001_hemi-R_thickness.shape.gii
sub-1001_hemi-R_white.surf.gii
sub-1001_label-CSF_probseg.nii.gz
sub-1001_label-GM_probseg.nii.gz
sub-1001_label-WM_probseg.nii.gz
sub-1001_space-MNI152NLin2009cAsym_desc-brain_mask.json
sub-1001_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_space-MNI152NLin2009cAsym_desc-preproc_T1w.json
sub-1001_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz
sub-1001_space-MNI152NLin2009cAsym_dseg.nii.gz
sub-1001_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz
sub-1001_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz
sub-1001_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz

And here’s ls func for that test participant:

sub-1001_task-emoreg_run-01_desc-confounds_timeseries.json
sub-1001_task-emoreg_run-01_desc-confounds_timeseries.tsv
sub-1001_task-emoreg_run-01_desc-coreg_boldref.json
sub-1001_task-emoreg_run-01_desc-coreg_boldref.nii.gz
sub-1001_task-emoreg_run-01_desc-hmc_boldref.json
sub-1001_task-emoreg_run-01_desc-hmc_boldref.nii.gz
sub-1001_task-emoreg_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-emoreg_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-emoreg_run-01_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-emoreg_run-01_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-emoreg_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-emoreg_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-emoreg_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-emoreg_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
sub-1001_task-emoreg_run-02_desc-confounds_timeseries.json
sub-1001_task-emoreg_run-02_desc-confounds_timeseries.tsv
sub-1001_task-emoreg_run-02_desc-coreg_boldref.json
sub-1001_task-emoreg_run-02_desc-coreg_boldref.nii.gz
sub-1001_task-emoreg_run-02_desc-hmc_boldref.json
sub-1001_task-emoreg_run-02_desc-hmc_boldref.nii.gz
sub-1001_task-emoreg_run-02_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-emoreg_run-02_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-emoreg_run-02_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-emoreg_run-02_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-emoreg_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-emoreg_run-02_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-emoreg_run-02_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-emoreg_run-02_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
sub-1001_task-emoreg_run-03_desc-confounds_timeseries.json
sub-1001_task-emoreg_run-03_desc-confounds_timeseries.tsv
sub-1001_task-emoreg_run-03_desc-coreg_boldref.json
sub-1001_task-emoreg_run-03_desc-coreg_boldref.nii.gz
sub-1001_task-emoreg_run-03_desc-hmc_boldref.json
sub-1001_task-emoreg_run-03_desc-hmc_boldref.nii.gz
sub-1001_task-emoreg_run-03_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-emoreg_run-03_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-emoreg_run-03_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-emoreg_run-03_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-emoreg_run-03_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-emoreg_run-03_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-emoreg_run-03_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-emoreg_run-03_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
sub-1001_task-emoreg_run-04_desc-confounds_timeseries.json
sub-1001_task-emoreg_run-04_desc-confounds_timeseries.tsv
sub-1001_task-emoreg_run-04_desc-coreg_boldref.json
sub-1001_task-emoreg_run-04_desc-coreg_boldref.nii.gz
sub-1001_task-emoreg_run-04_desc-hmc_boldref.json
sub-1001_task-emoreg_run-04_desc-hmc_boldref.nii.gz
sub-1001_task-emoreg_run-04_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-emoreg_run-04_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-emoreg_run-04_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-emoreg_run-04_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-emoreg_run-04_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-emoreg_run-04_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-emoreg_run-04_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-emoreg_run-04_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
sub-1001_task-emoreg_run-05_desc-confounds_timeseries.json
sub-1001_task-emoreg_run-05_desc-confounds_timeseries.tsv
sub-1001_task-emoreg_run-05_desc-coreg_boldref.json
sub-1001_task-emoreg_run-05_desc-coreg_boldref.nii.gz
sub-1001_task-emoreg_run-05_desc-hmc_boldref.json
sub-1001_task-emoreg_run-05_desc-hmc_boldref.nii.gz
sub-1001_task-emoreg_run-05_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-emoreg_run-05_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-emoreg_run-05_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-emoreg_run-05_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-emoreg_run-05_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-emoreg_run-05_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-emoreg_run-05_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-emoreg_run-05_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
sub-1001_task-rest_run-01_desc-confounds_timeseries.json
sub-1001_task-rest_run-01_desc-confounds_timeseries.tsv
sub-1001_task-rest_run-01_desc-coreg_boldref.json
sub-1001_task-rest_run-01_desc-coreg_boldref.nii.gz
sub-1001_task-rest_run-01_desc-hmc_boldref.json
sub-1001_task-rest_run-01_desc-hmc_boldref.nii.gz
sub-1001_task-rest_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.json
sub-1001_task-rest_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt
sub-1001_task-rest_run-01_from-orig_to-boldref_mode-image_desc-hmc_xfm.json
sub-1001_task-rest_run-01_from-orig_to-boldref_mode-image_desc-hmc_xfm.txt
sub-1001_task-rest_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz
sub-1001_task-rest_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
sub-1001_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.json
sub-1001_task-rest_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz

Hi @dgfitch and welcome to neurostars!

See below:

You need to use a FreeSurfer output space for these (fsnative, fsaverage, etc)

Are you sure those subjects had T2 images? Can you replicate this in most recent release (24.0.1 at this time)?

Best,
Steven

1 Like

Can confirm that there was T2w input, and that 24.0.1 does not pick that up. (The file in the input dir is just sub-NNN-T2w.nii.gz instead of T1w.nii.gz, hopefully that is normal.)

Is there documentation that explains what the --output-spaces does differently for fsnative vs. fsaverage? I’m a research engineer helping with pipelines, not really an imaging scientist…