help > Change nodes colormap to custom colormap
Showing 1-9 of 9 posts
Display:
Results per page:
Sep 6, 2017  06:09 PM | 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  07: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  12:09 PM | 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  11:04 PM | Yey Erric
RE: Change nodes colormap to custom colormap
Thanks
Nov 22, 2018  04:11 PM | 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 18, 2018  01:12 AM | 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!
Jan 24, 2019  08:01 PM | Damion Demeter
RE: Change nodes colormap to custom colormap
This feels like a stupid question, but I can't find any documentation on what format the .txt file is supposed to be for this. I'm using the new version, so the custom colormap is no longer just a pop up, but a popup looking for a .txt file. I've tried a line for each module in a txt file with "module# RGB" and "RGB Module#". Neither work. There doesn't seem to be a user manual for the newest version and the old one doesn't mention this custom colormap button or functionality. 

Can anyone point me in the right direction with this? I'm trying to not change each module's color by hand. Thanks!
Jan 25, 2019  02:01 PM | Mingrui Xia
RE: Change nodes colormap to custom colormap
Hi, 

Thanks for your feedback. Here, I attached an example of a custom color txt file. It includes a 6x3 matrix like this:

1 0 0
0 1 0
0 0 1
1 1 0
1 0 1
0 1 1

where each row corresponds to a color of a module (e.g., "1 0 0" are the R, G, and B values, and this color is red). 

I also attached a color displayed in the panel after reading this file. We will revise the manual to clarify its format.

Hope this would be helpful. 

Best,
Mingrui 
Originally posted by Damion Demeter:
This feels like a stupid question, but I can't find any documentation on what format the .txt file is supposed to be for this. I'm using the new version, so the custom colormap is no longer just a pop up, but a popup looking for a .txt file. I've tried a line for each module in a txt file with "module# RGB" and "RGB Module#". Neither work. There doesn't seem to be a user manual for the newest version and the old one doesn't mention this custom colormap button or functionality. 

Can anyone point me in the right direction with this? I'm trying to not change each module's color by hand. Thanks!
Attachment: ModuleColor.zip
Jan 25, 2019  06:01 PM | Damion Demeter
RE: Change nodes colormap to custom colormap
Mingrui, 

Thank you! This worked! I thought I had tried setting it up with each line being a module, but somewhere I must have messed it up. This helped a lot!!
Originally posted by Mingrui Xia:
Hi, 

Thanks for your feedback. Here, I attached an example of a custom color txt file. It includes a 6x3 matrix like this:

1 0 0
0 1 0
0 0 1
1 1 0
1 0 1
0 1 1

where each row corresponds to a color of a module (e.g., "1 0 0" are the R, G, and B values, and this color is red). 

I also attached a color displayed in the panel after reading this file. We will revise the manual to clarify its format.

Hope this would be helpful. 

Best,
Mingrui 
Originally posted by Damion Demeter:
This feels like a stupid question, but I can't find any documentation on what format the .txt file is supposed to be for this. I'm using the new version, so the custom colormap is no longer just a pop up, but a popup looking for a .txt file. I've tried a line for each module in a txt file with "module# RGB" and "RGB Module#". Neither work. There doesn't seem to be a user manual for the newest version and the old one doesn't mention this custom colormap button or functionality. 

Can anyone point me in the right direction with this? I'm trying to not change each module's color by hand. Thanks!