public void run(String arg) { if (arg.equals("new")) {newHyperStack(); return;} ImagePlus imp = IJ.getImage(); if (arg.equals("stacktohs")) convertStackToHS(imp); else if (arg.equals("hstostack")) convertHSToStack(imp); }
/** Converts the specified stack into a hyperstack with 'c' channels, 'z' slices and 't' frames using the default ordering ("xyczt") and the specified display mode ("composite", "color" or "grayscale"). */ public static ImagePlus toHyperStack(ImagePlus imp, int c, int z, int t, String mode) { return toHyperStack(imp, c, z, t, null, mode); }
(new HyperStackConverter()).shuffle(imp, intOrder); ImagePlus imp2 = imp; int intMode = IJ.COMPOSITE;
IJ.error("HyperStack Converter", "Virtual stacks must by in XYCZT order."); else { shuffle(imp, ordering); ImagePlus imp2 = imp; if (nChannels>1 && imp.getBitDepth()!=24) {
(new HyperStackConverter()).shuffle(imp, intOrder); ImagePlus imp2 = imp; int intMode = IJ.COMPOSITE;
IJ.error("HyperStack Converter", "Virtual stacks must by in XYCZT order."); else { shuffle(imp, ordering); ImagePlus imp2 = imp; if (nChannels>1 && imp.getBitDepth()!=24) {
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 void run(String arg) { if (arg.equals("new")) {newHyperStack(); return;} ImagePlus imp = IJ.getImage(); if (arg.equals("stacktohs")) convertStackToHS(imp); else if (arg.equals("hstostack")) convertHSToStack(imp); }
/** Converts the specified stack into a hyperstack with 'c' channels, 'z' slices and 't' frames using the default ordering ("xyczt") and display mode ("Composite"). */ public static ImagePlus toHyperStack(ImagePlus imp, int c, int z, int t) { return toHyperStack(imp, c, z, t, null, null); }
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; }
/** Converts the specified stack into a hyperstack with 'c' channels, 'z' slices and 't' frames using the default ordering ("xyczt") and display mode ("Composite"). */ public static ImagePlus toHyperStack(ImagePlus imp, int c, int z, int t) { return toHyperStack(imp, c, z, t, null, null); }
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) {
/** Converts the specified stack into a hyperstack with 'c' channels, 'z' slices and 't' frames using the default ordering ("xyczt") and the specified display mode ("composite", "color" or "grayscale"). */ public static ImagePlus toHyperStack(ImagePlus imp, int c, int z, int t, String mode) { return toHyperStack(imp, c, z, t, null, mode); }
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) {
buildImp = HyperStackConverter.toHyperStack(buildImp, finalChannels, finalSlices, finalFrames, "xyztc", "composite"); if (imp.isComposite()) { CompositeImage buildImp2 = new CompositeImage(buildImp, 0);
buildImp = HyperStackConverter.toHyperStack(buildImp, finalChannels, finalSlices, finalFrames, "xyztc", "composite"); if (imp.isComposite()) { CompositeImage buildImp2 = new CompositeImage(buildImp, 0);