Isis 3 Programmer Reference
QuickFilter.h
1 #ifndef QuickFilter_h
2 #define QuickFilter_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "SpecialPixel.h"
10 
11 namespace Isis {
50  class QuickFilter {
51  private:
52  double *p_sums;
62  double *p_sumsqrs;
66  int *p_counts;
74  int p_ns;
80  double p_minimum;
87  double p_maximum;
100  int p_width;
111  int p_height;
123  double p_lastSum;
135  double p_lastSumsqr;
153  void Compute(const int index);
154 
155  public:
156  QuickFilter(const int ns, const int width, const int height);
157  ~QuickFilter();
158 
159  double Average(const int index);
160  double Variance(const int index);
161  int Count(const int index);
162 
163  int Width() const;
164  int HalfWidth() const;
165  int Height() const;
166  int HalfHeight() const;
167  int Samples() const;
168 
169  double Low() const;
170  double High() const;
171  int MinimumPixels() const;
172 
173  void AddLine(const double *buf);
174  void RemoveLine(const double *buf);
175  void Reset();
176 
177  void SetMinMax(const double minimum, const double maximum);
178  void SetMinimumPixels(const int minimumValid);
179 
180  };
181 };
182 
183 #endif
Isis::QuickFilter::Samples
int Samples() const
Returns the number of samples in a line.
Definition: QuickFilter.cpp:311
Isis::QuickFilter::p_lastCount
int p_lastCount
See p_lastSum.
Definition: QuickFilter.h:136
Isis::QuickFilter::p_halfHeight
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:116
Isis::QuickFilter::p_linesAdded
int p_linesAdded
This is used to keep track of the number of lines added.
Definition: QuickFilter.h:148
Isis::QuickFilter::Average
double Average(const int index)
Computes and returns the boxcar average at pixel index (zero based).
Definition: QuickFilter.cpp:213
Isis::QuickFilter::SetMinMax
void SetMinMax(const double minimum, const double maximum)
This method is used to set the minimum/maximum valid values.
Definition: QuickFilter.cpp:118
Isis::QuickFilter::RemoveLine
void RemoveLine(const double *buf)
Remove an array of doubles from the accumulators and counters.
Definition: QuickFilter.cpp:188
Isis::QuickFilter::Compute
void Compute(const int index)
Computes the moving boxcar sums and counts for the Average, Variance, and count methods.
Definition: QuickFilter.cpp:352
Isis::QuickFilter::AddLine
void AddLine(const double *buf)
Add an array of doubles to the accumulators and counters.
Definition: QuickFilter.cpp:162
Isis::QuickFilter::Low
double Low() const
Returns the lowest pixel value included in filtering computations.
Definition: QuickFilter.cpp:320
Isis::QuickFilter::p_width
int p_width
This is the width of the boxcar.
Definition: QuickFilter.h:100
Isis::QuickFilter::HalfWidth
int HalfWidth() const
Returns the half the width of the boxcar rounded down because the boxcar size is odd.
Definition: QuickFilter.cpp:283
Isis::QuickFilter::p_counts
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:66
Isis::QuickFilter::p_minimum
double p_minimum
Minimum valid pixel value.
Definition: QuickFilter.h:80
Isis::QuickFilter
Container for boxcar statistics.
Definition: QuickFilter.h:50
Isis::QuickFilter::HalfHeight
int HalfHeight() const
Returns the half the height of the boxcar rounded down because the boxcar size is odd.
Definition: QuickFilter.cpp:302
Isis::QuickFilter::MinimumPixels
int MinimumPixels() const
Returns the minimum number of pixels which need to be valid inside the boxcar.
Definition: QuickFilter.cpp:340
Isis::QuickFilter::QuickFilter
QuickFilter(const int ns, const int width, const int height)
Constructs a QuickFilter object with accumulators and counters set to zero.
Definition: QuickFilter.cpp:27
Isis::QuickFilter::Height
int Height() const
Returns the height of the boxcar.
Definition: QuickFilter.cpp:292
Isis::QuickFilter::Variance
double Variance(const int index)
Computes and returns the boxcar variance at pixel index (zero based).
Definition: QuickFilter.cpp:236
Isis::QuickFilter::p_ns
int p_ns
This value is initialized in the constructor.
Definition: QuickFilter.h:74
Isis::QuickFilter::p_lastSumsqr
double p_lastSumsqr
See p_lastSum.
Definition: QuickFilter.h:135
Isis::QuickFilter::p_maximum
double p_maximum
Maximum valid pixel value.
Definition: QuickFilter.h:87
Isis::QuickFilter::SetMinimumPixels
void SetMinimumPixels(const int minimumValid)
This method is used to set the minimum number of valid pixels in the boxcar.
Definition: QuickFilter.cpp:139
Isis::QuickFilter::Reset
void Reset()
Reset all accumulators and counters to zero.
Definition: QuickFilter.cpp:79
Isis::QuickFilter::p_height
int p_height
This is the height of the boxcar.
Definition: QuickFilter.h:111
Isis::QuickFilter::High
double High() const
Returns the highest pixel value included in filtering computations.
Definition: QuickFilter.cpp:329
Isis::QuickFilter::p_lastIndex
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:137
Isis::QuickFilter::p_halfWidth
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:105
Isis::QuickFilter::p_sums
double * p_sums
Sum accumulator for each column/sample.
Definition: QuickFilter.h:52
Isis::QuickFilter::p_sumsqrs
double * p_sumsqrs
This is identical to p_sums with the exception that the pixel values are squared before summing occur...
Definition: QuickFilter.h:62
Isis::QuickFilter::Count
int Count(const int index)
Computes and returns the number of valid pixels in the boxcar at pixel index (zero based).
Definition: QuickFilter.cpp:260
Isis::QuickFilter::~QuickFilter
~QuickFilter()
Destroys the QuickFilter object.
Definition: QuickFilter.cpp:97
Isis::QuickFilter::p_lastSum
double p_lastSum
The last sum of a full boxcar.
Definition: QuickFilter.h:123
Isis::QuickFilter::p_minimumPixels
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:94
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::QuickFilter::Width
int Width() const
Returns the width of the boxcar.
Definition: QuickFilter.cpp:273