public ImagePlus getLabelImagePlus(){ return (ImagePlus) data.getProperty(LABEL_IMAGE_PLUS); } public void setLabelImagePlus(ImagePlus ip){
public SegmentationViewerCanvas getLabelCanvas(){ return (SegmentationViewerCanvas) data.getProperty(LABEL_CANVAS); } public void setLabelCanvas(SegmentationViewerCanvas canvas){
/** Returns the "Info" property string, or null if it is not found. */ public String getInfoProperty() { String info = null; Object obj = getProperty("Info"); if (obj!=null && (obj instanceof String)) { info = (String)obj; if (info.length()==0) info = null; } return info; }
final public static boolean isAmiraLabelfield(ImagePlus imp) { Object info1 = imp.getProperty("Info"); if (info1 == null || !(info1 instanceof String)) return false; String info = (String)info1; return (info.indexOf("Materials") >= 0); }
public static boolean isAmiraMesh(ImagePlus imp) { Object info1 = imp.getProperty("Info"); if (info1 == null || !(info1 instanceof String)) return false; String info = (String)info1; return (info.indexOf("CoordType") >= 0); }
/** Returns the "Info" property string, or null if it is not found. */ public String getInfoProperty() { String info = null; Object obj = getProperty("Info"); if (obj!=null && (obj instanceof String)) { info = (String)obj; if (info.length()==0) info = null; } return info; }
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 AmiraParameters(ImagePlus imp) { parameters=new Properties(); if (isAmiraMesh(imp) || (imp.getProperty(INFO)!=null)) { line = "Parameters {\n" + (String)imp.getProperty(INFO) + "}\n"; parseParameters(parameters); } initializeMaterials(); initDefaults(imp); }
public SliceWatcher(ImagePlus data){ this.data=data; if(data.getProperty(MONITOR_LOC) == null){ data.setProperty(MONITOR_LOC, new SliceMonitor(data)); } }
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 RoiWatcher(ImagePlus data){ this.data=data; if(data.getProperty(MONITOR_LOC) == null){ data.setProperty(MONITOR_LOC, new RoiMonitor(data)); } }
public int setup(String arg, ImagePlus imp) { this.imp = imp; if (imp==null) {IJ.noImage(); return DONE;} stackSize = imp.getStackSize(); if (imp.getProperty("FHT")!=null) { IJ.error("FFT Custom Filter", "Spatial domain (non-FFT) image required"); return DONE; } else return processStack?DOES_ALL+DOES_STACKS:DOES_ALL; }
ImageStack unpad(ImageStack stack) { Object w = imp.getProperty("FFT width"); Object h = imp.getProperty("FFT height"); if (w==null || h==null) return stack; int width = (int)Tools.parseDouble((String)w, 0.0); int height = (int)Tools.parseDouble((String)h, 0.0); if (width==0 || height==0 || (width==stack.getWidth()&&height==stack.getHeight())) return stack; StackProcessor sp = new StackProcessor(stack, null); ImageStack stack2 = sp.crop(0, 0, width, height); return stack2; }
void redisplayPowerSpectrum() { FHT fht = (FHT)imp.getProperty("FHT"); if (fht==null) {IJ.error("FFT", "Frequency domain image required"); return;} ImageProcessor ps = fht.getPowerSpectrum(); imp.setProcessor(null, ps); }
ImageStack unpad(ImageStack stack) { Object w = imp.getProperty("FFT width"); Object h = imp.getProperty("FFT height"); if (w==null || h==null) return stack; int width = (int)Tools.parseDouble((String)w, 0.0); int height = (int)Tools.parseDouble((String)h, 0.0); if (width==0 || height==0 || (width==stack.getWidth()&&height==stack.getHeight())) return stack; StackProcessor sp = new StackProcessor(stack, null); ImageStack stack2 = sp.crop(0, 0, width, height); return stack2; }
public int setup(String arg, ImagePlus imp) { this.imp = imp; if (imp==null) {IJ.noImage(); return DONE;} stackSize = imp.getStackSize(); if (imp.getProperty("FHT")!=null) { IJ.error("FFT Custom Filter", "Spatial domain (non-FFT) image required"); return DONE; } else return processStack?DOES_ALL+DOES_STACKS:DOES_ALL; }
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(); }
/** Returns the value (as a string) of the specified DICOM tag id (in the form "0018,0050") of the specified image or stack slice. Returns null if the tag id is not found. */ public static String getTag(ImagePlus imp, String id) { String metadata = null; if (imp.getStackSize()>1) { ImageStack stack = imp.getStack(); String label = stack.getSliceLabel(imp.getCurrentSlice()); if (label!=null && label.indexOf('\n')>0) metadata = label; } if (metadata==null) metadata = (String)imp.getProperty("Info"); return getTag(metadata, id); }
/** Returns the value (as a string) of the specified DICOM tag id (in the form "0018,0050") of the specified image or stack slice. Returns null if the tag id is not found. */ public static String getTag(ImagePlus imp, String id) { String metadata = null; if (imp.getStackSize()>1) { ImageStack stack = imp.getStack(); String label = stack.getSliceLabel(imp.getCurrentSlice()); if (label!=null && label.indexOf('\n')>0) metadata = label; } if (metadata==null) metadata = (String)imp.getProperty("Info"); return getTag(metadata, id); }
private boolean isThresholdedRGB(ImagePlus imp) { Object obj = imp.getProperty("Mask"); if (obj==null || !(obj instanceof ImageProcessor)) return false; ImageProcessor mask = (ImageProcessor)obj; return mask.getWidth()==imp.getWidth() && mask.getHeight()==imp.getHeight(); }