Extract cortical thickness stats from a new atlas

Hi,

I’ve run recon-all on all my subjects and I would like to extract the cortical thickness stats for all my subjects from a HCP atlas (that comes in the .annot files):

Im quite lost in all the tutorials and e-mail threads explaining different steps of this process but it seems to me it should be fairly easy :slight_smile:

I would appreciate help a lot!

Best wishes,
Agata

1 Like

Hi @agatawolna,

## Step 1: Let's define some important imformation that will be used later
# SUBJECTS_DIR should be defined as a freesurfer environment variable
sub="sub-XXX" # Must match name of subject in FS subjects dir
hemis=('lh' 'rh') # Loop over both hemispheres
annot_dir="/path/to/folder/containing/annot_file" # Where annotation files live
parc="HCP-MMP1" # Name of parcellation
annot_suffix="$parc.annot" # What goes after hemi.? in the file name of the annotation

## Step 2: Get annotation from `fsaverage` to subject space (repeat for each subject and hemisphere)

for hemi in ${hemis[@]}; do
annot_file="${annot_dir}/$hemi.${annot_suffix}" # Get annotation file for that hemisphere
mri_surf2surf --srcsubject fsaverage --trgsubject $sub --hemi $hemi --sval-annot ${annot_file} --tval ${annot_suffix}

## Step 3 extract anatomical stats
mris_anatomical_stats -a $SUBJECTS_DIR/$sub/label/${hemi}.${annot_suffix} -f $SUBJECTS_DIR/$sub/stats/$hemi.$parc.stats $sub $hemi

done

Please let me know if you have questions.

Best,
Steven

2 Likes

Hi Steven,

Thanks for the code, it worked great, did exactly what I needed :slight_smile:

Best,
Agata

1 Like

Hi Steven!

Your code is very helpful! Thank you for that.
I have a follow up question, maybe you will be able to help me as well.
Based on the same atlas, I would like to extract % signal change in a specific contrast from several labels. Should I use the “mri_segstats”? I have my functional data analyzed in fsfast. I think, again, this should be fairly easy, but I can’t figure out a way to do it from the documentation.

Best,
Maria