net.grelf.grip
Class Statistics

java.lang.Object
  extended by net.grelf.grip.Statistics
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Statistics
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Record to hold a set of measurements of a distribution.

See Also:
Serialized Form

Field Summary
 int max
           
 double mean
           
 int min
           
 int mode
           
 int n
          No of samples.
 double stdDev
          Standard deviation.
 double stdDevMode
          Standard deviation about the mode instead of about the mean - for autoThreshold.
 
Constructor Summary
Statistics()
          Fields are public so allow setting individually if necessary.
Statistics(int[] f, int start, int end)
          Calculate statistics from a frequency array.
Statistics(int[] f, int start, int end, int scale)
          Calculate statistics from a frequency array.
 
Method Summary
 Statistics clone()
           
static Statistics getStatistics(int[] f, int start, int end)
          Deprecated. 
 java.lang.String toString()
          Get a String representation of the Statistics
 java.lang.StringBuffer toXML(java.lang.String indent)
          Get an XML representation, as and child elements of that.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

n

public int n
No of samples.


min

public int min

mode

public int mode

max

public int max

mean

public double mean

stdDev

public double stdDev
Standard deviation.


stdDevMode

public double stdDevMode
Standard deviation about the mode instead of about the mean - for autoThreshold.

Constructor Detail

Statistics

public Statistics()
Fields are public so allow setting individually if necessary.


Statistics

public Statistics(int[] f,
                  int start,
                  int end)
Calculate statistics from a frequency array. Only consider indices from start to end, both assumed to lie in the interval 0..(array length - 1). Assumes scale = 1 (normally the case).


Statistics

public Statistics(int[] f,
                  int start,
                  int end,
                  int scale)
Calculate statistics from a frequency array. Only consider indices from start to end, both assumed to lie in the interval 0..(array length - 1). Scale > 1 is used when the number of bits in the image would make the frequency array much too large when constructing the histogram, so the levels index is scaled down by a small integer factor.

Method Detail

clone

public Statistics clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Get a String representation of the Statistics

Overrides:
toString in class java.lang.Object

toXML

public java.lang.StringBuffer toXML(java.lang.String indent)
Get an XML representation, as and child elements of that. The indent string would typically contain some tab characters (\t).


getStatistics

@Deprecated
public static Statistics getStatistics(int[] f,
                                                  int start,
                                                  int end)
Deprecated. 

Calculate statistics from a frequency array. Only consider indices from start to end, both assumed to lie in the interval 0..(array length - 1). Deprecated - use the constructor.