/** Releases the ImageProcessor and ImagePlus associated with the plot. * May help garbage collection because some garbage collectors * are said to be inefficient with circular references. */ public void dispose() { if (imp != null) imp.setProperty(PROPERTY_KEY, null); imp = null; ip = null; }
/** Releases the ImageProcessor and ImagePlus associated with the plot. * May help garbage collection because some garbage collectors * are said to be inefficient with circular references. */ public void dispose() { if (imp != null) imp.setProperty(PROPERTY_KEY, null); imp = null; ip = null; }
public void setLabelCanvas(SegmentationViewerCanvas canvas){ data.setProperty(LABEL_CANVAS, canvas); }
public void setCurrentMaterial(AmiraParameters.Material currentMaterial) { data.setProperty(CURRENT_MATERIAL, currentMaterial); }
public void setLabelImagePlus(ImagePlus ip){ data.setProperty(LABEL_IMAGE_PLUS, ip); }
private static void saveLUTs(ImagePlus imp, List<LUT> luts) { // NB: Save individual planar LUTs as properties, for later access. // This step is necessary because ImageStack.addSlice only extracts the // pixels from the ImageProcessor, and does not preserve the ColorModel. // Later, Colorizer can use the LUTs when wrapping into a CompositeImage. for (int i=0; i<luts.size(); i++) { final LUT lut = luts.get(i); if (lut != null) { imp.setProperty(PROP_LUT + i, lut); } } }
private static void saveLUTs(ImagePlus imp, List<LUT> luts) { // NB: Save individual planar LUTs as properties, for later access. // This step is necessary because ImageStack.addSlice only extracts the // pixels from the ImageProcessor, and does not preserve the ColorModel. // Later, Colorizer can use the LUTs when wrapping into a CompositeImage. for (int i=0; i<luts.size(); i++) { final LUT lut = luts.get(i); if (lut != null) { imp.setProperty(PROP_LUT + i, lut); } } }
private static void addInfo(final ImagePlus imp, String newInfo) { final String info = (String) imp.getProperty("Info"); if (info != null) newInfo = info + newInfo; imp.setProperty("Info", newInfo + "\n"); }
public static void attachResultsTable() { final ResultsTable results = ResultsTable.getResultsTable(); if (results == null) return; final ImagePlus activeImage = IJ.getImage(); if (activeImage == null) return; activeImage.setProperty("tables", Collections.singletonList(results)); } }
private synchronized void setStackNull() { if (oneSliceStack && stack!=null && stack.size()>0) { String label = stack.getSliceLabel(1); setProperty("Label", label); } stack = null; oneSliceStack = false; }
private static void fillInfo(final ImagePlus imp, final MetaTable table) { String info = (String) imp.getProperty("Info"); if (info == null) info = ""; List<String> keySet = new ArrayList<>(table.keySet()); Collections.sort(keySet); for (final String key : keySet) { info += key + " = " + table.get(key) + "\n"; } imp.setProperty("Info", info); }
public SliceWatcher(ImagePlus data){ this.data=data; if(data.getProperty(MONITOR_LOC) == null){ data.setProperty(MONITOR_LOC, new SliceMonitor(data)); } }
private synchronized void setStackNull() { if (oneSliceStack && stack!=null && stack.size()>0) { String label = stack.getSliceLabel(1); setProperty("Label", label); } stack = null; oneSliceStack = false; }
public RoiWatcher(ImagePlus data){ this.data=data; if(data.getProperty(MONITOR_LOC) == null){ data.setProperty(MONITOR_LOC, new RoiMonitor(data)); } }
public void setProperty(String key, Object value) { ImagePlus imp = patch[currentSlice-1].getProject().getLoader().fetchImagePlus(patch[currentSlice-1]); imp.setProperty(key, value); patch[currentSlice-1].updateInDatabase("tiff_working"); // TODO same as above, may be too much saving //patch[currentSlice-1].getProject().getLoader().vacuum(); }
private ImagePlus openFFT(ImagePlus imp) { ImageProcessor ip = imp.getProcessor(); FHT fht = new FHT(ip, true); ImageProcessor ps = fht.getPowerSpectrum(); ImagePlus imp2 = new ImagePlus(imp.getTitle(), ps); imp2.setProperty("FHT", fht); imp2.setProperty("Info", imp.getInfoProperty()); fht.originalWidth = (int)imp2.getNumericProperty("width"); fht.originalHeight = (int)imp2.getNumericProperty("height"); fht.originalBitDepth = (int)imp2.getNumericProperty("bitdepth"); fht.originalColorModel = ip.getColorModel(); imp2.setCalibration(imp.getCalibration()); return imp2; }
private ImagePlus openFFT(ImagePlus imp) { ImageProcessor ip = imp.getProcessor(); FHT fht = new FHT(ip, true); ImageProcessor ps = fht.getPowerSpectrum(); ImagePlus imp2 = new ImagePlus(imp.getTitle(), ps); imp2.setProperty("FHT", fht); imp2.setProperty("Info", imp.getInfoProperty()); fht.originalWidth = (int)imp2.getNumericProperty("width"); fht.originalHeight = (int)imp2.getNumericProperty("height"); fht.originalBitDepth = (int)imp2.getNumericProperty("bitdepth"); fht.originalColorModel = ip.getColorModel(); imp2.setCalibration(imp.getCalibration()); return imp2; }
void copyToInfo() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) { IJ.noImage(); return; } int start = ta.getSelectionStart(); int end = ta.getSelectionEnd(); String text; if (start==end) text = ta.getText(); else text = ta.getSelectedText(); imp.setProperty("Info", text); }
private void setupFFTSave() { Object obj = imp.getProperty("FHT"); if (obj==null) return; FHT fht = (obj instanceof FHT)?(FHT)obj:null; if (fht==null) return; if (fht.originalColorModel!=null && fht.originalBitDepth!=24) fht.setColorModel(fht.originalColorModel); ImagePlus imp2 = new ImagePlus(imp.getTitle(), fht); imp2.setProperty("Info", imp.getProperty("Info")); imp2.setCalibration(imp.getCalibration()); imp = imp2; fi = imp.getFileInfo(); }
private void setupFFTSave() { Object obj = imp.getProperty("FHT"); if (obj==null) return; FHT fht = (obj instanceof FHT)?(FHT)obj:null; if (fht==null) return; if (fht.originalColorModel!=null && fht.originalBitDepth!=24) fht.setColorModel(fht.originalColorModel); ImagePlus imp2 = new ImagePlus(imp.getTitle(), fht); imp2.setProperty("Info", imp.getProperty("Info")); imp2.setCalibration(imp.getCalibration()); imp = imp2; fi = imp.getFileInfo(); }