External Email - Use Caution
Hello FreeSurfer developers,
I would like to report a possible bug in recon-all / expert options
handling in FreeSurfer 8.1.0.
Environment
- FreeSurfer version:
freesurfer-linux-ubuntu22_x86_64-8.1.0-20250719-f30dfed
- OS: Ubuntu 22.04, Linux 6.8.0-107-generic x86_64
What I am trying to do
I am running recon-all on a hi-res dataset and want to increase the number
of inflation iterations using an expert options file.
expert.opts content
mris_inflate -n 100
Command
export SUBJECTS_DIR=/mnt/data4/test
recon-all
-all
-subjid sub-01
-i /mnt/data4/Subjects/T1_MPR.nii
-T2 /mnt/data4/Subjects/T2_SPC.nii
-T2pial
-hires
-expert /home/kami/expert.opts
-xopts-overwrite
-openmp 8
Observed behavior
The subject-specific scripts/expert-options file is created correctly and
contains:
mris_inflate -n 100
However, when recon-all reaches Inflation1, the executed command in
recon-all.log becomes:
mris_inflate -no-save-sulc 100 ../surf/lh.smoothwm.nofix
../surf/lh.inflated.nofix
So the "-n" appears to be dropped, and "100" is interpreted as an input
surface filename. The run then fails with:
Reading 100
** failed to open GIFTI XML file '100.gii'
mrisReadGIFTIdanum: ERROR reading gifti 100.gii
[INFO] read, cannot find 100, trying 100.gii ...
error: No such file or directory
error: mris_inflate: could not read surface file 100
Relevant log excerpt
#@# Inflation1 lh Fri Apr 10 07:16:38 PM JST 2026
/mnt/data4/test/sub-01/scripts
mris_inflate -no-save-sulc 100 ../surf/lh.smoothwm.nofix
../surf/lh.inflated.nofix
Not saving sulc
Reading 100
** failed to open GIFTI XML file '100.gii'
mrisReadGIFTIdanum: ERROR reading gifti 100.gii
[INFO] read, cannot find 100, trying 100.gii ...
error: No such file or directory
error: mris_inflate: could not read surface file 100
What I expected
I expected recon-all to execute:
mris_inflate -no-save-sulc -n 100 ../surf/lh.smoothwm.nofix
../surf/lh.inflated.nofix
Additional notes
- The expert options file itself is plain text with normal LF line
ending.
- cat -A /home/kami/expert.opts shows:
mris_inflate -n 100$
- od -c /home/kami/expert.opts shows:
0000000 m r i s _ i n f l a t e - n
0000020 1 0 0 \n
- mris_inflate itself appears to work normally when run directly.
- I also tried -xopts-overwrite, but the same issue occurs.
This looks like a recon-all expert-options parsing / argument-passing
problem, where the "-n" option is lost before invoking mris_inflate.
Please let me know if you would like the full recon-all.log and
recon-all.cmd attached. I can also provide a minimal reproducible example.
Best regards,Toshiharu
----------------------------------------------------------------------------------------------------
Toshiharu Kamishikiryo M.D.,Ph.D.
Department of Psychiatry and Neurosciences.
Graduate School of Biomedical & Health Sciences, Hiroshima University.
-----------------------------------------------------------------------------------------------------