help > RE: Custom Color Map
Nov 30, 2018  01:11 AM | Mingrui Xia
RE: Custom Color Map
Hi, 

I wrote a small function to help generate the color map you need. This function can adjust an original continuous color map by adding a blank corresponding to your need. Then this adjusted color map can be input as the custom colormap in GUI.

For example, in your case: 

First, generate the same colormap as in the image (without the white part):
original_color_map = [linspace(22,208,5),ones(1,5)*255;linspace(22,208,5),linspace(208,22,5);ones(1,5)*255,linspace(208,22,5)]'/255;

then, use the attached function to adjust this colormap with your values:
adjusted_color_map = BrainNet_GenColormap(-11,-3,3,4,original_color_map);


I need more time to add this function to the GUI, possibly with the next release. 

Best,
Mingrui 

Originally posted by Renante Rondina:
Hello,

I have been using BrainNet for some time now, and am comfortable with the GUI, but I am not very proficient at coding. I had a question about customizing the color map.

I am interested in displaying node data that ranges from negative to positive values (e.g., -11 to +4), with a gradient to the color map so that nodes with more extreme values are either more saturated or have a different hue (e.g., warmer vs. cooler). I also need to threshold my data so that nodes with mid-range values (e.g., -3 to +3) do not appear on the brain map. Ideally, the colors corresponding to those mid-range values would appear as white or colorless on the color map, similar to the colormap shown on the right side of this image: https://hughpumphrey.files.wordpress.com/2017/06/bwr.png

However, there is nothing similar in the preset options when selecting nodal color. Currently, I am using a Jet scale and have removed data points with mid-range values from the input file. Please see attached file for an example output image. Note that this image does not contain any nodes with mid-range values, which would correspond to colors from yellow to redish-orange on the color map. However, this creates a problem when interpreting multiple images with different scales as the colors corresponding to mid-range values changes in the color map from image to image.

Are there any available patches or custom-made maps that would be suitable for my purposes?
Please let me know,
Thank you in advance

Threaded View

TitleAuthorDate
Renante Rondina Nov 21, 2018
Natalia Zdorovtsova Jul 16, 2022
RE: Custom Color Map
Mingrui Xia Nov 30, 2018