cornerstone icon indicating copy to clipboard operation
cornerstone copied to clipboard

How to add colors for colormap

Open hongliang666 opened this issue 5 years ago • 3 comments

I want to add more kinds of colors for colormap? Is it easy to do this? Or is there one API for this question? Thanks a lot

hongliang666 avatar Jan 02 '20 08:01 hongliang666

see this


function getCustomLookupTable(minPixelValue, maxPixelValue) {
--
  | const colormap = cornerstone.colors.getColormap('myCustomColorMap');
  | colormap.setNumberOfColors(6);
  |  
  | // You can also use `addColor` but in this case it wouldn't work.
  | // Any colormap returned by `getColormap` lasts forever (global) and
  | // calling `addColor` would result in duplicated colors.
  | colormap.insertColor(0, [188, 252, 201, 255]); // Banana
  | colormap.insertColor(1, [245, 222, 179, 255]); // Wheat
  | colormap.insertColor(2, [255, 125,  64, 255]); // Flesh
  | colormap.insertColor(3, [135,  38,  87, 255]); // Raspberry
  | colormap.insertColor(4, [227, 206,  87, 255]); // Mint
  | colormap.insertColor(5, [ 51, 160, 201, 255]); // Peacock
  |  
  | return colormap;
  | }


qkreltms avatar Mar 18 '21 07:03 qkreltms

What if the color changes gradually?

lang18276916053 avatar Aug 18 '23 02:08 lang18276916053

这是来自QQ邮箱的假期自动回复邮件。 您好,邮件我已收到,我将在看到后第一时间给您回复。

No-Dream-No-Life avatar Aug 18 '23 02:08 No-Dream-No-Life