edu.jhu.tmaj.beans.masks.results
Class Analyzer2

java.lang.Object
  extended by edu.jhu.tmaj.beans.masks.results.Analyzer2
All Implemented Interfaces:
ij.measure.Measurements, ij.plugin.filter.PlugInFilter

public class Analyzer2
extends java.lang.Object
implements ij.plugin.filter.PlugInFilter, ij.measure.Measurements

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


Field Summary
static java.awt.Color darkBlue
           
(package private) static int firstParticle
           
(package private) static int lastParticle
           
static int markWidth
           
static int precision
           
 
Fields inherited from interface ij.plugin.filter.PlugInFilter
CONVERT_TO_FLOAT, DOES_16, DOES_32, DOES_8C, DOES_8G, DOES_ALL, DOES_RGB, DOES_STACKS, DONE, FINAL_PROCESSING, KEEP_THRESHOLD, NO_CHANGES, NO_IMAGE_REQUIRED, NO_UNDO, PARALLELIZE_STACKS, ROI_REQUIRED, SNAPSHOT, STACK_REQUIRED, SUPPORTS_MASKING
 
Fields inherited from interface ij.measure.Measurements
AREA, AREA_FRACTION, CENTER_OF_MASS, CENTROID, CIRCULARITY, ELLIPSE, FERET, INTEGRATED_DENSITY, INVERT_Y, KURTOSIS, LABELS, LIMIT, MAX_STANDARDS, MEAN, MEDIAN, MIN_MAX, MODE, PERIMETER, RECT, SCIENTIFIC_NOTATION, SHAPE_DESCRIPTORS, SKEWNESS, SLICE, STACK_POSITION, STD_DEV
 
Constructor Summary
Analyzer2()
           
Analyzer2(ij.ImagePlus imp)
          Constructs a new Analyzer using the specified ImagePlus object and the current measurement options and default results table.
Analyzer2(ij.ImagePlus imp, int measurements, ij.measure.ResultsTable rt)
          Construct a new Analyzer using an ImagePlus object and private measurement options and results table.
 
Method Summary
 void displayResults()
          Writes the last row in the system results table to the Results window.
(package private)  void doSetDialog()
           
(package private)  double getArea(java.awt.Polygon p)
           
static int getCounter()
          Returns the current measurement count.
(package private)  java.lang.String getFileName()
           
static int getMeasurements()
           
static int getPrecision()
          Returns the number of digits displayed to the right of decimal point.
static ij.ImagePlus getRedirectImage(ij.ImagePlus currentImage)
           
(package private)  ij.process.ImageStatistics getRedirectStats(int measurements, ij.gui.Roi roi)
           
static ij.measure.ResultsTable getResultsTable()
          Returns the default results table.
static float[] getUMeans()
          Returns an array containing the first 20 uncalibrated means.
(package private)  void incrementCounter()
           
static boolean isRedirectImage()
          Returns true if an image is selected in the "Redirect To:" popup menu of the Analyze/Set Measurements dialog box.
 void measure()
          Measures the image or selection and adds the results to the default results table.
(package private)  void measureAngle(ij.gui.Roi roi)
           
(package private)  void measureLength(ij.gui.Roi roi)
           
(package private)  void measurePoint(ij.gui.Roi roi)
           
 java.lang.String n(double n)
          Converts a number to a formatted string with a tab at the end.
(package private)  boolean reset()
           
static boolean resetCounter()
          Sets the measurement counter to zero.
 void run(ij.process.ImageProcessor ip)
           
(package private)  void savePoints(ij.gui.Roi roi)
           
static void savePreferences(java.util.Properties prefs)
          Called once when ImageJ quits.
 void saveResults(ij.process.ImageStatistics stats, ij.gui.Roi roi)
          Saves the measurements specified in the "Set Measurements" dialog, or by calling setMeasurements(), in the default results table.
static void setDefaultHeadings()
          Sets the default headings ("Area", "Mean", etc.).
static void setMeasurement(int option, boolean state)
          Sets the specified system-wide measurement option.
static void setMeasurements(int measurements)
          Sets the system-wide measurement options.
static void setOption(java.lang.String option, boolean b)
           
(package private)  void setOptions(ij.gui.GenericDialog gd)
           
static void setPrecision(int decimalPlaces)
          Sets the number of digits displayed to the right of decimal point.
static void setRedirectImage(ij.ImagePlus imagePlus)
           
static void setResultsTable(ij.measure.ResultsTable rt)
           
static void setUnsavedMeasurements(boolean b)
           
 int setup(java.lang.String arg, ij.ImagePlus imp)
           
 void summarize()
           
(package private)  void summarizeAreas()
           
 void updateHeadings()
          Redisplays the results table.
static double updateY(double y, int imageHeight)
          Returns an updated Y coordinate based on the current "Invert Y Coordinates" flag.
static int updateY(int y, int imageHeight)
          Returns an updated Y coordinate based on the current "Invert Y Coordinates" flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

darkBlue

public static java.awt.Color darkBlue

markWidth

public static int markWidth

precision

public static int precision

firstParticle

static int firstParticle

lastParticle

static int lastParticle
Constructor Detail

Analyzer2

public Analyzer2()

Analyzer2

public Analyzer2(ij.ImagePlus imp)
Constructs a new Analyzer using the specified ImagePlus object and the current measurement options and default results table.


Analyzer2

public Analyzer2(ij.ImagePlus imp,
                 int measurements,
                 ij.measure.ResultsTable rt)
Construct a new Analyzer using an ImagePlus object and private measurement options and results table.

Method Detail

setup

public int setup(java.lang.String arg,
                 ij.ImagePlus imp)
Specified by:
setup in interface ij.plugin.filter.PlugInFilter

run

public void run(ij.process.ImageProcessor ip)
Specified by:
run in interface ij.plugin.filter.PlugInFilter

doSetDialog

void doSetDialog()

setOptions

void setOptions(ij.gui.GenericDialog gd)

measure

public void measure()
Measures the image or selection and adds the results to the default results table.


reset

boolean reset()

setRedirectImage

public static void setRedirectImage(ij.ImagePlus imagePlus)

getRedirectImage

public static ij.ImagePlus getRedirectImage(ij.ImagePlus currentImage)

isRedirectImage

public static boolean isRedirectImage()
Returns true if an image is selected in the "Redirect To:" popup menu of the Analyze/Set Measurements dialog box.


getRedirectStats

ij.process.ImageStatistics getRedirectStats(int measurements,
                                            ij.gui.Roi roi)

measurePoint

void measurePoint(ij.gui.Roi roi)

measureAngle

void measureAngle(ij.gui.Roi roi)

measureLength

void measureLength(ij.gui.Roi roi)

saveResults

public void saveResults(ij.process.ImageStatistics stats,
                        ij.gui.Roi roi)
Saves the measurements specified in the "Set Measurements" dialog, or by calling setMeasurements(), in the default results table.


getArea

final double getArea(java.awt.Polygon p)

savePoints

void savePoints(ij.gui.Roi roi)

getFileName

java.lang.String getFileName()

displayResults

public void displayResults()
Writes the last row in the system results table to the Results window.


updateHeadings

public void updateHeadings()
Redisplays the results table.


n

public java.lang.String n(double n)
Converts a number to a formatted string with a tab at the end.


incrementCounter

void incrementCounter()

summarize

public void summarize()

summarizeAreas

void summarizeAreas()

getCounter

public static int getCounter()
Returns the current measurement count.


resetCounter

public static boolean resetCounter()
Sets the measurement counter to zero. Displays a dialog that allows the user to save any existing measurements. Returns false if the user cancels the dialog.


setUnsavedMeasurements

public static void setUnsavedMeasurements(boolean b)

getMeasurements

public static int getMeasurements()

setMeasurements

public static void setMeasurements(int measurements)
Sets the system-wide measurement options.


setMeasurement

public static void setMeasurement(int option,
                                  boolean state)
Sets the specified system-wide measurement option.


savePreferences

public static void savePreferences(java.util.Properties prefs)
Called once when ImageJ quits.


getUMeans

public static float[] getUMeans()
Returns an array containing the first 20 uncalibrated means.


getResultsTable

public static ij.measure.ResultsTable getResultsTable()
Returns the default results table. This table should only be displayed in a the "Results" window.


getPrecision

public static int getPrecision()
Returns the number of digits displayed to the right of decimal point.


setPrecision

public static void setPrecision(int decimalPlaces)
Sets the number of digits displayed to the right of decimal point.


updateY

public static int updateY(int y,
                          int imageHeight)
Returns an updated Y coordinate based on the current "Invert Y Coordinates" flag.


updateY

public static double updateY(double y,
                             int imageHeight)
Returns an updated Y coordinate based on the current "Invert Y Coordinates" flag.


setDefaultHeadings

public static void setDefaultHeadings()
Sets the default headings ("Area", "Mean", etc.).


setOption

public static void setOption(java.lang.String option,
                             boolean b)

setResultsTable

public static void setResultsTable(ij.measure.ResultsTable rt)