private static ColorTable8 fire() { final int[][] v = { { 0, 0, 1, 25, 49, 73, 98, 122, 146, 162, 173, 184, 195, 207, 217, 229, 240, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 35, 57, 79, 101, 117, 133, 147, 161, 175, 190, 205, 219, 234, 248, 255, 255, 255, 255 }, { 0, 61, 96, 130, 165, 192, 220, 227, 210, 181, 151, 122, 93, 64, 35, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 98, 160, 223, 255 } }; return custom(v); }
private static ColorTable8 custom(final int[][] v) { final byte[][] values = new byte[v.length][]; for (int j = 0; j < v.length; j++) { values[j] = new byte[v[j].length]; for (int i = 0; i < v[j].length; i++) { values[j][i] = (byte) v[j][i]; } } final ColorTable8 lut = new ColorTable8(values); return interpolate(lut, 256); }
/** * For each channel in CompositeImage, sets LUT to one from default * progression */ private void setCompositeImageLUTsToDefault(final CompositeImage ci) { for (int i = 0; i < ci.getNChannels(); i++) { final ColorTable cTable = ColorTables.getDefaultColorTable(i); final LUT lut = make8BitLUT(cTable); ci.setChannelLut(lut, i + 1); } }
/** * Sets the correct legacy ImageJ CompositeImage display mode based upon input * data values. */ private void setCompositeImageMode(final CompositeImage ci, final int composCount, final List<ColorTable> cTables) { if ((composCount > 1) || (cTables == null) || (cTables.size() == 0)) ci .setMode(CompositeImage.COMPOSITE); else { boolean allGrayTables = true; for (int i = 0; i < ci.getNChannels(); i++) { final ColorTable cTable = cTables.get(i); if ((allGrayTables) && (!ColorTables.isGrayColorTable(cTable))) { allGrayTables = false; } } if (allGrayTables) { ci.setMode(CompositeImage.GRAYSCALE); } else { ci.setMode(CompositeImage.COLOR); } } }
if (imp.getType() == ImagePlus.COLOR_RGB) { for (int i = 0; i < imp.getNChannels() * 3; i++) { final ColorTable cTable = ColorTables.getDefaultColorTable(i); colorTables.add(cTable);
private static ColorTable8 ice() { final int[][] v = { { 0, 0, 0, 0, 0, 0, 19, 29, 50, 48, 79, 112, 134, 158, 186, 201, 217, 229, 242, 250, 250, 250, 250, 251, 250, 250, 250, 250, 251, 251, 243, 230 }, { 156, 165, 176, 184, 190, 196, 193, 184, 171, 162, 146, 125, 107, 93, 81, 87, 92, 97, 95, 93, 93, 90, 85, 69, 64, 54, 47, 35, 19, 0, 4, 0 }, { 140, 147, 158, 166, 170, 176, 209, 220, 234, 225, 236, 246, 250, 251, 250, 250, 245, 230, 230, 222, 202, 180, 163, 142, 123, 114, 106, 94, 84, 64, 26, 27 } }; return custom(v); }
final ColorTable8 lut = c == 1 ColorTables.GRAYS : ColorTables.getDefaultColorTable(i); converters.add(new RealLUTConverter<>(min, max, lut));