Giter VIP home page Giter VIP logo

Comments (5)

neurolabusc avatar neurolabusc commented on June 16, 2024

You can create new color lookup tables with a text editor. The format is very simple. You describe the number of nodes, each node has an intensity associated with it (the color index horizontal position). Finally, each node has a red/green/blue/alpha value associated with it. Intensity and RGBA are values in the range 0..255. To make the colormap cyclic, just make the final node have the same color (red, green and blue values) as the first node. Save the text file with the extension ".clut" and place the file in MRIcroGL's /Resources/lut folder (for MacOS, select the MRIcroGL application and Show Package Contents to see these folders). When you re-launch MRIcroGL it will include the new color table. Here is an example for the HSV color table:

[FLT]
min=0
max=0
[INT]
numnodes=7
[BYT]
nodeintensity0=0
nodeintensity1=43
nodeintensity2=85
nodeintensity3=128
nodeintensity4=170
nodeintensity5=213
nodeintensity6=255
[RGBA255]
nodergba0=255|0|0|0
nodergba1=255|255|0|14
nodergba2=0|255|0|28
nodergba3=0|255|255|43
nodergba4=0|0|255|57
nodergba5=255|0|255|71
nodergba6=255|0|0|85

When designing color maps, please be mindful of how people with color blindness will perceive your colors. Criticisms of the classic Matlab color maps and modern alternatives (such as the Viridis and Plasma schemes provided with MRIcroGL) are here, here and here. @CPernet provides tools for controlling luminance in color maps.

hsv2

from mricrogl10_old.

seralouk avatar seralouk commented on June 16, 2024

Amazing answer thank you a lot! i have now created my colormap successfully and MRIcroGL is able to recognize it. One last thing.

from mricrogl10_old.

mahirtazwar avatar mahirtazwar commented on June 16, 2024

What would be the color table if I want to generate random colormap (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).

from mricrogl10_old.

neurolabusc avatar neurolabusc commented on June 16, 2024

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.

from mricrogl10_old.

neurolabusc avatar neurolabusc commented on June 16, 2024

You can always create your own random color schemes, just specify a lot of nodes for your color scheme each with a distinct color. For more details on color schemes, see the NiiVue documentation which links to a live demo that allows you to experiment with color schemes.

from mricrogl10_old.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.