Summary of what happened:
I have a single multi-echo FLASH/GRE acquisition: one flip angle (21°), TR 25 ms, 8 echoes (TE 2.3–18.4 ms), magnitude and phase.
When fMRIPrep handles it directly it appears to average the echoes (using mri_robust_template), and the resulting segmentation, surface reconstruction and coregistration are poor. I had posted my initial coregistration issues here: fMRIPrep coregistration issues with functional slab - Software Support - Neurostars
To get around this I ran FreeSurfer 7.4.1 recon-all-clinical separately and passed the output to fMRIPrep with --fs-subjects-dir and --fs-no-resume.
recon-all-clinical itself ran fine, and fMRIPrep produced a desc-recon-all_T1w.svg that looks good. But the run then stops making progress: no normalised outputs, no fmap directory, and the job never exits (did not use --stop-on-first-crash flag).
The reason seems to be that recon-all-clinical does not write mri/T1.mgz. Its output contains native.mgz, norm.mgz, brain.mgz, brainmask.mgz, synthSR*.mgz, synthseg.mgz and synthsurf.mgz, but no T1.mgz or orig.mgz. The fsnative2t1w_xfm node in surface_recon_wf takes T1.mgz as its source volume, so source_file is undefined and the node fails its mandatory-input check.
Is recon-all-clinical output supported as --fs-subjects-dir input? If so, what should be supplied in place of T1.mgz ? Is copying norm.mgz to T1.mgz sound, or is there a proper route (e.g. supplying a precomputed from-fsnative_to-T1w transform via -d anat=...)?
And is there a better way to handle a multi-echo anatomical in fMRIPrep that would avoid this altogether?
Command used (and if a helper script was used, a link to the helper script or the command generated):
#!/bin/bash -l
set -euo pipefail
module load apptainer
BIDS_DIR="/myriadfs/projects/x/BIMODAL-fMRI-echo1"
CONTAINER="/myriadfs/projects/x/fmriprep_25.2.4.sif"
FS_LICENSE="/myriadfs/projects/x/license.txt"
# recon-all-clinical output; parent dir containing sub-<label>/
FS_SUBJECTS_DIR="$BIDS_DIR/derivatives/freesurfer-clinical_7.4.1_echo-1"
OUT_DIR="$BIDS_DIR/derivatives/fmriprep-25.2.4_echo-1_FS-clinical"
WORK_ROOT="/myriadfs/projects/x/work_fmriprep_echo-1-clinical"
LOG_DIR="/myriadfs/projects/x/logs_echo-1_FS-clinical"
mkdir -p "$OUT_DIR" "$WORK_ROOT" "$LOG_DIR"
qsub <<EOF
#!/bin/bash -l
#$ -cwd
#$ -l h_rt=24:00:00
#$ -pe smp 8
#$ -l mem=8G
#$ -N sub-31
#$ -o $LOG_DIR
#$ -e $LOG_DIR
set -euo pipefail
module load apptainer
WORK_DIR="$WORK_ROOT/work_sub-31_\${JOB_ID:-nojid}_\$(date +%Y%m%d-%H%M%S)"
mkdir -p "\$WORK_DIR"
apptainer run --cleanenv \\
--bind "$BIDS_DIR:/data:ro" \\
--bind "$OUT_DIR:/out" \\
--bind "$FS_SUBJECTS_DIR:/fsdir" \\
--bind "\$WORK_DIR:/work" \\
--bind "$FS_LICENSE:/opt/freesurfer/license.txt:ro" \\
"$CONTAINER" /data /out participant \\
--participant-label 31 \\
--fs-subjects-dir /fsdir \\
--fs-no-resume \\
--fs-license-file /opt/freesurfer/license.txt \\
--nthreads 8 --omp-nthreads 2 --mem_mb 64000 \\
--output-spaces T1w MNI152NLin2009cAsym:res-native MNI152NLin2009cAsym:res-2 \\
--random-seed 1 \\
--dummy-scans 4 \\
--work-dir /work
EOF
Version:
fMRIPrep 25.2.4
FreeSurfer 7.4.1 (recon-all-clinical)
Environment (Docker, Singularity / Apptainer, custom installation):
Apptainer, fmriprep_25.2.4.sif, on an SGE cluster (8 slots, 64 GB, 24 h wall limit)
Data formatted according to a validatable standard? Please provide the output of the validator:
bids-validator@1.14.10
1: [WARN] The recommended file /README is missing. See Section 03
(Modality agnostic files) of the BIDS specification.
(code: 101 - README_FILE_MISSING)
Summary: Available Tasks: Available Modalities:
523 Files, 3.77GB lci MRI
20 - Subjects wof
1 - Session
Relevant log outputs (up to 20 lines):
ValueError: PatchedRobustRegister requires a value for input 'source_file'.
For a list of required inputs, see PatchedRobustRegister.help()
From the node’s _report/report.rst:
Hierarchy : fmriprep_25_2_wf.sub_31_wf.anat_fit_wf.surface_recon_wf.fsnative2t1w_xfm
* source_file : <undefined>
* target_file : /work/.../sub-31_echo-1_part-mag_T1w_noise_corrected_ras_valid.nii.gz
* auto_sens : True
* est_int_scale : True
Screenshots / relevant information:
fMRIPrep does pick up the precomputed directory, the workflow header reports:
* Pre-run FreeSurfer's SUBJECTS_DIR: /fsdir.
Contents of sub-31/mri/ in the recon-all-clinical output:
aparc.a2009s+aseg.mgz aparc.DKTatlas+aseg.mgz aseg.mgz brainmask.mgz
filled.mgz native.mgz rh.ribbon.mgz synthseg.mgz
synthSR.norm.mgz synthsurf.mgz wm.mgz wm.seg.mgz
aparc+aseg.mgz aseg.auto_noCCseg.mgz aseg.presurf.mgz brain.mgz
lh.ribbon.mgz norm.mgz ribbon.mgz synthSR.mgz
synthSR.raw.mgz transforms wmparc.mgz
fMRIPrep also wrote rh.midthickness into sub-31/surf/ and copied fsaverage into the subject’s dir during the run, so it read and used the recon-all-clinical surfaces before failing on the missing volume.
Screenshot of good surface reconstruction desc-reconall_T1w.svg :
