External Email - Use Caution
Not a developer, but this is something that comes up frequently in most analysis situations.
For qsub, you should be able to just make separate scripts for each subject and submit them all at once and let the scheduler node handle the rest.
E.g. If you have sub1.sh, sub2.sh,....subn.sh as the submission scripts you can just submit them all:
for j in sub*.sh; do qsub ${j} done
You may consider writing a wrapper that will create all the subscripts based on an input...e.g.:
SUBNAME=$1
Echo "#!/bin/bash #$ -cwd #$ -o /data/holly-host/UserName/logs/ #$ -j y #$ -S /bin/bash #$ -N reconall
export FREESURFER_HOME=/usr/local/freesurfer/8.2.0-1 export FS_LICENSE=/usr/local/freesurfer/8.2.0-1/license.txt export SUBJECTS_DIR=/data/holly-host/hliu/freesurfer_subjects
source $FREESURFER_HOME/SetUpFreeSurfer.sh
mkdir -p $SUBJECTS_DIR
env | grep -E "FREESURFER|FS_LICENSE|SUBJECTS_DIR"
recon-all -all -i /data/holly-host/UserName/anat/${SUBNAME}_t1w.nii -s sub-01 SegmentAAN.sh sub-01
" > ${SUBNAME}.sh
________________________________ From: freesurfer-request@nmr.mgh.harvard.edu freesurfer-request@nmr.mgh.harvard.edu Sent: Tuesday, June 9, 2026 9:36 AM To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [EXTERNAL] Freesurfer Digest, Vol 268, Issue 8
Caution: This message came from an external sender outside your organization.
Send Freesurfer mailing list submissions to freesurfer@nmr.mgh.harvard.edu
To subscribe or unsubscribe via email, send a message with subject or body 'help' to freesurfer-request@nmr.mgh.harvard.edu
You can reach the person managing the list at freesurfer-owner@nmr.mgh.harvard.edu
When replying, please edit your Subject line so it is more specific than "Re: Contents of Freesurfer digest..."
Today's Topics:
1. Re: Recon-all for multiple subjects on parallel (Huaiyu Liu)
----------------------------------------------------------------------
Message: 1 Date: Tue, 9 Jun 2026 14:35:49 +0000 From: Huaiyu Liu huaiyu.liu@ucl.ac.uk Subject: [Freesurfer] Re: Recon-all for multiple subjects on parallel To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Message-ID: <DB8PR01MB5899E8997D209D3F51B01799DB1D2@DB8PR01MB5899.eurp rd01.prod.exchangelabs.com> Content-Type: multipart/alternative; boundary="_000_DB8PR01MB5899E8 997D209D3F51B01799DB1D2DB8PR01MB5899eurp_"
External Email - Use Caution
Dear FS Developers,
I recently asked a question about how to run recon-all in parallel for multiple subjects (like 4-8). Could someone give me some clues, I would be really apperciate.
Best, Huaiyu ________________________________ From: Huaiyu Liu huaiyu.liu@ucl.ac.uk Sent: Thursday, May 28, 2026 18:21 To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Recon-all for multiple subjects on parallel
Dear FreeSurfer Developers,
I am using the following code on my department's HPC to (1) reconstruct a single participant’s T1w image and (2) perform brainstem segmentation. The code works well, but I have 40 participants in total. Hence, I wonder how I can run recon-all and brainstem segmentation for multiple subjects in parallel. Could you tell me the code?
1) FreeSurfer version: --freesurfer-linux 8.2.0-1 on my department's HPC (high-performance cluster)
2) My shell script for recon-all and brainstem segmentation for single subject: #!/bin/bash #$ -cwd #$ -o /data/holly-host/UserName/logs/ #$ -j y #$ -S /bin/bash #$ -N reconall
export FREESURFER_HOME=/usr/local/freesurfer/8.2.0-1 export FS_LICENSE=/usr/local/freesurfer/8.2.0-1/license.txt export SUBJECTS_DIR=/data/holly-host/hliu/freesurfer_subjects
source $FREESURFER_HOME/SetUpFreeSurfer.sh
mkdir -p $SUBJECTS_DIR
env | grep -E "FREESURFER|FS_LICENSE|SUBJECTS_DIR"
recon-all -all -i /data/holly-host/UserName/anat/sub-01_t1w.nii -s sub-01 SegmentAAN.sh sub-01
3) My command for submit the jobs to the cluster with 32 GB of RAM request
qsub -l vf=32G -l h_vmem=32G reconall
Thank you very much for your time and consideration, I look forward to hearing from you.
Best, Huaiyu _________________________________________ Huaiyu Liu (Ted) Postdoctoral Research Fellow Department of Imaging Neuroscience, Functional Imaging Laboratory University College London 12 Queen Square, London WC1N 3AR
freesurfer@nmr.mgh.harvard.edu