MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getValue

Method getValue

ij/src/main/java/ij/IJ.java:771–797  ·  view source on GitHub ↗

Returns a measurement result, where 'measurement' is "Area", "Mean", "StdDev", "Mode", "Min", "Max", "X", "Y", "XM", "YM", "Perim.", "BX", "BY", "Width", "Height", "Major", "Minor", "Angle", "Circ.", "Feret", "IntDen", "Median", "Skew", "Kurt", "%Area", "RawIntDen", "Ch", "Slice", "Frame", "FeretX",

(ImagePlus imp, String measurement)

Source from the content-addressed store, hash-verified

769 * the "limit to threshold" option.
770 */
771 public static double getValue(ImagePlus imp, String measurement) {
772 String options = "";
773 int index = measurement.indexOf(" ");
774 if (index>0) {
775 if (index<measurement.length()-1)
776 options = measurement.substring(index+1, measurement.length());
777 measurement = measurement.substring(0, index);
778 }
779 int measurements = Measurements.ALL_STATS + Measurements.SLICE;
780 if (options.contains("limit"))
781 measurements += Measurements.LIMIT;
782 Calibration cal = null;
783 if (options.contains("raw")) {
784 cal = imp.getCalibration();
785 imp.setCalibration(null);
786 }
787 ResultsTable rt = new ResultsTable();
788 Analyzer analyzer = new Analyzer(imp, measurements, rt);
789 analyzer.measure();
790 double value = Double.NaN;
791 try {
792 value = rt.getValue(measurement, 0);
793 } catch (Exception e) {};
794 if (cal!=null)
795 imp.setCalibration(cal);
796 return value;
797 }
798
799 /** Returns a reference to the "Results" window TextPanel.
800 Opens the "Results" window if it is currently not open.

Callers 1

getValueMethod · 0.95

Calls 8

measureMethod · 0.95
getValueMethod · 0.95
substringMethod · 0.80
getCalibrationMethod · 0.80
lengthMethod · 0.65
indexOfMethod · 0.45
containsMethod · 0.45
setCalibrationMethod · 0.45

Tested by

no test coverage detected