Hi,
Thanks for sending the exact commands and errors.
Your call syntax looks fine; this is a small bug in recon-all-clinical.sh in 8.1.0 that causes the then: then/endif not found message, rather than an issue with your arguments.
It has been fixed in the dev branch by updating recon_all_clinical/recon-all-clinical.sh (see: https://github.com/freesurfer/freesurfer/blob/dev/recon_all_clinical/recon-a...)https://github.com/freesurfer/freesurfer/blob/dev/recon_all_clinical/recon-all-clinical.sh).%5B1
You can either:
* Install the current FreeSurfer dev build (recommended), or
* Patch 8.1.0 by replacing recon_all_clinical/recon-all-clinical.sh with the dev version.
After that, you should be able to run:
recon-all-clinical.sh /full/path/to/T1.nii.gz SUBJECT_ID 6 /full/path/to/SUBJECTS_DI
Best,
Karthik
On Jan 5, 2026, at 12:36 PM, Sudhakar, Tejaswi tejaswi.sudhakar@yale.edu wrote:
External Email - Use Caution
Hi FreeSurfer Team,
I am trying to run the clinical pipeline using the 8.1.0 version. I was able to successfully run the pipeline using the 7.4 version using the approach (recon-all-clinical.sh /path/to/T1 [subject id] [threads] /path/to/SUBJECTS_DIR, without providing the input, subject, threads and sdir flags) but am getting the following errors when running it on the newest release. I have set the subjects directory as an environmental variable on attempted terminal test runs.
recon-all-clinical.sh ~T1//T1.nii.gz 1 6 ${SUBJECTS_DIR} Unknown option: ~/T1/T1.nii.gz Use -h or --help for usage information.
recon-all-clinical.sh ~T1/T1.nii.gz 1 6 ${SUBJECTS_DIR} then: then/endif not found.
recon-all-clinical.sh -i ~/T1/T1.nii.gz -subjid 1 -threads 6 -sdir ~/fullcohort then: then/endif not found.
recon-all-clinical.sh -i ~/T1/T1.nii.gz -subjid 1 -threads 6
SUBJECTS_DIR variable is empty. Please provide a valid directory using the -sdir flag or set it as an environment variable.
Can you recommend any appropriate changes to my call to run the clinical pipeline? I can provide my full script if necessary.
_______________________________________________ Freesurfer mailing list -- freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu To unsubscribe send an email to freesurfer-leave@nmr.mgh.harvard.edumailto:freesurfer-leave@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman3/lists/freesurfer@nmr.mgh.harvard.e...