I think it is related to this issue - https://github.com/freesurfer/freesurfer/issues/892

 

The bug has been fixed since FS 7.3.2. See this PR to fix your local recon-all - https://github.com/freesurfer/freesurfer/pull/886/changes

 

I think you can also workaround the bug by setting FREESURFER environment variable to FREESURFER_HOME before submitting recon-all.

 

 

From: Wales, Ryan <ryan.wales@mssm.edu>
Sent: Monday, March 2, 2026 5:16 PM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] Re: FREESURFER: undefined variable

 

        External Email - Use Caution        

For some reason, the error didn’t show up in the log. When I ran the command in my terminal, the very next line (after the end of the log) said “FREESURFER: undefined variable”.

 

From: Huang, Yujing <YHUANG43@mgh.harvard.edu>
Date: Monday, March 2, 2026 at 4:41
PM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] Re: FREESURFER: undefined variable

I don’t see the error in the recon-all.log.

 

From: Wales, Ryan <ryan.wales@mssm.edu>
Sent: Monday, March 2, 2026 2:13 PM
To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] Re: FREESURFER: undefined variable

 

        External Email - Use Caution        

Hi Yujing,

 

It is attached. Let me know if there’s any other data I can provide. Thanks!

 

Ryan

 

From: Huang, Yujing <YHUANG43@mgh.harvard.edu>
Date: Monday, March 2, 2026 at 12:12
PM
To: Freesurfer support list <
freesurfer@nmr.mgh.harvard.edu>
Subject: [Freesurfer] Re: FREESURFER: undefined variable

USE CAUTION: External Message.

It is not clear which command caused that error. Can you send your recon-all.log?

 

From: Wales, Ryan <ryan.wales@mssm.edu>
Sent: Sunday, March 1, 2026 7:26 PM
To: freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] FREESURFER: undefined variable

 

        External Email - Use Caution        

Hi,

 

I’m trying to run FreeSurfer (v. 7.2.0) longitudinally, first creating the base template for my sample subject across both timepoints, using:

recon-all -base sub_01-tp sub-01_ses-01_t1 -tp sub-01_ses-02_t1 -all

 

Both cross-sectional timepoints were previously run separately. Just after ‘mri_pretess’ finishes, I encounter the error:

“FREESURFER: Undefined variable”. 

 

I’m running FreeSurfer on my organization’s HPC, and I’ve ensured that SUBJECTS_DIR and FREESURFER_HOME are both set appropriately. 

 

I found another post with the same error, but they also had “nu_correct: Command not found”, unlike me. Both of us are using v. 7.2.0.

https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg76646.html

 

Can’t figure this one out. Thanks all!

 

Best,

Ryan Wales


Confidentiality Notice: This electronic mail transmission and any documents, files, or previous email messages attached to it may contain confidential information and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, or a person responsible for delivering such information to the intended recipient, you are hereby notified that any further review, disclosure, copying, dissemination, distribution, or use of any of the information contained in or attached to this email transmission is strictly prohibited. If you have received this message in error, please notify the sender immediately by email, discard any paper copies, and delete all electronic files of the message. Thank you for your cooperation.