ij.plugin.filter
Class Analyzer

java.lang.Object
  extended by ij.plugin.filter.Analyzer
All Implemented Interfaces:
ij.measure.Measurements, PlugInFilter

public class Analyzer
extends java.lang.Object
implements 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, 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, SKEWNESS, SLICE, STD_DEV
 
Constructor Summary
Analyzer()
           
Analyzer(ImagePlus imp)
          Constructs a new Analyzer using the specified ImagePlus object and the system-wide measurement options and results table.
Analyzer(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 results table to the ImageJ window.
(package private)  void doSetDialog()
           
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 ImagePlus getRedirectImage(ImagePlus currentImage)
          Returns the image selected in the "Redirect To:" popup menu of the Analyze/Set Measurements dialog or null if "None" is selected, the image was not found or the image is not the same size as currentImage.
(package private)  ImageStatistics getRedirectStats(int measurements, ij.gui.Roi roi)
           
static ij.measure.ResultsTable getResultsTable()
          Returns the ImageJ 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.
(package private)  void measure()
           
(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(ImageProcessor ip)
          Filters use this method to process the image.
static void savePreferences(java.util.Properties prefs)
          Called once when ImageJ quits.
 void saveResults(ImageStatistics stats, ij.gui.Roi roi)
          Saves the measurements specified in the "Set Measurements" dialog, or by calling setMeasurments(), in the system results table.
static void setDefaultHeadings()
          Sets the default headings ("Area", "Mean", etc.).
static void setMeasurements(int measurements)
           
(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 setUnsavedMeasurements(boolean b)
           
 int setup(java.lang.String arg, ImagePlus imp)
          This method is called once when the filter is loaded.
 void summarize()
           
(package private)  void summarizeAreas()
           
(package private)  void summarizeLengths(ij.measure.ResultsTable rt)
           
(package private)  void summarizePoints(ij.measure.ResultsTable rt)
           
 void updateHeadings()
          Updates the displayed column headings.
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

Analyzer

public Analyzer()

Analyzer

public Analyzer(ImagePlus imp)
Constructs a new Analyzer using the specified ImagePlus object and the system-wide measurement options and results table.


Analyzer

public Analyzer(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,
                 ImagePlus imp)
Description copied from interface: PlugInFilter
This method is called once when the filter is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt or in the plugins.config file of a jar archive containing the plugin. 'imp' is the currently active image. This method should return a flag word that specifies the filters capabilities.

For Plugin-filters specifying the FINAL_PROCESSING flag, the setup method will be called again, this time with arg = "final" after all other processing is done.

Specified by:
setup in interface PlugInFilter

run

public void run(ImageProcessor ip)
Description copied from interface: PlugInFilter
Filters use this method to process the image. If the SUPPORTS_STACKS flag was set, it is called for each slice in a stack. With CONVERT_TO_FLOAT, the filter is called with the image data converted to a FloatProcessor (3 times per image for RGB images). ImageJ will lock the image before calling this method and unlock it when the filter is finished. For PlugInFilters specifying the NO_IMAGE_REQUIRED flag and not the DONE flag, run(ip) is called once with the argument null.

Specified by:
run in interface PlugInFilter

doSetDialog

void doSetDialog()

setOptions

void setOptions(ij.gui.GenericDialog gd)

measure

void measure()

reset

boolean reset()

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.


getRedirectImage

public static ImagePlus getRedirectImage(ImagePlus currentImage)
Returns the image selected in the "Redirect To:" popup menu of the Analyze/Set Measurements dialog or null if "None" is selected, the image was not found or the image is not the same size as currentImage.


getRedirectStats

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(ImageStatistics stats,
                        ij.gui.Roi roi)
Saves the measurements specified in the "Set Measurements" dialog, or by calling setMeasurments(), in the system results table.


getFileName

java.lang.String getFileName()

displayResults

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


updateHeadings

public void updateHeadings()
Updates the displayed column headings. Does nothing if the results table headings and the displayed headings are the same. Redisplays the results if the headings are different and the results table is not empty.


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()

summarizePoints

void summarizePoints(ij.measure.ResultsTable rt)

summarizeLengths

void summarizeLengths(ij.measure.ResultsTable rt)

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)

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 ImageJ 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.).