vifa_histogram Class Reference

#include <vifa_histogram.h>

Inheritance diagram for vifa_histogram:

vul_timestamp vbl_ref_count vifa_image_histogram List of all members.

Detailed Description

Definition at line 30 of file vifa_histogram.h.


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

Member Enumeration Documentation

enum vifa_histogram::histogram_type [private]

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 22 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( int  ,
float  ,
float   
)

Definition at line 39 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( float *  ,
float *  ,
int   
)

Definition at line 77 of file vifa_histogram.cxx.

vifa_histogram::vifa_histogram ( const vifa_histogram h  ) 

Copy constructor.

Definition at line 99 of file vifa_histogram.cxx.

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

Resample a histogram.

Definition at line 161 of file vifa_histogram.cxx.

vifa_histogram::~vifa_histogram (  )  [virtual]

Definition at line 150 of file vifa_histogram.cxx.


Member Function Documentation

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

Definition at line 779 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 391 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 471 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 643 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 528 of file vifa_histogram.cxx.

float vifa_histogram::CompareToHistogram ( vifa_histogram h  ) 

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

Taken from the old TargetJr class HistEntropy.

Definition at line 1148 of file vifa_histogram.cxx.

void vifa_histogram::UpCount ( float  newval  ) 

Definition at line 911 of file vifa_histogram.cxx.

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

Definition at line 898 of file vifa_histogram.cxx.

int vifa_histogram::GetNumSamples (  )  const

Definition at line 921 of file vifa_histogram.cxx.

float vifa_histogram::GetCount ( float  uval  )  const

Definition at line 840 of file vifa_histogram.cxx.

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

Definition at line 883 of file vifa_histogram.cxx.

float vifa_histogram::GetMinVal (  )  const

Definition at line 849 of file vifa_histogram.cxx.

float vifa_histogram::GetMaxVal (  )  const

Definition at line 857 of file vifa_histogram.cxx.

float vifa_histogram::GetMaxCount (  )  const

Definition at line 867 of file vifa_histogram.cxx.

float vifa_histogram::GetMean (  )  const

Compute the mean of the histogram population.

Definition at line 684 of file vifa_histogram.cxx.

float vifa_histogram::GetStandardDev (  )  const

Definition at line 724 of file vifa_histogram.cxx.

float vifa_histogram::GetMedian (  )  const

Definition at line 764 of file vifa_histogram.cxx.

int vifa_histogram::GetValIndex ( float  val  )  const

Definition at line 820 of file vifa_histogram.cxx.

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

Definition at line 82 of file vifa_histogram.h.

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

Definition at line 88 of file vifa_histogram.h.

int vifa_histogram::GetRes (  )  const [inline]

Definition at line 94 of file vifa_histogram.h.

float vifa_histogram::GetBucketSize (  )  const [inline]

Definition at line 96 of file vifa_histogram.h.

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

Definition at line 98 of file vifa_histogram.h.

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

Definition at line 100 of file vifa_histogram.h.

char vifa_histogram::GetDelimiter (  )  const [inline]

Definition at line 103 of file vifa_histogram.h.

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

Definition at line 104 of file vifa_histogram.h.

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

Definition at line 932 of file vifa_histogram.cxx.

float vifa_histogram::ComputeArea (  )  const

Compute the total area under the histogram.

Definition at line 981 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 998 of file vifa_histogram.cxx.

float vifa_histogram::HighClipVal ( float  clip_fraction  ) 

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

Definition at line 1032 of file vifa_histogram.cxx.

void vifa_histogram::Print (  ) 

Prints histogram counts onto vcl_cout.

Definition at line 1065 of file vifa_histogram.cxx.

void vifa_histogram::Dump ( char *   ) 

dumps histogram values to file.

Definition at line 1092 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 1108 of file vifa_histogram.cxx.


Member Data Documentation

char vifa_histogram::delimiter [protected]

Definition at line 35 of file vifa_histogram.h.

float* vifa_histogram::vals [protected]

Definition at line 36 of file vifa_histogram.h.

float* vifa_histogram::counts [protected]

Definition at line 37 of file vifa_histogram.h.

int vifa_histogram::num [protected]

Definition at line 39 of file vifa_histogram.h.

float vifa_histogram::delta [protected]

Definition at line 40 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.

float vifa_histogram::mean [mutable, protected]

Definition at line 42 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.


The documentation for this class was generated from the following files:
Generated on Thu Jan 8 05:16:07 2009 for contrib/gel/vifa by  doxygen 1.5.1