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

Class Analyzer

ij/src/main/java/ij/plugin/filter/Analyzer.java:21–1073  ·  view source on GitHub ↗

This plugin implements ImageJ's Analyze/Measure and Analyze/Set Measurements commands.

Source from the content-addressed store, hash-verified

19
20/** This plugin implements ImageJ's Analyze/Measure and Analyze/Set Measurements commands. */
21public class Analyzer implements PlugInFilter, Measurements {
22
23 private static boolean drawLabels = true;
24 private String arg;
25 private ImagePlus imp;
26 private ResultsTable rt;
27 private int measurements;
28 private StringBuffer min,max,mean,sd;
29 private boolean disableReset;
30 private boolean resultsUpdated;
31
32 // Order must agree with order of checkboxes in Set Measurements dialog box
33 private static final int[] list = {AREA,MEAN,STD_DEV,MODE,MIN_MAX,
34 CENTROID,CENTER_OF_MASS,PERIMETER,RECT,ELLIPSE,SHAPE_DESCRIPTORS, FERET,
35 INTEGRATED_DENSITY,MEDIAN,SKEWNESS,KURTOSIS,AREA_FRACTION,STACK_POSITION,
36 LIMIT,LABELS,INVERT_Y,SCIENTIFIC_NOTATION,ADD_TO_OVERLAY,NaN_EMPTY_CELLS};
37
38 private static final String MEASUREMENTS = "measurements";
39 private static final String MARK_WIDTH = "mark.width";
40 private static final String PRECISION = "precision";
41 //private static int counter;
42 private static boolean unsavedMeasurements;
43 public static Color darkBlue = new Color(0,0,160);
44 private static int systemMeasurements = Prefs.getInt(MEASUREMENTS,AREA+MEAN+MIN_MAX);
45 public static int markWidth;
46 public static int precision = Prefs.getInt(PRECISION,3);
47 private static float[] umeans = new float[MAX_STANDARDS];
48 private static ResultsTable systemRT;
49 private static int redirectTarget;
50 private static String redirectTitle = "";
51 private static ImagePlus redirectImage; // non-displayed images
52 static int firstParticle, lastParticle;
53 private static boolean switchingModes;
54 private static boolean showMin = true;
55 private static boolean showAngle = true;
56
57 static {
58 systemRT = new ResultsTable();
59 systemRT.showRowNumbers(true);
60 }
61
62 public Analyzer() {
63 rt = systemRT;
64 rt.setIsResultsTable(true);
65 rt.showRowNumbers(true);
66 rt.setPrecision((systemMeasurements&SCIENTIFIC_NOTATION)!=0?-precision:precision);
67 rt.setNaNEmptyCells((systemMeasurements&NaN_EMPTY_CELLS)!=0);
68 measurements = systemMeasurements;
69 }
70
71 /** Constructs a new Analyzer using the specified ImagePlus object
72 and the current measurement options and default results table. */
73 public Analyzer(ImagePlus imp) {
74 this();
75 this.imp = imp;
76 }
77
78 /** Construct a new Analyzer using an ImagePlus object and a ResultsTable. */

Callers

nothing calls this directly

Calls 2

getIntMethod · 0.95
showRowNumbersMethod · 0.45

Tested by

no test coverage detected