Mri_surf2surf No such file error (but file exists)


I am trying to run the mri_surf2surf command as shown in this BATMAN MRtrix tutorial on page 35 (OSF | BATMAN_tutorial_update2020.pdf) in order to map the annotation files of the HCP MMP 1.0 atlas. I keep running into a “No such file or directory” error when the code tries to read the “lh.orig” file, but the file is clearly in the required directory. Below is the output of my code:

(base) salmasalhi@SalmasMacbookAir 100307_F26-30 % mri_surf2surf --srcsubject fsaverage --trgsubject subject_100307 --hemi lh --sval-annot $SUBJECTS_DIR/fsaverage/label/lh.glasser.annot --tval $SUBJECTS_DIR/subject_100307/label/lh.hcpmmp1.annot 
Setting mapmethod to nnf
setenv SUBJECTS_DIR /Users/salmasalhi/my_code/HumanBrain_v2/reconall
cd /Users/salmasalhi/my_code/HumanBrain_v2/100307_F26-30
mri_surf2surf --srcsubject fsaverage --trgsubject subject_100307 --hemi lh --sval-annot /Users/salmasalhi/my_code/HumanBrain_v2/reconall/fsaverage/label/lh.glasser.annot --tval /Users/salmasalhi/my_code/HumanBrain_v2/reconall/subject_100307/label/lh.hcpmmp1.annot 
sysname  Darwin
hostname SalmasMacbookAir.local
machine  x86_64
user     salmasalhi
srcsubject = fsaverage
srcval     = (null)
srctype    = 
trgsubject = subject_100307
trgval     = /Users/salmasalhi/my_code/HumanBrain_v2/reconall/subject_100307/label/lh.hcpmmp1.annot
trgtype    = 
srcsurfreg = sphere.reg
trgsurfreg = sphere.reg
srchemi    = lh
trghemi    = lh
frame      = 0
fwhm-in    = 0
fwhm-out   = 0
label-src  = (null)
label-trg  = (null)
OKToRevFaceOrder  = 1
UseDualHemi = 0
Reading source surface reg /Users/salmasalhi/my_code/HumanBrain_v2/reconall/fsaverage/surf/lh.sphere.reg
Loading source data
Reading surface file /Users/salmasalhi/my_code/HumanBrain_v2/reconall/fsaverage/surf/lh.orig
error: No such file or directory
error: could not read annot file /Users/salmasalhi/my_code/HumanBrain_v2/reconall/fsaverage/label/lh.glasser.annot

However, when I check the surf directory, the lh.orig file is in fact inside that folder. I tried to check the format of the file by typing mri_info lh.orig but the output was ERROR: could not determine type of lh.orig.

Apologies if this is off topic; I know this is more of a FreeSurfer issue, but I haven’t yet heard back from the FreeSurfer forum so I was hoping someone here might be able to help.

Thank you very much,


Hi :
I’m not sure what’s the problem you met. But if you want to access the header information of the surface file (lh.white, lh.pial, lh.orig). You can try the command mris_info instead of the mri_info. And if you want to get the value of each vertex, your can try using the command mris_convert lh.orig lh.orig.asc, This would convert a surface file to a 4-column text file. I hope this would help you.

Hi Ray,

Thank you for your response and apologies for not being clear. My issue is that the mri_surf2surf command is not able to read the lh.orig file and so is not able to run properly. I am getting a No such file exists error despite the file being in the correct directory.

The reason I tried using mri_info is to see whether the file was corrupt, or at least to see what kind of file it is. It doesn’t look like the file is corrupt though, so I’m not sure why mri_surf2surf cannot recognize that it exists. I am sure the file is in the directory from which the command is trying to read.

Thank you,