Package ij.plugin

Examples of ij.plugin.HyperStackReducer


    int channels = imp.getNChannels();
    int slices = imp.getNSlices();
    int frames = imp.getNFrames();
    int bitDepth = imp.getBitDepth();
    int size = slices*frames;
    HyperStackReducer reducer = new HyperStackReducer(imp);
    for (int c=1; c<=channels; c++) {
      ImageStack stack2 = new ImageStack(width, height, size); // create empty stack
      stack2.setPixels(imp.getProcessor().getPixels(), 1); // can't create ImagePlus will null 1st image
      ImagePlus imp2 = new ImagePlus("C"+c+"-"+imp.getTitle(), stack2);
      stack2.setPixels(null, 1);
      imp.setPosition(c, 1, 1);
      imp2.setDimensions(1, slices, frames);
      imp2.setCalibration(imp.getCalibration());
      reducer.reduce(imp2);
      if (imp.isComposite() && ((CompositeImage)imp).getMode()==CompositeImage.GRAYSCALE)
        IJ.run(imp2, "Grays", "");
      if (imp2.getNDimensions()>3)
        imp2.setOpenAsHyperStack(true);
      imp2.show();
View Full Code Here

TOP

Related Classes of ij.plugin.HyperStackReducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.