help > Edge Colormap
Showing 1-3 of 3 posts
Display:
Results per page:
Aug 6, 2020  07:08 PM | kara
Edge Colormap
I'm trying to use a custom colormap for my edges. In the popup box ("Colormap... Custom...") I enter the following: "[0 1 0; 1 0 0; 0 0 1];" This produces the following error:

Index in position 1 exceeds array bounds (must not exceed 3).

Error in BrainNet>DrawLine (line 3858)
set(Line,'FaceColor',EC.edg.CM(surf.cylinder(i,5),:));
Error in BrainNet>PlotLine1 (line 3139)
DrawLine(surf,j,1,2);
Error in BrainNet>FileView (line 3991)
PlotLine1(surf);
Error in BrainNet>LoadFile_ClickedCallback (line 5150)
a=FileView;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in BrainNet (line 53)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)BrainNet('LoadFile_ClickedCallback',hObject,eventdata,guidata(hObject))
Error while evaluating PushTool ClickedCallback.

It doesn't matter what numbers I enter in the matrix. I always get this error. Any help with this would be greatly appreciated. My goal is essentially just to have 3 different colors for edges, but they aren't the same as those for the nodes so I can't use the "Nodal Module" option. So if there is another/easier way to accomplish this same goal, that would work too.
Aug 7, 2020  02:08 AM | Mingrui Xia
RE: Edge Colormap
Please create a matrix with the same size as the edge file, in which edges are indexed with different number to show different colors (index can be 1, 2, 3, ...). Save this matrix into a txt file and load it in the popup dialog for edge custom colormap.
Originally posted by kara:
I'm trying to use a custom colormap for my edges. In the popup box ("Colormap... Custom...") I enter the following: "[0 1 0; 1 0 0; 0 0 1];" This produces the following error:

Index in position 1 exceeds array bounds (must not exceed 3).

Error in BrainNet>DrawLine (line 3858)
set(Line,'FaceColor',EC.edg.CM(surf.cylinder(i,5),:));
Error in BrainNet>PlotLine1 (line 3139)
DrawLine(surf,j,1,2);
Error in BrainNet>FileView (line 3991)
PlotLine1(surf);
Error in BrainNet>LoadFile_ClickedCallback (line 5150)
a=FileView;
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in BrainNet (line 53)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)BrainNet('LoadFile_ClickedCallback',hObject,eventdata,guidata(hObject))
Error while evaluating PushTool ClickedCallback.

It doesn't matter what numbers I enter in the matrix. I always get this error. Any help with this would be greatly appreciated. My goal is essentially just to have 3 different colors for edges, but they aren't the same as those for the nodes so I can't use the "Nodal Module" option. So if there is another/easier way to accomplish this same goal, that would work too.
Aug 7, 2020  01:08 PM | kara
RE: Edge Colormap
Worked perfectly, thank you!