Isis 3 Programmer Reference
QuickFilter.h
Go to the documentation of this file.
1 #ifndef QuickFilter_h
2 #define QuickFilter_h
3 
25 #include "SpecialPixel.h"
26 
27 namespace Isis {
66  class QuickFilter {
67  private:
68  double *p_sums;
78  double *p_sumsqrs;
82  int *p_counts;
90  int p_ns;
96  double p_minimum;
103  double p_maximum;
116  int p_width;
127  int p_height;
139  double p_lastSum;
151  double p_lastSumsqr;
169  void Compute(const int index);
170 
171  public:
172  QuickFilter(const int ns, const int width, const int height);
173  ~QuickFilter();
174 
175  double Average(const int index);
176  double Variance(const int index);
177  int Count(const int index);
178 
179  int Width() const;
180  int HalfWidth() const;
181  int Height() const;
182  int HalfHeight() const;
183  int Samples() const;
184 
185  double Low() const;
186  double High() const;
187  int MinimumPixels() const;
188 
189  void AddLine(const double *buf);
190  void RemoveLine(const double *buf);
191  void Reset();
192 
193  void SetMinMax(const double minimum, const double maximum);
194  void SetMinimumPixels(const int minimumValid);
195 
196  };
197 };
198 
199 #endif
double p_lastSum
The last sum of a full boxcar.
Definition: QuickFilter.h:139
int Height() const
Returns the height of the boxcar.
void Reset()
Reset all accumulators and counters to zero.
Definition: QuickFilter.cpp:95
double High() const
Returns the highest pixel value included in filtering computations.
~QuickFilter()
Destroys the QuickFilter object.
int p_lastCount
See p_lastSum.
Definition: QuickFilter.h:152
double Variance(const int index)
Computes and returns the boxcar variance at pixel index (zero based).
double * p_sumsqrs
This is identical to p_sums with the exception that the pixel values are squared before summing occur...
Definition: QuickFilter.h:78
int p_minimumPixels
The minimum number of pixels in the boxcar which must be valid (not special and inside p_minimum/p_ma...
Definition: QuickFilter.h:110
int p_lastIndex
This is used to keep track of the last index passed into the Average, Variance and/or count method...
Definition: QuickFilter.h:153
double p_lastSumsqr
See p_lastSum.
Definition: QuickFilter.h:151
void Compute(const int index)
Computes the moving boxcar sums and counts for the Average, Variance, and count methods.
int p_halfWidth
This is half the width of the boxcar rounded down to the next integer since the boxcar is always odd...
Definition: QuickFilter.h:121
void SetMinimumPixels(const int minimumValid)
This method is used to set the minimum number of valid pixels in the boxcar.
int HalfWidth() const
Returns the half the width of the boxcar rounded down because the boxcar size is odd.
int Width() const
Returns the width of the boxcar.
double p_maximum
Maximum valid pixel value.
Definition: QuickFilter.h:103
int p_ns
This value is initialized in the constructor.
Definition: QuickFilter.h:90
int HalfHeight() const
Returns the half the height of the boxcar rounded down because the boxcar size is odd...
int Count(const int index)
Computes and returns the number of valid pixels in the boxcar at pixel index (zero based)...
void SetMinMax(const double minimum, const double maximum)
This method is used to set the minimum/maximum valid values.
QuickFilter(const int ns, const int width, const int height)
Constructs a QuickFilter object with accumulators and counters set to zero.
Definition: QuickFilter.cpp:43
double Average(const int index)
Computes and returns the boxcar average at pixel index (zero based).
double * p_sums
Sum accumulator for each column/sample.
Definition: QuickFilter.h:68
Container for boxcar statistics.
Definition: QuickFilter.h:66
void AddLine(const double *buf)
Add an array of doubles to the accumulators and counters.
double Low() const
Returns the lowest pixel value included in filtering computations.
void RemoveLine(const double *buf)
Remove an array of doubles from the accumulators and counters.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
int * p_counts
This is identical to p_sums with the exception that it keeps count of the number of valid pixels in p...
Definition: QuickFilter.h:82
int Samples() const
Returns the number of samples in a line.
int MinimumPixels() const
Returns the minimum number of pixels which need to be valid inside the boxcar.
double p_minimum
Minimum valid pixel value.
Definition: QuickFilter.h:96
int p_width
This is the width of the boxcar.
Definition: QuickFilter.h:116
int p_height
This is the height of the boxcar.
Definition: QuickFilter.h:127
int p_linesAdded
This is used to keep track of the number of lines added.
Definition: QuickFilter.h:164
int p_halfHeight
This is half the height of the boxcar rounded down to the next integer since the boxcar is always odd...
Definition: QuickFilter.h:132