External Email - Use Caution
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
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
Each subject needs to be processed separately. You can loop through your subjects, and submit recon-all for each one.
From: Huaiyu Liu huaiyu.liu@ucl.ac.uk Sent: Tuesday, June 9, 2026 10:36 AM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Re: Recon-all for multiple subjects on parallel
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.ukmailto:huaiyu.liu@ucl.ac.uk> Sent: Thursday, May 28, 2026 18:21 To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto: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