/** Deprecated; replaced by ChannelSplitter.splitRGB(). */ public void split(ImageStack rgb, boolean keepSource) { ImageStack[] channels = ChannelSplitter.splitRGB(rgb, keepSource); red = channels[0]; green = channels[1]; blue = channels[2]; }
/** Deprecated; replaced by ChannelSplitter.splitRGB(). */ public void split(ImageStack rgb, boolean keepSource) { ImageStack[] channels = ChannelSplitter.splitRGB(rgb, keepSource); red = channels[0]; green = channels[1]; blue = channels[2]; }
private static ImageStack filterRGB(ImageStack rgb_in, int filter, float vx, float vy, float vz) { ImageStack[] channels = ChannelSplitter.splitRGB(rgb_in, false); ImageStack red = filter(channels[0], filter, vx, vy, vz); ImageStack green = filter(channels[1], filter, vx, vy, vz); ImageStack blue = filter(channels[2], filter, vx, vy, vz); return RGBStackMerge.mergeStacks(red, green, blue, false); }
private static ImageStack filterRGB(ImageStack rgb_in, int filter, float vx, float vy, float vz) { ImageStack[] channels = ChannelSplitter.splitRGB(rgb_in, false); ImageStack red = filter(channels[0], filter, vx, vy, vz); ImageStack green = filter(channels[1], filter, vx, vy, vz); ImageStack blue = filter(channels[2], filter, vx, vy, vz); return RGBStackMerge.mergeStacks(red, green, blue, false); }
/** Returns, as an ImageStack, the specified channel, where 'c' must be greater than zero and less than or equal to the number of channels in the image. */ public static ImageStack getChannel(ImagePlus imp, int c) { if (imp.getBitDepth()==24) { // RGB? if (c<1 || c>3) throw new IllegalArgumentException("Channel must be 1,2 or 3"); ImageStack[] channels = splitRGB(imp.getStack(), true); return channels[c-1]; } if (c<1 || c>imp.getNChannels()) throw new IllegalArgumentException("Channel less than 1 or greater than "+imp.getNChannels()); ImageStack stack1 = imp.getStack(); ImageStack stack2 = new ImageStack(imp.getWidth(), imp.getHeight()); for (int t=1; t<=imp.getNFrames(); t++) { for (int z=1; z<=imp.getNSlices(); z++) { int n = imp.getStackIndex(c, z, t); stack2.addSlice(stack1.getProcessor(n)); } } return stack2; }
/** Returns, as an ImageStack, the specified channel, where 'c' must be greater than zero and less than or equal to the number of channels in the image. */ public static ImageStack getChannel(ImagePlus imp, int c) { if (imp.getBitDepth()==24) { // RGB? if (c<1 || c>3) throw new IllegalArgumentException("Channel must be 1,2 or 3"); ImageStack[] channels = splitRGB(imp.getStack(), true); return channels[c-1]; } if (c<1 || c>imp.getNChannels()) throw new IllegalArgumentException("Channel less than 1 or greater than "+imp.getNChannels()); ImageStack stack1 = imp.getStack(); ImageStack stack2 = new ImageStack(imp.getWidth(), imp.getHeight()); for (int t=1; t<=imp.getNFrames(); t++) { for (int z=1; z<=imp.getNSlices(); z++) { int n = imp.getStackIndex(c, z, t); stack2.addSlice(stack1.getProcessor(n)); } } return stack2; }
public void run(String arg) { ImagePlus imp = IJ.getImage(); if (imp.isComposite()) { int z = imp.getSlice(); int t = imp.getFrame(); ImagePlus[] channels = split(imp); imp.changes = false; imp.setIgnoreFlush(true); imp.close(); for (int i=0; i<channels.length; i++) { channels[i].setIJMenuBar(i==channels.length-1); channels[i].show(); if (z>1 || t>1) channels[i].setPosition(1, z, t); } } else if (imp.getType()==ImagePlus.COLOR_RGB) splitRGB(imp); else IJ.error("Split Channels", "Multichannel image required"); }
public void run(String arg) { ImagePlus imp = IJ.getImage(); if (imp.isComposite()) { int z = imp.getSlice(); int t = imp.getFrame(); ImagePlus[] channels = split(imp); imp.changes = false; imp.setIgnoreFlush(true); imp.close(); for (int i=0; i<channels.length; i++) { channels[i].setIJMenuBar(i==channels.length-1); channels[i].show(); if (z>1 || t>1) channels[i].setPosition(1, z, t); } } else if (imp.getType()==ImagePlus.COLOR_RGB) splitRGB(imp); else IJ.error("Split Channels", "Multichannel image required"); }
ImageStack[] stacks = splitRGB(imp.getStack(), true); ImagePlus[] images = new ImagePlus[3]; images[0] = new ImagePlus("red", stacks[0]);
ImageStack[] stacks = splitRGB(imp.getStack(), true); ImagePlus[] images = new ImagePlus[3]; images[0] = new ImagePlus("red", stacks[0]);
private void splitRGB(ImagePlus imp) { boolean keepSource = IJ.altKeyDown(); String title = imp.getTitle(); Calibration cal = imp.getCalibration(); int pos = imp.getCurrentSlice(); ImageStack[] channels = splitRGB(imp.getStack(), keepSource); if (!keepSource) {imp.unlock(); imp.changes=false; imp.close();} ImagePlus rImp = new ImagePlus(title+" (red)", channels[0]); rImp.setCalibration(cal); rImp.setIJMenuBar(false); rImp.show(); rImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus gImp = new ImagePlus(title+" (green)", channels[1]); gImp.setCalibration(cal); gImp.setIJMenuBar(false); gImp.show(); gImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus bImp = new ImagePlus(title+" (blue)", channels[2]); bImp.setCalibration(cal); bImp.show(); bImp.setSlice(pos); }
private void splitRGB(ImagePlus imp) { boolean keepSource = IJ.altKeyDown(); String title = imp.getTitle(); Calibration cal = imp.getCalibration(); int pos = imp.getCurrentSlice(); ImageStack[] channels = splitRGB(imp.getStack(), keepSource); if (!keepSource) {imp.unlock(); imp.changes=false; imp.close();} ImagePlus rImp = new ImagePlus(title+" (red)", channels[0]); rImp.setCalibration(cal); rImp.setIJMenuBar(false); rImp.show(); rImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus gImp = new ImagePlus(title+" (green)", channels[1]); gImp.setCalibration(cal); gImp.setIJMenuBar(false); gImp.show(); gImp.setSlice(pos); if (IJ.isMacOSX()) IJ.wait(500); ImagePlus bImp = new ImagePlus(title+" (blue)", channels[2]); bImp.setCalibration(cal); bImp.show(); bImp.setSlice(pos); }
private void doRGBProjections(ImagePlus imp) { boolean saveUseInvertingLut = Prefs.useInvertingLut; Prefs.useInvertingLut = false; ImageStack[] channels = ChannelSplitter.splitRGB(imp.getStack(), true); ImagePlus red = new ImagePlus("Red", channels[0]); ImagePlus green = new ImagePlus("Green", channels[1]);
private void doRGBProjections(ImagePlus imp) { boolean saveUseInvertingLut = Prefs.useInvertingLut; Prefs.useInvertingLut = false; ImageStack[] channels = ChannelSplitter.splitRGB(imp.getStack(), true); ImagePlus red = new ImagePlus("Red", channels[0]); ImagePlus green = new ImagePlus("Green", channels[1]);
private void doRGBProjection(ImageStack stack) { ImageStack[] channels = ChannelSplitter.splitRGB(stack, true); ImagePlus red = new ImagePlus("Red", channels[0]); ImagePlus green = new ImagePlus("Green", channels[1]);
private void doRGBProjection(ImageStack stack) { ImageStack[] channels = ChannelSplitter.splitRGB(stack, true); ImagePlus red = new ImagePlus("Red", channels[0]); ImagePlus green = new ImagePlus("Green", channels[1]);