/** Performs actual projection using specified method. If handleOverlay, adds stack overlay elements from startSlice to stopSlice to projection. */ public void doProjection(boolean handleOverlay) { if (isHyperstack) doHyperStackProjection(allTimeFrames); else if (imp.getType()==ImagePlus.COLOR_RGB) doRGBProjection(handleOverlay); else { doProjection(); Overlay overlay = imp.getOverlay(); if (handleOverlay && overlay!=null) projImage.setOverlay(projectStackRois(overlay)); } if (projImage!=null) projImage.setCalibration(imp.getCalibration()); }
/** Performs actual projection using specified method. If handleOverlay, adds stack overlay elements from startSlice to stopSlice to projection. */ public void doProjection(boolean handleOverlay) { if (isHyperstack) doHyperStackProjection(allTimeFrames); else if (imp.getType()==ImagePlus.COLOR_RGB) doRGBProjection(handleOverlay); else { doProjection(); Overlay overlay = imp.getOverlay(); if (handleOverlay && overlay!=null) projImage.setOverlay(projectStackRois(overlay)); } if (projImage!=null) projImage.setCalibration(imp.getCalibration()); }
private ImageProcessor projImp() { ImageProcessor ip; final ZProjector zp = new ZProjector(imp); zp.setMethod(ZProjector.MAX_METHOD); zp.setStartSlice(minZ); zp.setStopSlice(maxZ); if (imp.isComposite()) { zp.doHyperStackProjection(false); final ImagePlus projImp = zp.getProjection(); projImp.setC(channel); ip = projImp.getChannelProcessor(); } else { zp.doProjection(); ip = zp.getProjection().getProcessor(); } return ip; }
public ImagePlus groupZProject(ImagePlus imp, int method, int groupSize) { if (method<0 || method>=ZProjector.METHODS.length) return null; int[] dim = imp.getDimensions(); int projectedStackSize = imp.getStackSize()/groupSize; imp.setDimensions(1, groupSize, projectedStackSize); ZProjector zp = new ZProjector(imp); zp.setMethod(method); zp.setStartSlice(1); zp.setStopSlice(groupSize); zp.doHyperStackProjection(true); imp.setDimensions(dim[2], dim[3], dim[4]); ImagePlus zProjectorOutput = zp.getProjection(); int[] zProjectDim = zProjectorOutput.getDimensions(); for (int i=2; i<dim.length; i++) { if (dim[i] != 1) zProjectDim[i] = projectedStackSize; else zProjectDim[i] = 1; } // Fix dimensions for output ImagePlus zProjectorOutput.setDimensions(zProjectDim[2], zProjectDim[3], zProjectDim[4]); return zProjectorOutput; }
public ImagePlus groupZProject(ImagePlus imp, int method, int groupSize) { if (method<0 || method>=ZProjector.METHODS.length) return null; int[] dim = imp.getDimensions(); int projectedStackSize = imp.getStackSize()/groupSize; imp.setDimensions(1, groupSize, projectedStackSize); ZProjector zp = new ZProjector(imp); zp.setMethod(method); zp.setStartSlice(1); zp.setStopSlice(groupSize); zp.doHyperStackProjection(true); imp.setDimensions(dim[2], dim[3], dim[4]); ImagePlus zProjectorOutput = zp.getProjection(); int[] zProjectDim = zProjectorOutput.getDimensions(); for (int i=2; i<dim.length; i++) { if (dim[i] != 1) zProjectDim[i] = projectedStackSize; else zProjectDim[i] = 1; } // Fix dimensions for output ImagePlus zProjectorOutput.setDimensions(zProjectDim[2], zProjectDim[3], zProjectDim[4]); return zProjectorOutput; }