jview
Class CountHistogram

java.lang.Object
  extended by vec_math.DoubleHistogram
      extended by jview.CountHistogram
All Implemented Interfaces:
JHistogram, Histogram
Direct Known Subclasses:
FitsHistogram

public class CountHistogram
extends DoubleHistogram
implements JHistogram

A count histogramm takes an already calculated histogram and lets classes access it.


Nested Class Summary
protected static class CountHistogram.CountBounds
          A container class used by the #method.
 
Nested classes/interfaces inherited from interface jview.JHistogram
JHistogram.Bounds
 
Field Summary
 
Fields inherited from class vec_math.DoubleHistogram
DEFBINWIDTH
 
Constructor Summary
protected CountHistogram()
          Empty constructor.
protected CountHistogram(double _min, double _max, double _av, int sum, int[] band)
          This method is introduced here to not break the original implementation for calculating the median and mean, which is, to my opinion, of a lower accuracy than the one used on the new class DoubleHistogram.
 
Method Summary
static JHistogram createHistogram(ColorModel cm, Raster r, int band)
          Create histogram from a data buffer.
protected static JHistogram createHistogramFromBandArray(int[] bandcount)
          We take an unrectified histogram of a band intensity and convert it to a histogram.
protected static JHistogram createHistogramFromByteData(DataBufferByte db, int index)
          We take a data buffer and construct a histogram out of it.
protected static JHistogram createHistogramFromUShortData(DataBufferUShort db, int index)
          We take a data buffer and construct a histogram out of it.
 JHistogram.Bounds getBounds(double percentKept)
          An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image.
 JHistogram.Bounds getModeBounds(double lo, double hi)
          Returns a mode bound, the given number of standard deviations from the mode.
 JHistogram.Bounds getNonsaturatedBounds(double percentKept)
          An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image.
 JHistogram.Bounds getUpperBounds(double percentKept)
          An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image.
 
Methods inherited from class vec_math.DoubleHistogram
createHistogram, createHistogram, createHistogram, createHistogram, equals, findMedianIndex, findModeIndex, fractionMedianIndex, getAverage, getBinCounts, getBinWidth, getMax, getMedian, getMin, getMode, getTotal, parabolicModeIndex, setAverage, setBinCounts, setMax, setMedian, setMin, setMode, setTotal, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface vec_math.Histogram
getAverage, getBinCounts, getBinWidth, getMax, getMedian, getMin, getMode, getTotal
 

Constructor Detail

CountHistogram

protected CountHistogram()
Empty constructor.


CountHistogram

protected CountHistogram(double _min,
                         double _max,
                         double _av,
                         int sum,
                         int[] band)
This method is introduced here to not break the original implementation for calculating the median and mean, which is, to my opinion, of a lower accuracy than the one used on the new class DoubleHistogram.

Method Detail

createHistogramFromBandArray

protected static JHistogram createHistogramFromBandArray(int[] bandcount)
We take an unrectified histogram of a band intensity and convert it to a histogram.


createHistogramFromByteData

protected static JHistogram createHistogramFromByteData(DataBufferByte db,
                                                        int index)
We take a data buffer and construct a histogram out of it. This factory method supports byte buffers only and can be used to construct histogram for all indices.


createHistogramFromUShortData

protected static JHistogram createHistogramFromUShortData(DataBufferUShort db,
                                                          int index)
We take a data buffer and construct a histogram out of it. This factory method supports byte buffers only and can be used to construct histogram for all indices.


createHistogram

public static JHistogram createHistogram(ColorModel cm,
                                         Raster r,
                                         int band)
Create histogram from a data buffer. Should work for all data buffers, but might be slow.


getBounds

public JHistogram.Bounds getBounds(double percentKept)
An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image. percentKept is a slightly deceptive name, as it must be in the range [0, 1].

Specified by:
getBounds in interface JHistogram
Returns:
Intensity bounds.

getNonsaturatedBounds

public JHistogram.Bounds getNonsaturatedBounds(double percentKept)
An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image. percentKept is a slightly deceptive name, as it must be in the range [0, 1].

Specified by:
getNonsaturatedBounds in interface JHistogram
Returns:
Intensity bounds.

getUpperBounds

public JHistogram.Bounds getUpperBounds(double percentKept)
An instance of Bounds containing the min and max values that will result in keeping percentKept percent of the values in the image. percentKept is a slightly deceptive name, as it must be in the range [0, 1].

Specified by:
getUpperBounds in interface JHistogram
Returns:
Intensity bounds.

getModeBounds

public JHistogram.Bounds getModeBounds(double lo,
                                       double hi)
Description copied from interface: JHistogram
Returns a mode bound, the given number of standard deviations from the mode.

Specified by:
getModeBounds in interface JHistogram