/** Converts an RGB image to a Lab stack. */ public void convertToLab() { if (type!=ImagePlus.COLOR_RGB) throw new IllegalArgumentException("Image must be RGB"); ColorSpaceConverter converter = new ColorSpaceConverter(); ImagePlus imp2 = converter.RGBToLab(imp); Point loc = null; ImageWindow win = imp.getWindow(); if (win!=null) loc = win.getLocation(); ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); imp2.copyAttributes(imp); imp.changes = false; imp.close(); }
/** Converts an RGB image to a Lab stack. */ public void convertToLab() { if (type!=ImagePlus.COLOR_RGB) throw new IllegalArgumentException("Image must be RGB"); ColorSpaceConverter converter = new ColorSpaceConverter(); ImagePlus imp2 = converter.RGBToLab(imp); Point loc = null; ImageWindow win = imp.getWindow(); if (win!=null) loc = win.getLocation(); ImageWindow.setNextLocation(loc); imp2.show(); imp.hide(); imp2.copyAttributes(imp); imp.changes = false; imp.close(); }
lab = converter.RGBToLab(new ImagePlus("Lab", image.getStack().getProcessor(slice))); }else { lab = null;
lab = converter.RGBToLab(new ImagePlus("Lab", image.getStack().getProcessor(slice))); } else { lab = null;