External Email - Use Caution        

Hi Everyone,

I ran some regionwise statistics based on aparc cortical thickness regions. I want to generate a new annot file that displays the statistical results back onto the aparc surface. So, the only thing that needs to change is the RGB values in the ctab file. I am not attempting to change any region boundaries, just the color. 


But even when I simply extract the labels and ctab and make NO edits, when I load the resulting annot file into Freeview, it misplaces the labels by one (the lateral occipital in the original becomes lateral orbitofrontal in the new version, the middle temporal is labelled as the parahippocampal etc).  The first item in the colortable is indexed at 0 and is labelled unknown.

I have copied my code below, I have not hand edited these outputs in any way, they come directly out of the original annot file. These all run without throwing an error, the issue is only apparent when I load the annot file in freesurfer and check the labels with the cursor.

Annotation2Label: 

mri_annotation2label --subject sub-F03019_ses-30D_T1W --hemi lh --ctab ThirdErrorTest --outdir ThirdErrorTest

R Code to generate the colour table: 

library('freesurferformats')
testannot = read.fs.annot('/Volumes/SHRedMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap/sub-F03019_ses-30D_T1W/label/lh.aparc.annot')
testcolortable = colortable.from.annot(testannot)
head(testcolortable)
print(testcolortable)
write.table(testcolortable, file='/Volumes/SHRedMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap/ErrorTest.txt', sep=" ", row.names = FALSE)
write.fs.colortable('/Volumes/SHredMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap/SecondErrorTest.txt',testcolortable)

Label 2 Annot: 

--s sub-F03019_ses-30D_T1W --h lh --ctab /Volumes/SHRedMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap/SecondErrorTest.txt --ldir /Volumes/SHRedMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap/aparc-labels-left --annot ctab.test2  --sd /Volumes/SHRedMRI/01-CodeFiles/FinishedCode/FreeViewImageGeneration/SignificanceMap

I have attached the version of the ctab file generated in R. 

Thanks

Rachel

Rachel J. Sharkey, Ph.D. (she/her)
Research Associate, Sport Injury Prevention Research Centre 
Faculty of Kinesiology, University of Calgary

I would like to acknowledge that I reside within the traditional territories of the peoples of Treaty 7, which includes the Blackfoot Confederacy, comprising the Siksika, Piikani, and Kainai First Nations, the Tsuut’ina First Nation, the Stoney Nakoda First Nations, including the Chiniki, Bearspaw, and Wesley First Nations.  The City of Calgary is also home to Métis Nation of Alberta, Region III.