cornerstone
cornerstone copied to clipboard
How to add colors for colormap
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
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;
| }
What if the color changes gradually?
这是来自QQ邮箱的假期自动回复邮件。 您好,邮件我已收到,我将在看到后第一时间给您回复。