()
| 164 | } |
| 165 | |
| 166 | void invertLut() { |
| 167 | ImagePlus imp = WindowManager.getCurrentImage(); |
| 168 | if (imp==null) |
| 169 | {IJ.noImage(); return;} |
| 170 | if (imp.getProcessor().getNChannels()==3) { |
| 171 | IJ.error("RGB images do not use LUTs"); |
| 172 | return; |
| 173 | } |
| 174 | if (imp.isComposite()) { |
| 175 | CompositeImage ci = (CompositeImage)imp; |
| 176 | LUT lut = ci.getChannelLut(); |
| 177 | if (lut!=null) |
| 178 | ci.setChannelLut(lut.createInvertedLut()); |
| 179 | } else { |
| 180 | ImageProcessor ip = imp.getProcessor(); |
| 181 | ip.invertLut(); |
| 182 | if (imp.getStackSize()>1) |
| 183 | imp.getStack().setColorModel(ip.getColorModel()); |
| 184 | } |
| 185 | imp.updateAndRepaintWindow(); |
| 186 | } |
| 187 | |
| 188 | int fire(byte[] reds, byte[] greens, byte[] blues) { |
| 189 | int[] r = {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}; |
no test coverage detected