External Email - Use Caution        

Hi all,


I believe I've gotten to the bottom of this, and the problem is incorrect documentation, both in the read/write_annotation.m files and in the wiki.


Taking the FreeSurfer C source as the de facto specification, we can refer to the colortab.c file. Here, the labels are not constructed or decoded using the transparency (255 - alpha) information at all, but are simply (R + G << 8 + B << 16).


For more complete discussion, see:


https://github.com/nipy/nibabel/issues/649#issuecomment-424755969


I think the most parsimonious resolution of this confusion is simply to update the documentation on the wiki page (I cannot; someone with permissions will need to), and to patch the MATLAB code to build its labels from RGB values alone. I will submit a patch to the GitHub branch.

Please let me know if I've gotten something wrong.

Best,
Chris Markiewicz


From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of paul mccarthy <pauldmccarthy@gmail.com>
Sent: Thursday, September 20, 2018 11:39:53 AM
To: freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] Clarification about .annot file format
 

        External Email - Use Caution        

Howdy,

There is a discussion regarding the .annot file format over at the nibabel github repository, regarding the interpretation of the flag/alpha value:


If one wishes to create an .annot file with colours that have a transparency value, how should it be stored in the file? By piecing together the information from the freesurfer code [1,2], and Graham Wideman's helpful notes [3], I came to the conclusion that alpha values should be stored as 1-the actual value. But it would be great to get some clarification on this from somebody who knows more than me

Thanks very much,

Paul McCarthy