Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Attributes
vifa_histogram Class Reference

#include <vifa_histogram.h>

Inheritance diagram for vifa_histogram:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vifa_histogram ()
 vifa_histogram (int, float, float)
 vifa_histogram (float *, float *, int)
 vifa_histogram (const vifa_histogram &h)
 Copy constructor.
 vifa_histogram (vifa_histogram const *, float width, bool preserveCounts=false)
 Resample a histogram.
virtual ~vifa_histogram ()
vifa_histogramScale (float scale_factor)
 Transform the value axis of a histogram by a translation, transl, and a scale factor, scale.
vifa_histogramCumulative ()
 Assuming that "this" is a histogram of population density, construct a new histogram which is the cumulative distribution.
vifa_histogramNonMaximumSupress (int radius=1, bool cyclic=false)
 Suppress values in the histogram which are not locally.
void RemoveFlatPeaks (int nbins, float *cnts, bool cyclic)
 Prune any sequences of more than one maximum value.
float CompareToHistogram (vifa_histogram *h)
 Compare 'this' histogram to another (passed in).
void UpCount (float newval)
void UpCount (float newval, bool useNewIndexMethod)
int GetNumSamples () const
float GetCount (float uval) const
float SetCount (float pixelval, float count)
float GetMinVal () const
float GetMaxVal () const
float GetMaxCount () const
float GetMean () const
 Compute the mean of the histogram population.
float GetStandardDev () const
float GetMedian () const
int GetValIndex (float val) const
float * GetVals () const
float * GetCounts () const
int GetRes () const
float GetBucketSize () const
float * GetMinValAddr () const
float * GetMinCountAddr () const
char GetDelimiter () const
void SetDelimiter (char d)
float ComputeArea (float low, float high) const
float ComputeArea () const
 Compute the total area under the histogram.
float LowClipVal (float clip_fraction)
 Finds the lower bound value which eliminates a given fraction of histogram area.
float HighClipVal (float clip_fraction)
 Finds the lower bound value which eliminates a given fraction of histogram area.
void Print ()
 Prints histogram counts onto vcl_cout.
void Dump (char *)
 dumps histogram values to file.
int WritePlot (const char *fname)
 Writes histogram in format suitable for plotting tools like Gnuplot.
void touch ()
unsigned long get_time_stamp () const
bool older (vul_timestamp const &t) const
bool older (vul_timestamp const *t) const
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Protected Member Functions

virtual int GetIndex (float i) const

Protected Attributes

char delimiter
float * vals
float * counts
int num
float delta
float vmax
float vmin
float mean
float standard_dev
unsigned long timestamp_

Private Types

enum  histogram_type { HISTOGRAM = 0, CONTRAST_HIST, NUM_TYPES }

Private Attributes

int stats_consistent

Detailed Description

Definition at line 30 of file vifa_histogram.h.


Member Enumeration Documentation

Enumerator:
HISTOGRAM 
CONTRAST_HIST 
NUM_TYPES 

Definition at line 33 of file vifa_histogram.h.


Constructor & Destructor Documentation

vifa_histogram::vifa_histogram ( )

Definition at line 16 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( int  xres,
float  val1,
float  val2 
)

Definition at line 33 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( float *  uvals,
float *  ucounts,
int  xres 
)

Definition at line 71 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( const vifa_histogram h)

Copy constructor.

Definition at line 93 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( vifa_histogram const *  his,
float  width,
bool  preserveCounts = false 
)

Resample a histogram.

Definition at line 152 of file vifa_histogram.cxx.

vifa_histogram::~vifa_histogram ( ) [virtual]

Definition at line 141 of file vifa_histogram.cxx.


Member Function Documentation

float vifa_histogram::CompareToHistogram ( vifa_histogram h)

Compare 'this' histogram to another (passed in).

Taken from the old TargetJr class HistEntropy.

Definition at line 1139 of file vifa_histogram.cxx.

float vifa_histogram::ComputeArea ( float  low,
float  high 
) const

Definition at line 923 of file vifa_histogram.cxx.

float vifa_histogram::ComputeArea ( ) const

Compute the total area under the histogram.

Definition at line 972 of file vifa_histogram.cxx.

vifa_histogram * vifa_histogram::Cumulative ( )

Assuming that "this" is a histogram of population density, construct a new histogram which is the cumulative distribution.

Each bin, xi, in his is assumed to represent a density, i.e., {x | (xi - .5*delta) < x <= (xi + .5*delta)} Each bin, xi, in the result represents a cumulative distribution, i.e., {x | x <= (xi + .5*delta)}

Definition at line 461 of file vifa_histogram.cxx.

void vifa_histogram::Dump ( char *  dumpfile)

dumps histogram values to file.

Definition at line 1083 of file vifa_histogram.cxx.

float vifa_histogram::GetBucketSize ( ) const [inline]

Definition at line 96 of file vifa_histogram.h.

float vifa_histogram::GetCount ( float  uval) const

Definition at line 831 of file vifa_histogram.cxx.

float* vifa_histogram::GetCounts ( ) const [inline]

Definition at line 88 of file vifa_histogram.h.

char vifa_histogram::GetDelimiter ( ) const [inline]

Definition at line 103 of file vifa_histogram.h.

int vifa_histogram::GetIndex ( float  i) const [protected, virtual]

Definition at line 770 of file vifa_histogram.cxx.

float vifa_histogram::GetMaxCount ( ) const

Definition at line 858 of file vifa_histogram.cxx.

float vifa_histogram::GetMaxVal ( ) const

Definition at line 848 of file vifa_histogram.cxx.

float vifa_histogram::GetMean ( ) const

Compute the mean of the histogram population.

Definition at line 675 of file vifa_histogram.cxx.

float vifa_histogram::GetMedian ( ) const

Definition at line 755 of file vifa_histogram.cxx.

float* vifa_histogram::GetMinCountAddr ( ) const [inline]

Definition at line 100 of file vifa_histogram.h.

float vifa_histogram::GetMinVal ( ) const

Definition at line 840 of file vifa_histogram.cxx.

float* vifa_histogram::GetMinValAddr ( ) const [inline]

Definition at line 98 of file vifa_histogram.h.

int vifa_histogram::GetNumSamples ( ) const

Definition at line 912 of file vifa_histogram.cxx.

int vifa_histogram::GetRes ( ) const [inline]

Definition at line 94 of file vifa_histogram.h.

float vifa_histogram::GetStandardDev ( ) const

Definition at line 715 of file vifa_histogram.cxx.

int vifa_histogram::GetValIndex ( float  val) const

Definition at line 811 of file vifa_histogram.cxx.

float* vifa_histogram::GetVals ( ) const [inline]

Definition at line 82 of file vifa_histogram.h.

float vifa_histogram::HighClipVal ( float  clip_fraction)

Finds the lower bound value which eliminates a given fraction of histogram area.

Definition at line 1023 of file vifa_histogram.cxx.

float vifa_histogram::LowClipVal ( float  clip_fraction)

Finds the lower bound value which eliminates a given fraction of histogram area.

Definition at line 989 of file vifa_histogram.cxx.

vifa_histogram * vifa_histogram::NonMaximumSupress ( int  radius = 1,
bool  cyclic = false 
)

Suppress values in the histogram which are not locally.

The neighborhood for computing the local maximum a maximum. is [radius X radius], e.g. for radius =1 the neighborhood is [-X-], for radius = 2, the neighborhood is [--X--], etc. If the cyclic flag is true then the index space is assumed to be equivalent to a circle. That is, elements "0" and "n_buckets" are in correspondence.

Definition at line 634 of file vifa_histogram.cxx.

void vifa_histogram::Print ( )

Prints histogram counts onto vcl_cout.

Definition at line 1056 of file vifa_histogram.cxx.

void vifa_histogram::RemoveFlatPeaks ( int  nbins,
float *  cnts,
bool  cyclic 
)

Prune any sequences of more than one maximum value.

That is, it is possible to have a "flat" top peak with an arbitrarily long sequence of equal, but maximum values. The cyclic flag indicates that the sequence wraps around, i.e. cnts[0] equivalent to cnts[nbins]

Definition at line 518 of file vifa_histogram.cxx.

vifa_histogram * vifa_histogram::Scale ( float  scale_factor)

Transform the value axis of a histogram by a translation, transl, and a scale factor, scale.

The new histogram has the same resolution as his.

Definition at line 381 of file vifa_histogram.cxx.

float vifa_histogram::SetCount ( float  pixelval,
float  count 
)

Definition at line 874 of file vifa_histogram.cxx.

void vifa_histogram::SetDelimiter ( char  d) [inline]

Definition at line 104 of file vifa_histogram.h.

void vifa_histogram::UpCount ( float  newval)

Definition at line 902 of file vifa_histogram.cxx.

void vifa_histogram::UpCount ( float  newval,
bool  useNewIndexMethod 
)

Definition at line 889 of file vifa_histogram.cxx.

int vifa_histogram::WritePlot ( const char *  fname)

Writes histogram in format suitable for plotting tools like Gnuplot.

Definition at line 1099 of file vifa_histogram.cxx.


Member Data Documentation

float* vifa_histogram::counts [protected]

Definition at line 37 of file vifa_histogram.h.

char vifa_histogram::delimiter [protected]

Definition at line 35 of file vifa_histogram.h.

float vifa_histogram::delta [protected]

Definition at line 40 of file vifa_histogram.h.

float vifa_histogram::mean [mutable, protected]

Definition at line 42 of file vifa_histogram.h.

int vifa_histogram::num [protected]

Definition at line 39 of file vifa_histogram.h.

float vifa_histogram::standard_dev [mutable, protected]

Definition at line 43 of file vifa_histogram.h.

int vifa_histogram::stats_consistent [mutable, private]

Definition at line 117 of file vifa_histogram.h.

float* vifa_histogram::vals [protected]

Definition at line 36 of file vifa_histogram.h.

float vifa_histogram::vmax [protected]

Definition at line 41 of file vifa_histogram.h.

float vifa_histogram::vmin [protected]

Definition at line 41 of file vifa_histogram.h.


The documentation for this class was generated from the following files: