/** Restore image outside non-rectangular roi. */ void doMasking(ImagePlus imp, ImageProcessor ip) { ImageProcessor mask = imp.getMask(); if (mask!=null) ip.reset(mask); }
/** Restore image outside non-rectangular roi. */ void doMasking(ImagePlus imp, ImageProcessor ip) { ImageProcessor mask = imp.getMask(); if (mask!=null) ip.reset(mask); }
ImageProcessor makeMask(ImageProcessor ip, Rectangle r, ImagePlus imp) { ImageProcessor mask = imp.getMask(); if (mask==null) { mask = new ByteProcessor(r.width, r.height); mask.invert(); } else { // duplicate mask (needed because getMask caches masks) mask = mask.duplicate(); } mask.invert(); return mask; }
/** Restore image outside non-rectangular roi. */ void doMasking(ImagePlus imp, ImageProcessor ip) { ImageProcessor mask = imp.getMask(); if (mask!=null) { Rectangle r = ip.getRoi(); if (mask.getWidth()!=r.width||mask.getHeight()!=r.height) { ip.setRoi(imp.getRoi()); mask = ip.getMask(); } ip.reset(mask); } }
/** Displays a histogram using the title "Histogram of ImageName". */ public ColorHistogramWindow(ImagePlus imp) { super(NewImage.createRGBImage("Histogram of "+imp.getShortTitle(), WIN_WIDTH, WIN_HEIGHT, 1, NewImage.FILL_WHITE)); ImageProcessor ipmask = imp.getMask(); boolean isnull=(ipmask==null); mask=(!isnull)?(byte[])ipmask.getPixels():null; width=imp.getWidth(); height=imp.getHeight(); showHistogram(imp, nBins, 0.0, 0.0); printResults(); }
/** Restore image outside non-rectangular roi. */ void doMasking(ImagePlus imp, ImageProcessor ip) { ImageProcessor mask = imp.getMask(); if (mask!=null) { Rectangle r = ip.getRoi(); if (mask.getWidth()!=r.width||mask.getHeight()!=r.height) { ip.setRoi(imp.getRoi()); mask = ip.getMask(); } ip.reset(mask); } }
void updatePaste() { if (clipboard!=null) { imp.getMask(); ImageProcessor ip = imp.getProcessor(); ip.reset(); int xoffset=0, yoffset=0; Roi croi = clipboard.getRoi(); if (croi!=null) { Rectangle r = croi.getBounds(); if (r.x<0) xoffset=-r.x; if (r.y<0) yoffset=-r.y; } ip.copyBits(clipboard.getProcessor(), x+xoffset, y+yoffset, pasteMode); if (type!=RECTANGLE) ip.reset(ip.getMask()); if (ic!=null) ic.setImageUpdated(); } }
void updatePaste() { if (clipboard!=null) { imp.getMask(); ImageProcessor ip = imp.getProcessor(); ip.reset(); int xoffset=0, yoffset=0; Roi croi = clipboard.getRoi(); if (croi!=null) { Rectangle r = croi.getBounds(); if (r.x<0) xoffset=-r.x; if (r.y<0) yoffset=-r.y; } ip.copyBits(clipboard.getProcessor(), x+xoffset, y+yoffset, pasteMode); if (type!=RECTANGLE) ip.reset(ip.getMask()); if (ic!=null) ic.setImageUpdated(); } }
/** prepare an ImageProcessor by setting roi and CalibrationTable. */ private void prepareProcessor(ImageProcessor ip, ImagePlus imp) { ImageProcessor mask = imp.getMask(); Roi roi = imp.getRoi(); if (roi!=null && roi.isArea()) ip.setRoi(roi); else ip.setRoi((Roi)null); if (imp.getStackSize()>1) { ImageProcessor ip2 = imp.getProcessor(); double min1 = ip2.getMinThreshold(); double max1 = ip2.getMaxThreshold(); double min2 = ip.getMinThreshold(); double max2 = ip.getMaxThreshold(); if (min1!=ImageProcessor.NO_THRESHOLD && (min1!=min2||max1!=max2)) ip.setThreshold(min1, max1, ImageProcessor.NO_LUT_UPDATE); } //float[] cTable = imp.getCalibration().getCTable(); //ip.setCalibrationTable(cTable); }
/** prepare an ImageProcessor by setting roi and CalibrationTable. */ private void prepareProcessor(ImageProcessor ip, ImagePlus imp) { ImageProcessor mask = imp.getMask(); Roi roi = imp.getRoi(); if (roi!=null && roi.isArea()) ip.setRoi(roi); else ip.setRoi((Roi)null); if (imp.getStackSize()>1) { ImageProcessor ip2 = imp.getProcessor(); double min1 = ip2.getMinThreshold(); double max1 = ip2.getMaxThreshold(); double min2 = ip.getMinThreshold(); double max2 = ip.getMaxThreshold(); if (min1!=ImageProcessor.NO_THRESHOLD && (min1!=min2||max1!=max2)) ip.setThreshold(min1, max1, ImageProcessor.NO_LUT_UPDATE); } //float[] cTable = imp.getCalibration().getCTable(); //ip.setCalibrationTable(cTable); }
cal = imp.getCalibration(); boolean limitToThreshold = (Analyzer.getMeasurements() & LIMIT) != 0; imp.getMask(); histogram = stats.histogram; if(limitToThreshold && histogram.length == 256) {
cal = imp.getCalibration(); boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; imp.getMask(); histogram = stats.getHistogram(); if (limitToThreshold && histogram.length==256) {
cal = imp.getCalibration(); boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; imp.getMask(); histogram = stats.getHistogram(); if (limitToThreshold && histogram.length==256) {
"NOTE: There is no Undo for this operation.")) return; ImageProcessor mask = imp.getMask(); Rectangle roi = imp.getRoi()!=null?imp.getRoi().getBounds():null; ImageStack stack = imp.getStack();
"NOTE: There is no Undo for this operation.")) return; ImageProcessor mask = imp.getMask(); Rectangle roi = imp.getRoi()!=null?imp.getRoi().getBounds():null; ImageStack stack = imp.getStack();
ip.fill(); if (roi!=null && roi.getType()!=Roi.RECTANGLE) { getMask(); ip.reset(ip.getMask()); } setColor(Toolbar.getForegroundColor());
ip.fill(); if (roi!=null && roi.getType()!=Roi.RECTANGLE) { getMask(); ip.reset(ip.getMask()); } setColor(Toolbar.getForegroundColor());
table[i] = (int)(((double)(i-min)/(max-min))*range); ImageProcessor mask = imp.getMask(); if (imp.getStackSize()>1) { ImageStack stack = imp.getStack();
table[i] = (int)(((double)(i-min)/(max-min))*range); ImageProcessor mask = imp.getMask(); if (imp.getStackSize()>1) { ImageStack stack = imp.getStack();
ImageProcessor mask = imp.getMask(); for (int i=1; i<=imp.getStackSize(); i++) { imp.setSlice(i);