help > RE: Node colors: min and max values
Feb 4, 2017  08:02 AM | Mingrui Xia
RE: Node colors: min and max values
Hi, 

The codes for adjusting nodal color are located at about line 552, function NodePrepare, in BrainNet.m:

original codes:
surf.sphere(:,6)=surf.sphere(:,4);
if min(surf.sphere(:,6))<0
surf.sphere(:,6)=surf.sphere(:,6)-min(surf.sphere(:,6));
end
if min(surf.sphere(:,6))<1
surf.sphere(:,6)=surf.sphere(:,6)+1;
end
while max(surf.sphere(:,6))/min(surf.sphere(:,6))>10    %non-linear transfer
surf.sphere(:,6)=log(surf.sphere(:,6));
if min(surf.sphere(:,6))<1
surf.sphere(:,6)=surf.sphere(:,6)+1;
end
end
if max(surf.sphere(:,6))~=min(surf.sphere(:,6))  % linear transfer
EC.nod.k=63/(max(surf.sphere(:,6))-min(surf.sphere(:,6)));
EC.nod.b=64-EC.nod.k*max(surf.sphere(:,6));
else
EC.nod.k=0;
EC.nod.b=1;
end
surf.sphere(:,6)=surf.sphere(:,6)*EC.nod.k+EC.nod.b;

Please comment the non-linear parts, and modify the linear transfer part as (suppose the fixed scale is -5 ~ 5): 
if max(surf.sphere(:,6))~=min(surf.sphere(:,6))
EC.nod.k=63/10;                                              %10 represent 5 - (-5)
EC.nod.b=64-EC.nod.k*5;                                  %5 represent the high end of colorbar
else
EC.nod.k=0;
EC.nod.b=1;
end 

Best,
Mingrui

Threaded View

TitleAuthorDate
Ezequiel Mikulan Feb 2, 2017
RE: Node colors: min and max values
Mingrui Xia Feb 4, 2017