Tutorial 18: Colormaps

Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet, Rana El Khoury Maroun

When displaying signals on the sensor array or on the cortex surface, we need to convert the amplitude of the signals into colors. The way the values are mapped to colors has a lot of influence on the visual interpretation of the figures. The selection of the appropriate colormap is an important step of the data exploration.

Colormap menus

Brainstorm keeps track of many user-defined colormaps: anatomy, EEG, MEG, sources, stat, time, time-frequency, etc. You can go to the Colormaps menu in the main window to see this list.

Usually, you will use only popup menus from specific figures to edit the colormaps.

Standard color arrays

A colormap is an array of colors that are indexed and then mapped to values. It is represented by a [Nx3] matrix, where N is the number of colors available in it. Each color is coded with three values corresponding its relative levels of red, green and blue. In Matlab, the colors are coded between 0 and 1. To get an example, type "jet" in the Matlab command window, you will get the default values for the "jet" colormap.

We offer two ways of creating this array of colors in Brainstorm: you can use standard color arrays (modulated in contrast and brightness) or define your own.

Colormap name: The standard colormaps are referred to with names (bone, gray, jet, rwb, etc).
Pick a different color set in the menu to update all the figures with similar data types.

Brightness: Moves the center of the color array up and down. Example values: -80, 0, +80.
The term "brightness" is not well adapted for rbw, jet or hsv. It makes more sense for colormaps with only one tint that varies in intensity, such as the gray colormap. We use it here for lack for a better word.

Contrast: Changes the distance between the first and last colors. Example values: -80,0,+80.

You can modify these values by clicking directly on the color bar. Hold the mouse button, then:

Advanced

Custom color arrays

To edit your own list of colors, use the menu "New..." at the end of the list of standard colormaps.

Color mapping

After defining the colors, we need to define how we want to map them with the values. The information necessary to do this color mapping is the value corresponding to the first and last colors. The color indices will be scaled linearly between these extrema.

Absolute values: Display the absolute values of the recordings, instead of the original values. This has the effect of constraining the color mapping to positive values only. It is not very useful for exploring the recordings: in EEG and MEG, the sign of the values is very important.

Maximum: Method used to estimate the minimum and maximum values of the colorbar.

Range: Use symmetrical or non-symmetrical colormaps.

Advanced

Colormap management

Remember that when you change any of the options above, it is saved in your user preferences. If you close Brainstorm and start it again, the colormap configuration stays the same.

To reset the colormap to its default values:

Two additional menus can help you manipulate the colormaps:

Advanced

New default colormaps

Recently, the default colormaps of Brainstorm were changed because they lack important attributes of a good colormap: they don’t have linear lightness and they are not perceptually uniform. This can either cause details in the visualization to be hidden or create features that don’t exist in the underlying data, which results in a distortion of the perceived pattern. For that reason, new default colormaps were added to better represent the underlying data.

Here are the new colormaps created with their chosen names:

new_cmap_names.png

Three other colormaps were added: viridis and magma (taken from mpl colormaps) as well as a variation of viridis (viridis2). The colormaps were created using the viscm tool, which allows designing a colormap that has linear lightness and hue changes.

This paper presents the work done in more detail: colormap_optimization.pdf

JET Alternative

A new colormap created by Google, the Turbo colormap, was recently added. It is presented as a an improved rainbow colormap that can be used as an alternative to the popular JET colormap, resulting in a perceptually linear colormap.

turbo_vs_jet.png

More information can be found on the following Google Blog post: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html








Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/Colormaps (last edited 2020-01-15 18:11:00 by ?JuanGarciaPrieto)