Our palettes are a bit different than how matlab's work, as we make sure a zero value always lands on a particular color for each palette. When making palettes from the definitions in PaletteFile.cxx, be aware that some of the palettes have their control points spaced unevenly.
Tim On Tue, Sep 6, 2016 at 12:45 AM, Kristian Loewe <k...@kristianloewe.com> wrote: > Hi Aaron, > > I'm not sure if it is possible to export the colormaps directly. In any > case, I think that one could recreate the colormaps based on the > relevant code sections (take a look at > https://github.com/Washington-University/workbench/blob/ > ddbb8f82be40f93a96255035f1db163d624f676f/src/Files/PaletteFile.cxx). > Here is an example that I put together for the videen_style colormap > (untested): > > function map = videen(n) > > if nargin < 1 > n = size(get(gcf, 'Colormap'), 1); > end > > values = [... > 'ff'; '00'; '00'; % red > 'ff'; '69'; '00'; % orange > 'ff'; '99'; '00'; % oran-yell > 'ff'; 'ff'; '00'; % yellow > '10'; 'b0'; '10'; % limegreen > '00'; 'ff'; '00'; % green > '7f'; '7f'; 'cc'; % blue_videen7 > '4c'; '4c'; '7f'; % blue_videen9 > '33'; '33'; '4c'; % blue_videen11 > '66'; '00'; '33'; % purple2 > '00'; '00'; '00'; % black > '00'; 'ff'; 'ff'; % cyan > '00'; 'ff'; '00'; % green > '10'; 'b0'; '10'; % limegreen > 'e2'; '51'; 'e2'; % violet > 'ff'; '38'; '8d'; % hotpink > 'ff'; 'ff'; 'ff'; % white > 'dd'; 'dd'; 'dd'; % gry-dd > 'bb'; 'bb'; 'bb'; % gry-bb > '00'; '00'; '00']; % black > > values = reshape(hex2dec(values), [3 numel(values)/6])' ./ 255; > > P = size(values,1); > > map = interp1(1:size(values,1), values, linspace(1,P,n), 'linear'); > > end > > > Cheers, > Kris > > > On 05.09.2016 19:01, Aaron C wrote: > > Dear HCP experts, > > > > > > I see the colormaps used in Connectome Workbench are very nice. I am > > wondering if there is a way to export the colormaps of Connectome > > Workbench into the MATLAB. I am particularly interested in using the > > Workbench colormap "videen_style" in the MATLAB. Thank you. > > > > _______________________________________________ > > HCP-Users mailing list > > HCP-Users@humanconnectome.org > > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > > > _______________________________________________ > HCP-Users mailing list > HCP-Users@humanconnectome.org > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > _______________________________________________ HCP-Users mailing list HCP-Users@humanconnectome.org http://lists.humanconnectome.org/mailman/listinfo/hcp-users