void setCalibration() { Calibration cal = imp.getCalibration(); float[] cTable = cal.getFunction()==Calibration.NONE ? null : cal.getCTable(); ImageProcessor ip = imp.getProcessor(); if (ip != null) ip.setCalibrationTable(cTable); if (ip instanceof FloatProcessor || cTable != null) { float[] data = (ip instanceof FloatProcessor) ? (float[])ip.getPixels() : cTable; double[] minmax = Tools.getMinMax(data); double maxDataValue = Math.max(Math.abs(minmax[0]), Math.abs(minmax[1])); digits = (int)(6-Math.log(maxDataValue)/Math.log(10)); if (maxDataValue==0.0) digits = 6; expMode = digits<-1 || digits>7; if (Math.min(minmax[0], minmax[1]) < 0) digits--; //more space needed for minus sign } else { digits = 2; expMode = false; } }
void setCalibration() { Calibration cal = imp.getCalibration(); float[] cTable = cal.getFunction()==Calibration.NONE ? null : cal.getCTable(); ImageProcessor ip = imp.getProcessor(); if (ip != null) ip.setCalibrationTable(cTable); if (ip instanceof FloatProcessor || cTable != null) { float[] data = (ip instanceof FloatProcessor) ? (float[])ip.getPixels() : cTable; double[] minmax = Tools.getMinMax(data); double maxDataValue = Math.max(Math.abs(minmax[0]), Math.abs(minmax[1])); digits = (int)(6-Math.log(maxDataValue)/Math.log(10)); if (maxDataValue==0.0) digits = 6; expMode = digits<-1 || digits>7; if (Math.min(minmax[0], minmax[1]) < 0) digits--; //more space needed for minus sign } else { digits = 2; expMode = false; } }
boolean calibrated = cal!=null && cal.calibrated(); if (calibrated) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null);
boolean calibrated = cal!=null && cal.calibrated(); if (calibrated) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null);
private void showcoords() { final StringBuffer sb = new StringBuffer(); final Calibration cal = mtrackj.image().getCalibration(); final boolean showcal = mtrackj.settings().showcalibrated; sb.append("x=" + (showcal ? mtrackj.d2s(curpos.x*cal.pixelWidth) : mtrackj.d2s(curpos.x))); sb.append(", y=" + (showcal ? mtrackj.d2s(curpos.y*cal.pixelHeight) : mtrackj.d2s(curpos.y))); if (mtrackj.doslices()) sb.append(", z=" + (showcal ? mtrackj.d2s((curpos.z-1)*cal.pixelDepth) : mtrackj.d2s(curpos.z))); if (mtrackj.doframes()) sb.append(", t=" + (showcal ? mtrackj.d2s((curpos.t-1)*cal.frameInterval) : mtrackj.d2s(curpos.t))); if (mtrackj.dochannels()) sb.append(", c=" + mtrackj.d2s(curpos.c)); final ImageProcessor ip = mtrackj.image().getProcessor(); ip.setCalibrationTable(showcal?cal.getCTable():null); sb.append(", I=" + mtrackj.d2s(mtrackj.value(ip,curpos.x,curpos.y))); if (mode == CLUSTER && activecluster != null) sb.append(", AC=" + activecluster.id()); if (hilicluster != null) sb.append(", C=" + hilicluster.id()); else if (hilitrack != null) sb.append(", C=" + hilitrack.cluster().id() + ", T=" + hilitrack.id()); else if (hilipoint != null) sb.append(", C=" + hilipoint.track().cluster().id() + ", T=" + hilipoint.track().id() + ", P=" + hilipoint.id()); mtrackj.status(sb.toString()); }
label = stack1.getSliceLabel(1); ip1 = stack1.getProcessor(1); ip1.setCalibrationTable(cal.getCTable()); ip2 = ip1.convertToFloat(); stack1.deleteSlice(1);
label = stack1.getSliceLabel(1); ip1 = stack1.getProcessor(1); ip1.setCalibrationTable(cal.getCTable()); ip2 = ip1.convertToFloat(); stack1.deleteSlice(1);
/** Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated. */ public ImageProcessor getProcessor() { if (ip==null) return null; if (roi!=null && roi.isArea()) ip.setRoi(roi.getBounds()); else ip.resetRoi(); if (!compositeImage) ip.setLineWidth(Line.getWidth()); if (ij!=null) ip.setProgressBar(ij.getProgressBar()); Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null); if (Recorder.record) { Recorder recorder = Recorder.getInstance(); if (recorder!=null) recorder.imageUpdated(this); } return ip; }
/** Returns a reference to the current ImageProcessor. If there is no ImageProcessor, it creates one. Returns null if this ImagePlus contains no ImageProcessor and no AWT Image. Sets the line width to the current line width and sets the calibration table if the image is density calibrated. */ public ImageProcessor getProcessor() { if (ip==null) return null; if (roi!=null && roi.isArea()) ip.setRoi(roi.getBounds()); else ip.resetRoi(); if (!compositeImage) ip.setLineWidth(Line.getWidth()); if (ij!=null) ip.setProgressBar(ij.getProgressBar()); Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null); if (Recorder.record) { Recorder recorder = Recorder.getInstance(); if (recorder!=null) recorder.imageUpdated(this); } return ip; }
float[] cTable = cal!=null?cal.getCTable():null; if (cTable!=null) getCalibratedStatistics(minThreshold,maxThreshold,cTable);
float[] cTable = cal!=null?cal.getCTable():null; if (cTable!=null) getCalibratedStatistics(minThreshold,maxThreshold,cTable);
Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null);
Calibration cal = getCalibration(); if (cal.calibrated()) ip.setCalibrationTable(cal.getCTable()); else ip.setCalibrationTable(null);
maxThreshold = hist.length-1; histogram16 = hist; float[] cTable = cal!=null?cal.getCTable():null; getRawMinAndMax(hist, minThreshold, maxThreshold); histMin = min;
maxThreshold = hist.length-1; histogram16 = hist; float[] cTable = cal!=null?cal.getCTable():null; getRawMinAndMax(hist, minThreshold, maxThreshold); histMin = min;
return; int xmin,xmax,range; float[] ctable = cal.getCTable(); if (ctable.length==256) { //8-bit image xmin = 0;
return; int xmin,xmax,range; float[] ctable = cal.getCTable(); if (ctable.length==256) { //8-bit image xmin = 0;
ImageProcessor ip2 = ip1.crop(); if (floatResult) { ip2.setCalibrationTable(cal.getCTable()); ip2 = ip2.convertToFloat();
ImageProcessor ip2 = ip1.crop(); if (floatResult) { ip2.setCalibrationTable(cal.getCTable()); ip2 = ip2.convertToFloat();
ImageProcessor ip2 = ip1.crop(); if (floatResult) { ip2.setCalibrationTable(cal.getCTable()); ip2 = ip2.convertToFloat();