public synchronized void setSlice(int index) { if (index == currentSlice) { //no need//updateAndRepaintWindow(); return; } if (index >= 1 && index <= patch.length) { Roi roi = getRoi(); if (null != roi) roi.endPaste(); currentSlice = index; //no need//updateAndRepaintWindow(); } }
public void saveRoi() { if (null != roi) { roi.endPaste(); Rectangle r = roi.getBounds(); if (r.width>0 && r.height>0) { Roi.previousRoi = (Roi)roi.clone(); } } }
public void saveRoi() { Roi roi2 = roi; if (roi2!=null) { roi2.endPaste(); Rectangle r = roi2.getBounds(); if ((r.width>0 || r.height>0)) { Roi.previousRoi = (Roi)roi2.clone(); if (IJ.debugMode) IJ.log("saveRoi: "+roi2); } } }
public void saveRoi() { Roi roi2 = roi; if (roi2!=null) { roi2.endPaste(); Rectangle r = roi2.getBounds(); if ((r.width>0 || r.height>0)) { Roi.previousRoi = (Roi)roi2.clone(); if (IJ.debugMode) IJ.log("saveRoi: "+roi2); } } }
/** Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. */ public void trimProcessor() { ImageProcessor ip2 = ip; if (!locked && ip2!=null) { if (IJ.debugMode) IJ.log(title + ": trimProcessor"); Roi roi2 = getRoi(); if (roi2!=null && roi2.getPasteMode()!=Roi.NOT_PASTING) roi2.endPaste(); ip2.setSnapshotPixels(null); } }
/** Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. */ public void trimProcessor() { ImageProcessor ip2 = ip; if (!locked && ip2!=null) { if (IJ.debugMode) IJ.log(title + ": trimProcessor"); Roi roi2 = getRoi(); if (roi2!=null && roi2.getPasteMode()!=Roi.NOT_PASTING) roi2.endPaste(); ip2.setSnapshotPixels(null); } }
Roi roi2 = imp!=null?imp.getRoi():null; if (roi2!=null) roi2.endPaste(); if (format.indexOf("tif")!=-1) { saveAsTiff(imp, path);
Roi roi2 = imp!=null?imp.getRoi():null; if (roi2!=null) roi2.endPaste(); if (format.indexOf("tif")!=-1) { saveAsTiff(imp, path);
ImageProcessor setup(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi!=null) roi.endPaste(); ImageProcessor ip = imp.getProcessor(); int type = imp.getType(); int slice = imp.getCurrentSlice(); RGBImage = type==ImagePlus.COLOR_RGB; if (imp.getID()!=previousImageID || type!=previousType || slice!=previousSlice) setupNewImage(imp, ip); previousImageID = imp.getID(); previousType = type; previousSlice = slice; return ip; }
ImageProcessor setup(ImagePlus imp) { Roi roi = imp.getRoi(); if (roi!=null) roi.endPaste(); ImageProcessor ip = imp.getProcessor(); int type = imp.getType(); int slice = imp.getCurrentSlice(); RGBImage = type==ImagePlus.COLOR_RGB; if (imp.getID()!=previousImageID || type!=previousType || slice!=previousSlice) setupNewImage(imp, ip); previousImageID = imp.getID(); previousType = type; previousSlice = slice; return ip; }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
/** Draws the selection outline on the specified ImageProcessor. @see ij.process.ImageProcessor#setColor @see ij.process.ImageProcessor#setLineWidth */ public void drawPixels(ImageProcessor ip) { endPaste(); int saveWidth = ip.getLineWidth(); if (getStrokeWidth()>1f) ip.setLineWidth((int)Math.round(getStrokeWidth())); if (cornerDiameter>0) drawRoundedRect(ip); else { if (ip.getLineWidth()==1) ip.drawRect(x, y, width+1, height+1); else ip.drawRect(x, y, width, height); } ip.setLineWidth(saveWidth); if (Line.getWidth()>1 || getStrokeWidth()>1) updateFullWindow = true; }
if (imp != null) { roi = imp.getRoi(); if (roi!=null) roi.endPaste(); // prepare the image: finish previous paste operation (if any) if (!imp.lock()) return; // exit if image is in use
roi.endPaste(); saveRoi = (Roi)roi.clone();
roi.endPaste(); saveRoi = (Roi)roi.clone();
public void run(String arg) { ImagePlus imp = IJ.getImage(); stackSize = imp.getStackSize(); imp.trimProcessor(); if (!showDialog(imp)) return; Roi roi = imp.getRoi(); if (roi!=null) roi.endPaste(); if (stackSize==1) Undo.setup(Undo.TRANSFORM, imp); else Undo.reset(); if (equalize) equalize(imp); else stretchHistogram(imp, saturated); if (normalize) { ImageProcessor ip = imp.getProcessor(); ip.setMinAndMax(0,ip.getBitDepth()==32?1.0:ip.maxValue()); } imp.updateAndDraw(); }
public void run(String arg) { ImagePlus imp = IJ.getImage(); stackSize = imp.getStackSize(); imp.trimProcessor(); if (!showDialog(imp)) return; Roi roi = imp.getRoi(); if (roi!=null) roi.endPaste(); if (stackSize==1) Undo.setup(Undo.TRANSFORM, imp); else Undo.reset(); if (equalize) equalize(imp); else stretchHistogram(imp, saturated); if (normalize) { ImageProcessor ip = imp.getProcessor(); ip.setMinAndMax(0,ip.getBitDepth()==32?1.0:ip.maxValue()); } imp.updateAndDraw(); }
Roi roi = getRoi(); if (roi!=null) roi.endPaste(); if (isProcessor()) stack.setPixels(ip.getPixels(),currentSlice);
Roi roi = getRoi(); if (roi!=null) roi.endPaste(); if (isProcessor()) stack.setPixels(ip.getPixels(),currentSlice);