I have ran freesurfer for multiple subjects. I have had to resample the T1 scan as the dimension was not 1x1x1 however this has meant that freesurfer runs with segmentation fault area during the parcellation step and doesnt generate the surface output. It still generate 4 surface files but not all of them.
Script used:
# Define directories
SCRATCH=/exports/eddie/scratch/shendry2
INPUT_DIR=$SCRATCH/cross
# Set up FreeSurfer
export FREESURFER_HOME=$SCRATCH/freesurfer
. $FREESURFER_HOME/SetUpFreeSurfer.sh
export SUBJECTS_DIR=$SCRATCH/cross_out
# Set up FSL
export FSLDIR=$SCRATCH/fsl
. $FSLDIR/etc/fslconf/fsl.sh
export PATH=$FSLDIR/bin:${PATH}
# Find input files
T1=$(ls $INPUT_DIR/$1 | grep 3dT1)
T2=$(ls $INPUT_DIR/$1 | grep T2)
ICV=$(ls $INPUT_DIR/$1 | grep ICV)
# Run FreeSurfer only up to brain mask
recon-all -s $1 -i $INPUT_DIR/$1/$T1 -autorecon1 -noskullstrip
# Create brain mask from T1 & ICV
cd $INPUT_DIR/$1
fslmaths $T1 -mas $ICV brainmask.nii && gunzip brainmask.nii.gz
mri_convert brainmask.nii $SUBJECTS_DIR/$1/mri/brainmask.mgz && rm brainmask.nii
# Complete FreeSurfer using ICV mask
recon-all -s $1 -T2 $INPUT_DIR/$1/$T2 -T2pial -autorecon2 -autorecon3
# Create QC file
cd $SUBJECTS_DIR && mkdir -p QA
tar -cf $1.tar $1/mri/T1.mgz $1/surf/*h.pial $1/surf/*h.white
gzip $1.tar && mv $1.tar.gz QA
Version: Freesurfer version 6.0.0
Environment (Docker, Singularity / Apptainer, custom installation):
running this on eddie super computer at university of edinburgh on windows 11 using mobaXterm
this is the error output:
#-----------------------------------------
#@# Parcellation Stats lh Thu May 1 20:56:13 BST 2025
/exports/eddie/scratch/shendry2/rerun_w0_cross_mixed_protocol_out/FMS_0100/scripts
mris_anatomical_stats -th3 -mgz -cortex ../label/lh.cortex.label -f ../stats/lh.aparc.stats -b -a ../label/lh.aparc.annot -c ../label/aparc.annot.ctab FMS_0100 lh white
computing statistics for each annotation in ../label/lh.aparc.annot.
reading volume /exports/eddie/scratch/shendry2/rerun_w0_cross_mixed_protocol_out/FMS_0100/mri/wm.mgz...
reading input surface /exports/eddie/scratch/shendry2/rerun_w0_cross_mixed_protocol_out/FMS_0100/surf/lh.white...
reading input pial surface /exports/eddie/scratch/shendry2/rerun_w0_cross_mixed_protocol_out/FMS_0100/surf/lh.pial...
reading input white surface /exports/eddie/scratch/shendry2/rerun_w0_cross_mixed_protocol_out/FMS_0100/surf/lh.white...
INFO: using TH3 volume calc
INFO: assuming MGZ format for volumes.
INFO: using ../label/lh.cortex.label as mask to calc cortex NumVert, SurfArea and MeanThickness.
Using TH3 vertex volume calc
Total face volume 196226
Total vertex volume 193434 (mask=0)
reading colortable from annotation file...
colortable with 36 entries read (originally /autofs/space/tanha_002/users/greve/fsdev.build/average/colortable_desikan_killiany.txt)
Segmentation fault (core dumped)
Linux node1c08.ecdf.ed.ac.uk 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 28 17:34:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
recon-all -s FMS_0100 exited with ERRORS at Thu May 1 20:56:33 BST 2025
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Any help would be greatly apprecaited!