final ImagePlus black = new ImagePlus("black", new ByteProcessor(tileSide, tileSide)); saver.save(black, path); black.flush(); } else { try {
public static void flush(ImagePlus imp) { if (null == imp) return; imp.flush(); if (null != imp.getProcessor() && null != imp.getProcessor().getPixels()) { imp.getProcessor().setPixels(null); } }
super.flush(); if (locked) return;
@Override public void run(final ImageProcessor ip) { final String title = stripExtension(imp.getTitle()); imp.unlock(); if (!getScale()) return; if (inverse) { IJ.run("Geometry to Distance Map", "threshold=" + thresh + " inverse"); } else { IJ.run("Geometry to Distance Map", "threshold=" + thresh); } final ImagePlus impDM = WindowManager.getCurrentImage(); IJ.run("Distance Map to Distance Ridge"); final ImagePlus impDR = WindowManager.getCurrentImage(); impDM.hide(); impDM.flush(); WindowManager.setTempCurrentImage(impDR); IJ.run("Distance Ridge to Local Thickness"); final ImagePlus impLT = WindowManager.getCurrentImage(); impDR.hide(); impDR.flush(); IJ.run("Local Thickness to Cleaned-Up Local Thickness"); final ImagePlus impLTC = WindowManager.getCurrentImage(); impLT.hide(); impLT.flush(); impLTC.setTitle(title + "_LocThk"); IJ.showProgress(1.0); IJ.showStatus("Done"); }
final int imageWidth = imgTmp.getWidth(), imageHeight=imgTmp.getHeight(); imgTmp.flush();
ImagePlus imp = new ImagePlus(path.substring(path.lastIndexOf("/")), ip); saver.save(imp, path); imp.flush(); ip = null; imp = null;
public void run() { ImagePlus imp = null; if (srcRect.width > 0 && srcRect.height > 0) { imp = layer.getProject().getLoader().getFlatImage(layer, srcRect, mag, c_alphas, type, clazz, null, true); // with quality // First cheap check on bounding boxes only, if it fails, check if anything actually was painted if (skip_empty_tiles && (layer.find(srcRect, true).isEmpty() || isEmptyTile(imp.getProcessor()))) return; } else { // Make empty black tile if (skip_empty_tiles) return; imp = new ImagePlus("", new ByteProcessor(tileWidth, tileHeight)); // black tile } // correct dimensions of cropped tiles, padding the outside with black if (padding && (imp.getWidth() < tileWidth || imp.getHeight() < tileHeight)) { final ImagePlus imp2 = new ImagePlus(imp.getTitle(), imp.getProcessor().createProcessor(tileWidth, tileHeight)); // ensure black background for color images if (imp2.getType() == ImagePlus.COLOR_RGB) { final Roi roi = new Roi(0, 0, tileWidth, tileHeight); imp2.setRoi(roi); imp2.getProcessor().setValue(0); // black imp2.getProcessor().fill(); } imp2.getProcessor().insert(imp.getProcessor(), 0, 0); imp.flush(); imp = imp2; } saver.save(imp, file_path); imp.flush(); } };
dispose(); if (imp!=null) imp.flush(); imp = null; return true;
dispose(); if (imp!=null) imp.flush(); imp = null; return true;
yOld=y; zOld=z; ip.flush();