本文整理汇总了Java中ij.plugin.RGBStackMerge类的典型用法代码示例。如果您正苦于以下问题:Java RGBStackMerge类的具体用法?Java RGBStackMerge怎么用?Java RGBStackMerge使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RGBStackMerge类属于ij.plugin包,在下文中一共展示了RGBStackMerge类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRGBProjection
import ij.plugin.RGBStackMerge; //导入依赖的package包/类
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]);
ImagePlus blue = new ImagePlus("Blue", channels[2]);
imp.unlock();
ImagePlus saveImp = imp;
imp = red;
color = "(red)"; doProjection();
ImagePlus red2 = projImage;
imp = green;
color = "(green)"; doProjection();
ImagePlus green2 = projImage;
imp = blue;
color = "(blue)"; doProjection();
ImagePlus blue2 = projImage;
int w = red2.getWidth(), h = red2.getHeight(), d = red2.getStackSize();
if (method==SD_METHOD) {
ImageProcessor r = red2.getProcessor();
ImageProcessor g = green2.getProcessor();
ImageProcessor b = blue2.getProcessor();
double max = 0;
double rmax = r.getStatistics().max; if (rmax>max) max=rmax;
double gmax = g.getStatistics().max; if (gmax>max) max=gmax;
double bmax = b.getStatistics().max; if (bmax>max) max=bmax;
double scale = 255/max;
r.multiply(scale); g.multiply(scale); b.multiply(scale);
red2.setProcessor(r.convertToByte(false));
green2.setProcessor(g.convertToByte(false));
blue2.setProcessor(b.convertToByte(false));
}
RGBStackMerge merge = new RGBStackMerge();
ImageStack stack2 = merge.mergeStacks(w, h, d, red2.getStack(), green2.getStack(), blue2.getStack(), true);
imp = saveImp;
projImage = new ImagePlus("Test", stack2);
}
示例2: doRGBProjection
import ij.plugin.RGBStackMerge; //导入依赖的package包/类
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]);
ImagePlus blue = new ImagePlus("Blue", channels[2]);
imp.unlock();
ImagePlus saveImp = imp;
imp = red;
color = "(red)"; doProjection();
ImagePlus red2 = projImage;
imp = green;
color = "(green)"; doProjection();
ImagePlus green2 = projImage;
imp = blue;
color = "(blue)"; doProjection();
ImagePlus blue2 = projImage;
int w = red2.getWidth(), h = red2.getHeight(), d = red2.getStackSize();
if (method==SD_METHOD) {
ImageProcessor r = red2.getProcessor();
ImageProcessor g = green2.getProcessor();
ImageProcessor b = blue2.getProcessor();
double max = 0;
double rmax = r.getStatistics().max; if (rmax>max) max=rmax;
double gmax = g.getStatistics().max; if (gmax>max) max=gmax;
double bmax = b.getStatistics().max; if (bmax>max) max=bmax;
double scale = 255/max;
r.multiply(scale); g.multiply(scale); b.multiply(scale);
red2.setProcessor(r.convertToByte(false));
green2.setProcessor(g.convertToByte(false));
blue2.setProcessor(b.convertToByte(false));
}
RGBStackMerge merge = new RGBStackMerge();
ImageStack stack2 = merge.mergeStacks(w, h, d, red2.getStack(), green2.getStack(), blue2.getStack(), true);
imp = saveImp;
projImage = new ImagePlus(makeTitle(), stack2);
}