ImageScience 3.0.0

imagescience.feature
Class Statistics

java.lang.Object
  extended by imagescience.feature.Statistics

public class Statistics
extends java.lang.Object

Computes image statistics.


Field Summary
static int ADEVIATION
          The average absolute deviation from the mean of the values in the image.
static int ELEMENTS
          The number of elements in the image.
static int KURTOSIS
          The Fisher kurtosis or fourth-order moment about the mean of the values in the image.
static int L1NORM
          The L1-norm or sum of the magnitudes of the values in the image.
static int L2NORM
          The L2-norm or zero-mean standard deviation of the values in the image.
static int MASS
          The mass or sum of the values in the image.
static int MAXIMUM
          The maximum value in the image.
static int MEAN
          The mean of the values in the image.
static int MEDIAN
          The median of the values in the image.
 Messenger messenger
          The object used for message displaying.
static int MINIMUM
          The minimum value in the image.
static int MODE
          The mode or most frequently occurring value in the image.
 Progressor progressor
          The object used for progress displaying.
static int SDEVIATION
          The standard deviation from the mean of the values in the image.
static int SKEWNESS
          The Fisher skewness or third-order moment about the mean of the values in the image.
static int VARIANCE
          The variance or second-order moment about the mean of the values in the image.
 
Constructor Summary
Statistics()
          Default constructor.
 
Method Summary
 double get(int statistic)
          Returns the value of the requested statistic.
 void run(Image image)
          Computes the statistics of an image.
 void run(Image image, Coordinates min, Coordinates max)
          Computes the statistics of an image in a rectangular region of interest.
 void run(Image image, Coordinates min, Coordinates max, Image mask)
          Computes the statistics of an image in a masked rectangular region of interest.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM

public static final int MINIMUM
The minimum value in the image.

See Also:
Constant Field Values

MAXIMUM

public static final int MAXIMUM
The maximum value in the image.

See Also:
Constant Field Values

MEAN

public static final int MEAN
The mean of the values in the image.

See Also:
Constant Field Values

MEDIAN

public static final int MEDIAN
The median of the values in the image.

See Also:
Constant Field Values

ELEMENTS

public static final int ELEMENTS
The number of elements in the image.

See Also:
Constant Field Values

MASS

public static final int MASS
The mass or sum of the values in the image.

See Also:
Constant Field Values

VARIANCE

public static final int VARIANCE
The variance or second-order moment about the mean of the values in the image.

See Also:
Constant Field Values

MODE

public static final int MODE
The mode or most frequently occurring value in the image.

See Also:
Constant Field Values

SDEVIATION

public static final int SDEVIATION
The standard deviation from the mean of the values in the image.

See Also:
Constant Field Values

ADEVIATION

public static final int ADEVIATION
The average absolute deviation from the mean of the values in the image.

See Also:
Constant Field Values

L1NORM

public static final int L1NORM
The L1-norm or sum of the magnitudes of the values in the image.

See Also:
Constant Field Values

L2NORM

public static final int L2NORM
The L2-norm or zero-mean standard deviation of the values in the image.

See Also:
Constant Field Values

SKEWNESS

public static final int SKEWNESS
The Fisher skewness or third-order moment about the mean of the values in the image.

See Also:
Constant Field Values

KURTOSIS

public static final int KURTOSIS
The Fisher kurtosis or fourth-order moment about the mean of the values in the image.

See Also:
Constant Field Values

messenger

public final Messenger messenger
The object used for message displaying.


progressor

public final Progressor progressor
The object used for progress displaying.

Constructor Detail

Statistics

public Statistics()
Default constructor.

Method Detail

get

public double get(int statistic)
Returns the value of the requested statistic.

Parameters:
statistic - The statistic whose value is to be returned. Must be one of the static fields of this class.
Returns:
The value of the requested statistic as computed in the last call to any of the run() methods.
Throws:
java.lang.IllegalArgumentException - If statistic is not one of the static fields of this class.

run

public void run(Image image)
Computes the statistics of an image. For a FloatImage, the median and mode are not computed exactly but are estimated with an accuracy of +/- 0.0005 percent of the dynamic range of the image.

Parameters:
image - The image whose statistics are to be computed.
Throws:
java.lang.NullPointerException - If image is null.

run

public void run(Image image,
                Coordinates min,
                Coordinates max)
Computes the statistics of an image in a rectangular region of interest. For a FloatImage, the median and mode are not computed exactly, but are estimated with an accuracy of +/- 0.0005 percent of the dynamic range of the image.

Parameters:
image - The image whose statistics are to be computed.
min - Contains for each dimension the minimum coordinate of the rectangular region of interest.
max - Contains for each dimension the maximum coordinate of the rectangular region of interest.
Throws:
java.lang.IllegalArgumentException - If the region of interest as determined by min and max does not fall entirely within the image, or if any of the min coordinates is larger than its corresponding max coordinate.
java.lang.NullPointerException - If any of the parameters is null.

run

public void run(Image image,
                Coordinates min,
                Coordinates max,
                Image mask)
Computes the statistics of an image in a masked rectangular region of interest. For a FloatImage, the median and mode are not computed exactly, but are estimated with an accuracy of +/- 0.0005 percent of the dynamic range of the image.

Parameters:
image - The image whose statistics are to be computed.
min - Contains for each dimension the minimum coordinate of the rectangular region of interest.
max - Contains for each dimension the maximum coordinate of the rectangular region of interest.
mask - The mask to be used within the region of interest determined by min and max. The method includes all image elements whose corresponding mask value is nonzero. The position of the (zeroth element of the) mask relative to the image is determined by min. In principle, the size of the mask must be equal to the size determined by min and max. Alternatively, to be able to be more memory efficient, the size of the mask may be equal to 1 in any dimension. In that case, the mask is extended (not actually, but implicitly by the algorithm) by value repetition, so that it (again) spans the entire range given by the min and the max coordinate for that dimension (this explains the need for the otherwise superfluous max coordinate).
Throws:
java.lang.IllegalArgumentException - If the region of interest as determined by min and max does not fall entirely within the image, if any of the min coordinates is larger than its corresponding max coordinate, or if the size of the mask in any dimension does not match the size determined by the min and max coordinate for that dimension or, alternatively, is not equal to 1.
java.lang.NullPointerException - If any of the parameters is null.

ImageScience 3.0.0

Copyright (C) Erik Meijering. Permission to use this software and corresponding documentation for educational, research, and not-for-profit purposes, without a fee and without a signed licensing agreement, is granted, subject to the following terms and conditions.

IT IS NOT ALLOWED TO REDISTRIBUTE, SELL, OR LEASE THIS SOFTWARE, OR DERIVATIVE WORKS THEREOF, WITHOUT PERMISSION IN WRITING FROM THE COPYRIGHT HOLDER. THE COPYRIGHT HOLDER IS FREE TO MAKE VERSIONS OF THE SOFTWARE AVAILABLE FOR A FEE OR COMMERCIALLY ONLY.

IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OF ANY KIND WHATSOEVER, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE EXPRESS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND CORRESPONDING DOCUMENTATION IS PROVIDED "AS IS". THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.