You can follow the examples described here
https://github.com/ThomasYeoLab/CBIG/tree/master/stable_projects/brain_parce...
From: Huang, Yujing YHUANG43@mgh.harvard.edu Sent: Thursday, March 12, 2026 4:07 PM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Re: use of a custom annot for mri_segstats
I think you will need to map the atlas to the individual subject space.
For example, mri_surf2surf --srcsubject fsaverage --trgsubject <subject_id> --hemi <lh/rh> --sval-annot $SUBJECTS_DIR/fsaverage/label/lh.Schaefer2018_400Parcels_17Networks_order.annot --tval $SUBJECTS_DIR/<subject_id>/label/lh.Schaefer2018_400Parcels_17Networks_order.annot
From: Simone Cauzzo <cauzzo.simone@gmail.commailto:cauzzo.simone@gmail.com> Sent: Wednesday, March 11, 2026 11:08 AM To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] use of a custom annot for mri_segstats
External Email - Use Caution Hi all I am running Freesurfer 7.4 I am trying to extract QSM values at different cortical depths, and obtain statistics for the 400 Schaefer regions.
my code is
mri_vol2surf --mov [QSM coregistered to orig_nu.mgz ] \ --regheader $sub \ --hemi lh \ --surf white \ --o outputsurf.mgh \ --projfrac 0.2
mri_segstats --annot subjid lh 400Parcels_Yeo2011_17Networks \ --i outputsurf.mgh \ --sum outputstats.stats
I get the following errors
Reading annotation $SUBJECTS_DIR/$sub/label/lh.400Parcels_Yeo2011_17Networks.annot error: No such file or directory error: # elements (137017) in $SUBJECTS_DIR/$sub/label/lh.400Parcels_Yeo2011_17Networks.annot and # vertices (137601) don't match ... trying local annot error: No such file or directory error: # elements (137017) in $SUBJECTS_DIR/$sub/label/lh.400Parcels_Yeo2011_17Networks.annot and # vertices (137601) don't match
The annot file is there, I checked, and that's verified by the fact that apparently it knows how many vertices are there. Moreover, it totally worked when I tried this command to extract anatomical stats from the same parcel
mris_anatomical_stats -a $SUBJECTS_DIR/$sub/label/lh.400Parcels_Yeo2011_17Networks.annot -f $SUBJECTS_DIR/$sub/stats/$hemi.$parc.stats $sub $hemi
Do you have any idea of what is going on? The volume [QSM coregistered to orig_nu.mgz ] was created by applying the QSM 2 T1 rigid transform with ants antsApplyTransform, with orig_nu.mgz as reference volume, which provided a new QSM volume that looks aligned to orig_nu.mgz and on the same grid. It is not a problem of this file since I tried producing an mgh file with orig_nu.mgz as --mov volume and the error persists.
Thank you for your help
Simone Cauzzo