rordenlab / MRIcroGL

v1.2 GLSL volume rendering. Able to view NIfTI, DICOM, MGH, MHD, NRRD, AFNI format images.

Home Page:https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating random color look up table

mahirtazwar opened this issue · comments

How to create a random color look up table so that each label in a segmentation image gets a random color instead of a gradient (similar to the random colormap in fsleyes, or how segmentations are loaded on ITK-SNAP)? In this case, each region of interest with a unique label will have a unique or repeated color (since I have more than 200+ ROIs).

Reference to: Originally posted by @mahirtazwar in neurolabusc/MRIcroGL10_OLD#35 (comment)

Set the intent_code of your NIfTI header to 1002 to specify NIFTI_INTENT_LABEL. This will use the same random color scheme as FSLeyes and use nearest neighbor interpolation (to solve the partial volume issue that a voxel that is a mixture of area 17 and area 19 should not be identified as area 18).

To see examples, choose any of the images listed under the File/AddAtlas menu item.