help > Change nodes colormap to custom colormap
Showing 1-6 of 6 posts
Display:
Results per page:
Sep 6, 2017  11:09 AM | Ezequiel Mikulan
Change nodes colormap to custom colormap
Hi, I would like to know if there is a way to change the nodes' colormap to a custom colormap (i.e. brewermaps or custom made). I tried saving a Cfg file and editing the EC.nod.CM field (with the 64x3 matrix of my custom colormap) but it doesn't seem to work, it keeps using the "jet" colormap. I suppose that the EC.node.color_map field (value=1) is setting it to use "jet" because if I change that parameter to 2 it uses HSV. Thanks in advance and thank you again for an awesome toolbox. Cheers
Sep 6, 2017  12:09 PM | Steve Da
RE: Change nodes colormap to custom colormap
Dear Developer,
I may have the similar problem to use the customized colormap for the nodes.
Basically, I have a mat file which includes 64 rows n*3 matrix for my colormap. I loaded the mat file in matlab and used the variable for the window of the custom colorbar, but it does not work.
Please let me know if you have any idea to solve the problem.

Thanks and Best Regards,

Steve
Sep 13, 2017  05:09 AM | Mingrui Xia
RE: Change nodes colormap to custom colormap
Hi,

In the latest version, users can input a n*3 matrix in the option panel for the colormap of the nodes.
Please input the matrix as matlab code, like [ 1 1 1; 0 1 0]; in the popup dialog after choosing 'custom' in the colormap for nodes.

Best,
Mingrui
Apr 10, 2018  04:04 PM | Yey Erric
RE: Change nodes colormap to custom colormap
Thanks
Nov 22, 2018  08:11 AM | Renante Rondina - Rotman Research Institute
RE: Change nodes colormap to custom colormap
Hi Mingrui,

I am trying to do a similar thing, but I get the following error on Matlab:

Index exceeds matrix dimensions.

Error in BrainNet>DrawSphere (line 2708)
set(Node,'FaceColor',EC.nod.CM(ci,:));
Error in BrainNet>PlotNode1 (line 2014)
DrawSphere(surf,j,2,1,EC);
Error in BrainNet>FileView (line 3610)
a=PlotNode1(surf,a,2,EC);
Error in BrainNet>LoadFile_ClickedCallback (line 4754)
a=FileView;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in BrainNet (line 53)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)BrainNet('LoadFile_ClickedCallback',hObject,eventdata,guidata(hObject))
Error while evaluating PushTool ClickedCallback

The matrix I entered was 57*3:

[0.88 0.04 0.04; 0.88 0.07 0.07; 0.88 0.11 0.11; 0.88 0.14 0.14; 0.88 0.18 0.18; 0.88 0.21 0.21; 0.88 0.25 0.25; 0.88 0.28 0.28; 0.88 0.32 0.32; 0.88 0.35 0.35; 0.88 0.39 0.39; 0.88 0.42 0.42; 0.88 0.46 0.46; 0.88 0.49 0.49; 0.88 0.53 0.53; 0.88 0.56 0.56; 0.88 0.6 0.6; 0.88 0.64 0.64; 0.88 0.67 0.67; 0.88 0.71 0.71; 0.88 0.74 0.74; 0.88 0.78 0.78; 0.88 0.81 0.81; 0.88 0.85 0.85; 0.88 0.88 0.88; 0.88 0.92 0.92; 0.88 0.95 0.95; 0.88 0.99 0.99; 1 1 1; 0.99 0.99 1; 0.95 0.95 1; 0.92 0.92 1; 0.88 0.88 1; 0.85 0.85 1; 0.81 0.81 1; 0.78 0.78 1; 0.74 0.74 1; 0.71 0.71 1; 0.67 0.67 1; 0.64 0.64 1; 0.6 0.6 1; 0.56 0.56 1; 0.53 0.53 1; 0.49 0.49 1; 0.46 0.46 1; 0.42 0.42 1; 0.39 0.39 1; 0.35 0.35 1; 0.32 0.32 1; 0.28 0.28 1; 0.25 0.25 1; 0.21 0.21 1; 0.18 0.18 1; 0.14 0.14 1; 0.11 0.11 1; 0.07 0.07 1; 0.04 0.04 1]

Please advise?
Thank you!
Dec 17, 2018  05:12 PM | Mingrui Xia
RE: Change nodes colormap to custom colormap
Hi Renante, 

The attached version has fixed bug. please have a try. 

Best,
Mingrui

Originally posted by Renante Rondina:
Hi Mingrui,

I am trying to do a similar thing, but I get the following error on Matlab:

Index exceeds matrix dimensions.

Error in BrainNet>DrawSphere (line 2708)
set(Node,'FaceColor',EC.nod.CM(ci,:));
Error in BrainNet>PlotNode1 (line 2014)
DrawSphere(surf,j,2,1,EC);
Error in BrainNet>FileView (line 3610)
a=PlotNode1(surf,a,2,EC);
Error in BrainNet>LoadFile_ClickedCallback (line 4754)
a=FileView;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in BrainNet (line 53)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)BrainNet('LoadFile_ClickedCallback',hObject,eventdata,guidata(hObject))
Error while evaluating PushTool ClickedCallback

The matrix I entered was 57*3:

[0.88 0.04 0.04; 0.88 0.07 0.07; 0.88 0.11 0.11; 0.88 0.14 0.14; 0.88 0.18 0.18; 0.88 0.21 0.21; 0.88 0.25 0.25; 0.88 0.28 0.28; 0.88 0.32 0.32; 0.88 0.35 0.35; 0.88 0.39 0.39; 0.88 0.42 0.42; 0.88 0.46 0.46; 0.88 0.49 0.49; 0.88 0.53 0.53; 0.88 0.56 0.56; 0.88 0.6 0.6; 0.88 0.64 0.64; 0.88 0.67 0.67; 0.88 0.71 0.71; 0.88 0.74 0.74; 0.88 0.78 0.78; 0.88 0.81 0.81; 0.88 0.85 0.85; 0.88 0.88 0.88; 0.88 0.92 0.92; 0.88 0.95 0.95; 0.88 0.99 0.99; 1 1 1; 0.99 0.99 1; 0.95 0.95 1; 0.92 0.92 1; 0.88 0.88 1; 0.85 0.85 1; 0.81 0.81 1; 0.78 0.78 1; 0.74 0.74 1; 0.71 0.71 1; 0.67 0.67 1; 0.64 0.64 1; 0.6 0.6 1; 0.56 0.56 1; 0.53 0.53 1; 0.49 0.49 1; 0.46 0.46 1; 0.42 0.42 1; 0.39 0.39 1; 0.35 0.35 1; 0.32 0.32 1; 0.28 0.28 1; 0.25 0.25 1; 0.21 0.21 1; 0.18 0.18 1; 0.14 0.14 1; 0.11 0.11 1; 0.07 0.07 1; 0.04 0.04 1]

Please advise?
Thank you!