(new HyperStackConverter()).shuffle(imp, intOrder); ImagePlus imp2 = imp; int intMode = IJ.COMPOSITE;
(new HyperStackConverter()).shuffle(imp, intOrder); ImagePlus imp2 = imp; int intMode = IJ.COMPOSITE;
public ImagePlus shrinkHyperstackZ(ImagePlus imp, int zshrink) { int width = imp.getWidth(); int height = imp.getHeight(); int channels = imp.getNChannels(); int slices = imp.getNSlices(); int frames = imp.getNFrames(); ImageStack stack = imp.getStack(); int slices2 = slices/zshrink; ImageStack stack2 = new ImageStack(width, height); for (int c=1; c<=channels; c++) { for (int t=1; t<=frames; t++) { ImageStack tstack = new ImageStack(width, height); for (int z=1; z<=slices; z++) { int i = imp.getStackIndex(c, z, t); ImageProcessor ip = stack.getProcessor(imp.getStackIndex(c, z, t)); tstack.addSlice(stack.getSliceLabel(i), ip); } //IJ.log("1: "+c+" "+t+" "+tstack.getSize()+" "+slices); tstack = shrinkZ(tstack, zshrink); for (int i=1; i<=tstack.getSize(); i++) stack2.addSlice(tstack.getSliceLabel(i), tstack.getProcessor(i)); } } imp.setStack(stack2, channels, slices2, frames); new HyperStackConverter().shuffle(imp, HyperStackConverter.ZTC); IJ.showProgress(1.0); return imp; }
public ImagePlus shrinkHyperstackZ(ImagePlus imp, int zshrink) { int width = imp.getWidth(); int height = imp.getHeight(); int channels = imp.getNChannels(); int slices = imp.getNSlices(); int frames = imp.getNFrames(); ImageStack stack = imp.getStack(); int slices2 = slices/zshrink; ImageStack stack2 = new ImageStack(width, height); for (int c=1; c<=channels; c++) { for (int t=1; t<=frames; t++) { ImageStack tstack = new ImageStack(width, height); for (int z=1; z<=slices; z++) { int i = imp.getStackIndex(c, z, t); ImageProcessor ip = stack.getProcessor(imp.getStackIndex(c, z, t)); tstack.addSlice(stack.getSliceLabel(i), ip); } //IJ.log("1: "+c+" "+t+" "+tstack.getSize()+" "+slices); tstack = shrinkZ(tstack, zshrink); for (int i=1; i<=tstack.getSize(); i++) stack2.addSlice(tstack.getSliceLabel(i), tstack.getProcessor(i)); } } imp.setStack(stack2, channels, slices2, frames); new HyperStackConverter().shuffle(imp, HyperStackConverter.ZTC); IJ.showProgress(1.0); return imp; }
IJ.error("HyperStack Converter", "Virtual stacks must by in XYCZT order."); else { shuffle(imp, ordering); ImagePlus imp2 = imp; if (nChannels>1 && imp.getBitDepth()!=24) {
IJ.error("HyperStack Converter", "Virtual stacks must by in XYCZT order."); else { shuffle(imp, ordering); ImagePlus imp2 = imp; if (nChannels>1 && imp.getBitDepth()!=24) {
imp.setProperty("Info", fi.info); if (fi.description!=null && fi.description.contains("order=zct")) new HyperStackConverter().shuffle(imp, HyperStackConverter.ZCT); int stackSize = stack.getSize(); if (nChannels>1 && (stackSize%nChannels)==0) {
imp.setProperty("Info", fi.info); if (fi.description!=null && fi.description.contains("order=zct")) new HyperStackConverter().shuffle(imp, HyperStackConverter.ZCT); int stackSize = stack.getSize(); if (nChannels>1 && (stackSize%nChannels)==0) {