6054
Comment:
|
8831
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
When displaying signals on the sensor array or on the cortex surface, we need to convert the amplitude of the signal into a color. The way the values are mapped to colors has a lot of influence over the visual interpretation of the figures. The selection of the appropriate colormap is an important step of the data exploration. | 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. |
Line 11: | Line 11: |
. {{attachment:colormap_all.gif||height="330",width="364"}} | . {{attachment:colormap_all.gif||height="330",width="353"}} |
Line 20: | Line 20: |
== Set the color array == Descript the color arrays |
== 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. |
Line 23: | Line 23: |
* '''Colormap''': You can change the colors that are used to represent the recorded MEG values. You can create your own colormaps with the Matlab colormap editor, clicking on the last option ''Custom''. | 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. |
Line 25: | Line 25: |
* '''Contrast and Brightness''': * Brightness moves the center of the colormap up and down. * Contrast saturate/desaturate the colors. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=colormapContrast.gif|colormapContrast.gif|class="attachment"}} ''Fig.1: High brightness; Fig.2: High contrast'' * The words brightness/contrast may not be adapted for colormaps such as ''rbw, jet'' or ''hsv. ''It makes more sense for colormaps with only one tint that varies in intensity, such as the ''grey'' colormap. * You can also modify those values by '''clicking directly on the color bar''' in the figures. Hold the mouse button, and move up/down to change the brightness and left/right to change the contrast. Even if the sliders do not work, you can modify the colormaps. |
__'''Colormap name'''__: The standard colormaps are referred to with names (bone, grey, jet, rwb, etc). <<BR>>Pick a different color set in the menu to update all the figures with similar data types. . {{attachment:colormap_name.gif||height="115",width="450"}} __'''Brightness'''__: Moves the center of the color array up and down. Example values: -80, 0, +80. <<BR>>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 ''grey'' colormap. We use it here for lack for a better word. . {{attachment:colormap_brightness.gif||height="115",width="450"}} __'''Contrast'''__: Changes the distance between the first and last colors. Example values: -80,0,+80. . {{attachment:colormap_contrast.gif||height="115",width="450"}} You can modify these values by '''clicking directly on the color bar'''. Hold the mouse button, then: * Move '''up/down''' to change the ''' brightness''', * Move '''left/right''' to change the '''contrast'''. <<TAG(Advanced)>> == Custom color arrays == To edit your own list of colors, use the menu "'''New...'''" at the end of the list of standard colormaps. * Open a 2D sensor cap view for the MEG sensors for the standard average (Run#01). <<BR>> Right-click on the figure Colormap: MEG recordings > Colormap > New. * Enter the name of the new colormap and the number of colors it will contain. <<BR>><<BR>> {{attachment:colormap_new.gif||height="188",width="159"}} {{attachment:colormap_edit1.gif||height="189",width="250"}} * Each color in this color array is represented with a little square. The arrows in the the second row can be selected and deleted (delete key) or edited (double-click). They represent the key colors between which Matlab interpolates the other colors. Click on the second row to add more key colors. <<BR>><<BR>> {{attachment:colormap_edit2.gif||height="189",width="250"}} * Once you are satisfied with your new colormap, click on [Ok]. <<BR>>It will update the figure. A new menu is now available in the list of colormap names.<<BR>><<BR>> {{attachment:colormap_edit3.gif||height="275",width="500"}} * To delete the custom colormap currently selected, use the menu "'''Delete'''". |
Line 34: | Line 55: |
How the values are matched with the colors. | 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. |
Line 36: | Line 57: |
* '''Absolute values''': Display the absolute values of the recordings, instead of the original values. * This is the default for ''Anatomy, Sources'' and ''Stat ''colormaps, but it is not very useful for recordings: for EEG and MEG, the sign of the values is very important. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=colormapDefault.gif|colormapDefault.gif|class="attachment"}} {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=colormapAbsolute.gif|colormapAbsolute.gif|class="attachment"}} ''Fig.1: Relative values; Fig.2: Absolute values '' |
__'''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. |
Line 40: | Line 59: |
* '''Maximum''': How is the maximum of the colorbar estimated, for the color correspondence. * '''Global''': The bounds of the colormap are set to the maximum value across the whole time window. Eg. if you use the ''rbw'' colormap and the min and max values are [-100ft, +100ft], the colors will be mapped in the following way: -100ft is blue, +100ft is red, 0ft is white. The display is identical for each time sample. If you select this option at t=-49ms, the 2D topography figure will turn almost white because the values are low before the stimulus. |
. {{attachment:colormap_absolute.gif||height="142",width="320"}} |
Line 43: | Line 61: |
* '''Local''': It uses the local min and max values at the current time frame AND for each figure, instead of the global min and max. Eg. at t=-49ms, the extrema values are roughly [-25ft, +25ft]. So the colors will be mapped in order to have: -25ft = blue, and +25ft = red. | __'''Maximum'''__: Method used to estimate the minimum and maximum values of the colorbar. |
Line 45: | Line 63: |
* '''Custom''': You can set manually the minimum/maximum bounds of the colorbar. It does not have to be symmetrical around zero. If you set the values to [-100, 200] ft, the white colors would correspond to values ~50ft, hence values around 0ft would be displayed in blue. . {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=colormapNotNormalized.gif|colormapNotNormalized.gif|class="attachment"}} * You can usually keep this option to ''Local'' when looking at recordings, it makes things nicer. But keep in mind that it is not because you see flashy colors that you have strong effects. It's always a matter of colormap configuration. |
* '''Global''': The bounds of the colormap are set to the extrema values found in the entire file. <<BR>> Example: if you use the ''rbw'' colormap and the min and max values are [-200ft, +200ft], the colors will be mapped in the following way: -200ft is blue, +200ft is red, 0ft is white. The mapping is identical for all the time samples. If you select this option at '''t=0ms''', the 2D topography figure will turn almost white because the average values are low before the brain response. |
Line 49: | Line 65: |
* Remember that when you change this option, it is saved in your user preferences. If you close Brainstorm and start it again, the colormap configuration stays the same. | * '''Local''': Uses the local min and max values at the current time frame AND for each figure, instead of the global min and max. Example: A t=0ms, the extrema values are roughly [-30ft, +30ft]. So the colors will be mapped in order to have: -30ft=blue and +30ft=red. |
Line 51: | Line 67: |
* '''Range''': Use symmetrical or non-symmetrical colormaps. * '''[-max, max]''': Symmetrical colorbar around the absolute value of the maximum. Eg. at t=47ms, the range is [-80ft, +100ft], and the colorbar used is [-100ft, +100ft], white is zero. |
* '''Custom''': You can manually set the min/max bounds of the colorbar. It does not have to be symmetrical around zero. If you set the values to [-40,+20] ft, the white colors would correspond to values around -10ft, and values around 0ft would be displayed in pale red. <<BR>><<BR>> {{attachment:colormap_max.gif||height="145",width="489"}} * You can usually keep the option ''Local'' when looking at recordings, it is easier to read. <<BR>> But keep in mind that it is not because you see flashy colors that you necessarily have strong effects. It's always a matter of colormap configuration. |
Line 54: | Line 70: |
* '''[min, max]''': Uses the real min and max. Eg. at t=47ms, the colorbar used is [-80ft, +100ft], white is NOT zero. | __'''Range'''__: Use symmetrical or non-symmetrical colormaps. |
Line 56: | Line 72: |
* This option is ignored when the option "Maximum: Custom" is selected. {{http://neuroimage.usc.edu/brainstorm/Tutorials/TutExploreRecodings?action=AttachFile&do=get&target=colormapMax5.gif|colormapMax5.gif|class="attachment"}} ''Fig.1: [-max,max]; Fig.2: [min,max] '' |
* '''[-max, max]''': Symmetrical colorbar around the absolute value of the maximum. <<BR>>Example: at t=170ms, the range is [-220ft, +90ft], the color mapping used is [-220ft, +220ft]. |
Line 60: | Line 74: |
* | * '''[min, max]''': Uses the real min and max. Useful for displaying values that are not centered on zero. Example: at t=170ms, the mapping used is [-220ft, +90ft], white is not zero. |
Line 62: | Line 76: |
* '''Display colorbar''': Just in case you want to hide the color bar... | * This option is ignored when the option "Maximum: Custom" is selected. <<BR>><<BR>> {{attachment:colormap_range.gif||height="142",width="578"}} |
Line 64: | Line 78: |
* '''Permanent menu''': Open a window that displays this colormap sub-menu. Might be useful when you do a lot of colormap adjustments. | <<TAG(Advanced)>> |
Line 66: | Line 80: |
* '''Restore defaults''': Click on it '''now '''so all your experiments will be discarded. * You can also reset the colormap by '''double-clicking on the color bar'''. |
== 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: * '''Double-click''' on the color bar, or * Use the menu '''Restore defaults'''. Two additional menus can help you manipulate the colormaps: * '''Display colorbar''': In case you want to hide the color bar. Useful for contact sheets and movies. * '''Permanent menu''': Open a window that displays this colormap sub-menu, for faster access. <<BR>><<BR>> {{attachment:colormap_contact.gif||height="185",width="193"}} {{attachment:colormap_permanent.gif||height="280",width="180"}} == New default colormaps == Recently, the default colormaps of Brainstorm were replaced 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: Three other colormaps were added: viridis and magma (taken from [[https://bids.github.io/colormap/|mpl colormaps]]) as well as a variation of viridis (viridis2). The colormaps were created using the [[https://github.com/matplotlib/viscm|viscm]] tool, which allows designing a colormap that has linear lightness and hue changes. This paper summarizes the work done in more details : [[attachment:colormap_optimization.pdf]] |
Tutorial 18: Colormaps
Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet
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.
Contents
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.
Open a topography view for the standard average (right-click > MEG > 2D Sensor cap).
Right-click on the figure, you will only see the menu "Colormap: MEG recordings".
- If you modify a colormap, the changes will be applied to all the figures, saved in your user preferences and available the next time you start Brainstorm.
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, grey, 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 grey 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:
Move up/down to change the brightness,
Move left/right to change the contrast.
Custom color arrays
To edit your own list of colors, use the menu "New..." at the end of the list of standard colormaps.
Open a 2D sensor cap view for the MEG sensors for the standard average (Run#01).
Right-click on the figure Colormap: MEG recordings > Colormap > New.Enter the name of the new colormap and the number of colors it will contain.
Each color in this color array is represented with a little square. The arrows in the the second row can be selected and deleted (delete key) or edited (double-click). They represent the key colors between which Matlab interpolates the other colors. Click on the second row to add more key colors.
Once you are satisfied with your new colormap, click on [Ok].
It will update the figure. A new menu is now available in the list of colormap names.
To delete the custom colormap currently selected, use the menu "Delete".
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.
Global: The bounds of the colormap are set to the extrema values found in the entire file.
Example: if you use the rbw colormap and the min and max values are [-200ft, +200ft], the colors will be mapped in the following way: -200ft is blue, +200ft is red, 0ft is white. The mapping is identical for all the time samples. If you select this option at t=0ms, the 2D topography figure will turn almost white because the average values are low before the brain response.Local: Uses the local min and max values at the current time frame AND for each figure, instead of the global min and max. Example: A t=0ms, the extrema values are roughly [-30ft, +30ft]. So the colors will be mapped in order to have: -30ft=blue and +30ft=red.
Custom: You can manually set the min/max bounds of the colorbar. It does not have to be symmetrical around zero. If you set the values to [-40,+20] ft, the white colors would correspond to values around -10ft, and values around 0ft would be displayed in pale red.
You can usually keep the option Local when looking at recordings, it is easier to read.
But keep in mind that it is not because you see flashy colors that you necessarily have strong effects. It's always a matter of colormap configuration.
Range: Use symmetrical or non-symmetrical colormaps.
[-max, max]: Symmetrical colorbar around the absolute value of the maximum.
Example: at t=170ms, the range is [-220ft, +90ft], the color mapping used is [-220ft, +220ft].[min, max]: Uses the real min and max. Useful for displaying values that are not centered on zero. Example: at t=170ms, the mapping used is [-220ft, +90ft], white is not zero.
This option is ignored when the option "Maximum: Custom" is selected.
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:
Double-click on the color bar, or
Use the menu Restore defaults.
Two additional menus can help you manipulate the colormaps:
Display colorbar: In case you want to hide the color bar. Useful for contact sheets and movies.
Permanent menu: Open a window that displays this colormap sub-menu, for faster access.
New default colormaps
Recently, the default colormaps of Brainstorm were replaced 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:
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 summarizes the work done in more details : colormap_optimization.pdf