Isis Developer Reference
Isis::QuickFilter Class Reference

Container for boxcar statistics. More...

#include <QuickFilter.h>

Collaboration diagram for Isis::QuickFilter:
Collaboration graph

Public Member Functions

 QuickFilter (const int ns, const int width, const int height)
 Constructs a QuickFilter object with accumulators and counters set to zero.
 
 ~QuickFilter ()
 Destroys the QuickFilter object.
 
double Average (const int index)
 Computes and returns the boxcar average at pixel index (zero based).
 
double Variance (const int index)
 Computes and returns the boxcar variance at pixel index (zero based).
 
int Count (const int index)
 Computes and returns the number of valid pixels in the boxcar at pixel index (zero based).
 
int Width () const
 Returns the width of the boxcar.
 
int HalfWidth () const
 Returns the half the width of the boxcar rounded down because the boxcar size is odd.
 
int Height () const
 Returns the height of the boxcar.
 
int HalfHeight () const
 Returns the half the height of the boxcar rounded down because the boxcar size is odd.
 
int Samples () const
 Returns the number of samples in a line.
 
double Low () const
 Returns the lowest pixel value included in filtering computations.
 
double High () const
 Returns the highest pixel value included in filtering computations.
 
int MinimumPixels () const
 Returns the minimum number of pixels which need to be valid inside the boxcar.
 
void AddLine (const double *buf)
 Add an array of doubles to the accumulators and counters.
 
void RemoveLine (const double *buf)
 Remove an array of doubles from the accumulators and counters.
 
void Reset ()
 Reset all accumulators and counters to zero.
 
void SetMinMax (const double minimum, const double maximum)
 This method is used to set the minimum/maximum valid values.
 
void SetMinimumPixels (const int minimumValid)
 This method is used to set the minimum number of valid pixels in the boxcar.
 

Detailed Description

Container for boxcar statistics.

This class is used to compute statisics for NxM boxcars, where N and M are positive odd integers. In general, this object will be loaded by another derived class such as FilterLoader or FilterProcess. The programmer can then use the methods in this class to compute statistics such as the boxcar average, variance, and number of valid pixels in the boxcar.

If you would like to see QuickFilter being used in implementation, see FilterLoader or FilterProcess

Author
2002-06-20 Jeff Anderson

Constructor & Destructor Documentation

◆ QuickFilter()

Isis::QuickFilter::QuickFilter ( const int ns,
const int width,
const int height )

Constructs a QuickFilter object with accumulators and counters set to zero.

Because this is a line based filtering object, the number of samples and the boxcar size must be given to the constructor.

Parameters
nsNumber of samples in the cube
widthWidth of the boxcar (must be odd)
heightHeight of the boxcar (must be odd)
Exceptions
Isis::IException::Programmer

References _FILEINFO_, Isis::IException::Programmer, and Reset().

◆ ~QuickFilter()

Isis::QuickFilter::~QuickFilter ( )

Destroys the QuickFilter object.

Member Function Documentation

◆ AddLine()

void Isis::QuickFilter::AddLine ( const double * buf)

Add an array of doubles to the accumulators and counters.

This method must be invoked enough times to satisfy the height requirements of the boxcar. Note, however this is not strictly enforced. The method will check to make sure you have not added beyond the height of the boxcar. Therefore, you must remove a line before adding a new one.

Parameters
bufArray of doubles to add
Exceptions
Isis::iException::Programmer

References _FILEINFO_, Isis::IsValidPixel(), and Isis::IException::Programmer.

Referenced by Isis::ProcessByQuickFilter::StartProcess().

◆ Average()

double Isis::QuickFilter::Average ( const int index)

Computes and returns the boxcar average at pixel index (zero based).

No error checks are done for out of array bounds conditions. If there are not enough valid pixels in the boxcar then Isis::NULL8 is returned. The routine works the fastest when sequentially accessing the averages (e.g., index = 0,1,2,...).

Parameters
indexZero based sample position
Returns
double

References Isis::NULL8.

◆ Count()

int Isis::QuickFilter::Count ( const int index)

Computes and returns the number of valid pixels in the boxcar at pixel index (zero based).

No error checks are done for out of array bounds conditions. The routine works the fastest when sequentially accessing the counts (e.g., index = 0,1,2,...).

Parameters
indexZero based sample position
Returns
double

◆ HalfHeight()

int Isis::QuickFilter::HalfHeight ( ) const

Returns the half the height of the boxcar rounded down because the boxcar size is odd.

Returns
int

Referenced by Isis::ProcessByQuickFilter::StartProcess().

◆ HalfWidth()

int Isis::QuickFilter::HalfWidth ( ) const

Returns the half the width of the boxcar rounded down because the boxcar size is odd.

Returns
int

◆ Height()

int Isis::QuickFilter::Height ( ) const

Returns the height of the boxcar.

Returns
int

◆ High()

double Isis::QuickFilter::High ( ) const

Returns the highest pixel value included in filtering computations.

Returns
double

◆ Low()

double Isis::QuickFilter::Low ( ) const

Returns the lowest pixel value included in filtering computations.

Returns
double

◆ MinimumPixels()

int Isis::QuickFilter::MinimumPixels ( ) const

Returns the minimum number of pixels which need to be valid inside the boxcar.

If there are not enough valid pixels then invoking Average and Variance methods will result in a NULL output.

Returns
int

◆ RemoveLine()

void Isis::QuickFilter::RemoveLine ( const double * buf)

Remove an array of doubles from the accumulators and counters.

Parameters
bufPointer to array of doubles to remove

References Isis::IsValidPixel().

Referenced by Isis::ProcessByQuickFilter::StartProcess().

◆ Reset()

void Isis::QuickFilter::Reset ( )

Reset all accumulators and counters to zero.

Referenced by QuickFilter(), and Isis::ProcessByQuickFilter::StartProcess().

◆ Samples()

int Isis::QuickFilter::Samples ( ) const

Returns the number of samples in a line.

Returns
int

◆ SetMinimumPixels()

void Isis::QuickFilter::SetMinimumPixels ( const int pixels)

This method is used to set the minimum number of valid pixels in the boxcar.

If the minimum requirement can not be satisfied then the Average and Variance methods will return Isis:NULL8. The default value is zero.

Parameters
pixelsNumber of minimum valid pixels for statistically computations to occur
Exceptions
Isis::iException::Programmer

References _FILEINFO_, and Isis::IException::Programmer.

Referenced by Isis::ProcessByQuickFilter::StartProcess().

◆ SetMinMax()

void Isis::QuickFilter::SetMinMax ( const double minimum,
const double maximum )

This method is used to set the minimum/maximum valid values.

Pixels are only considered valid (usable when computing Average and Variance) if they are not special (NULL, LIS, etc) and if they fall within the range of minimum and maximum inclusive. You should only invoke this method once after the object has been constructed. Further invocations will cause unpredictable results. If this method is never called then the defaults are DBL_MIN and DBL_MAX, respectively.

Parameters
minimumMinimum valid pixel
maximumMaximum valid pixel
Exceptions
Isis::iException::Programmer

References _FILEINFO_, and Isis::IException::Programmer.

Referenced by Isis::ProcessByQuickFilter::StartProcess().

◆ Variance()

double Isis::QuickFilter::Variance ( const int index)

Computes and returns the boxcar variance at pixel index (zero based).

No error checks are done for out of array bounds conditions. If there are not enough valid pixels in the boxcar then Isis::NULL8 is returned. The routine works the fastest when sequentially accessing the variances (e.g., index = 0,1,2,...).

Parameters
indexZero based sample position
Returns
double

References Isis::NULL8.

◆ Width()

int Isis::QuickFilter::Width ( ) const

Returns the width of the boxcar.

Returns
int

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