7#include "ProcessByQuickFilter.h"
9#include "Application.h"
10#include "FilterCachingAlgorithm.h"
11#include "IException.h"
12#include "LineManager.h"
13#include "Preference.h"
14#include "QuickFilter.h"
38 string m =
"StartProcess only supports exactly one input file";
43 string m =
"StartProcess only supports exactly one output file";
49 string m =
"The lines in the input and output cube must match";
55 string m =
"The samples in the input and output cube must match";
61 string m =
"The bands in the input and output cube must match";
80 string msg =
"Boxcar height is too big for cube size";
85 string msg =
"Boxcar width is too big for cube size";
99 for(
int band = 1; band <= bands; band++) {
104 for(bot = top; bot <= (1 + filter.
HalfHeight()); bot++) {
106 if(bot <= 0) iline = (-1 * bot + 2);
107 botline->SetLine(iline, band);
109 filter.
AddLine(botline->DoubleBuffer());
114 for(
int line = 1; line <= lines; line++) {
116 iline->SetLine(line, band);
117 oline->SetLine(line, band);
120 funct(*iline, *oline, filter);
125 topline->SetLine(top, band);
128 topline->SetLine(-1 * top + 2, band);
137 if(line == lines)
continue;
140 botline->SetLine(bot, band);
143 botline->SetLine(lines - (bot - lines), band);
147 filter.
AddLine(botline->DoubleBuffer());
181 double low,
double high,
int minimum) {
static UserInterface & GetUserInterface()
Returns the UserInterface object.
Buffer for reading and writing cube data.
This algorithm is designed for applications that use ProcessByQuickFilter or very similar I/O pattern...
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
Buffer manager, for moving through a cube in lines.
virtual void StartProcess(void funct(Isis::Buffer &in, Isis::Buffer &out, Isis::QuickFilter &filter))
This method invokes the process on a line by line basis.
void SetFilterParameters(int samples, int lines, double low=-DBL_MAX, double high=DBL_MAX, int minimum=0)
This method allows the programmer to set the filter parameters.
int p_boxcarLines
Number of lines in the boxcar.
void GetFilterParameters()
This method allows the user to input the filter parameters.
int p_boxcarSamples
Number of samples in the boxcar.
bool p_getParametersFromUser
Flag to indicate whether or not to get parameters from the user.
double p_high
Maximum valid pixel value to include in statistical computations of the boxcar.
double p_low
Minimum valid pixel value to include in statistical computations of the boxcar.
ProcessByQuickFilter()
Constructs a FilterProcess object.
int p_minimum
Minimum number of valid pixels in the sample-by-line boxcar in order for statistical computations to ...
Base class for all cube processing derivatives.
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Isis::Progress * p_progress
Pointer to a Progress object.
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
void CheckStatus()
Checks and updates the status.
Container for boxcar statistics.
void AddLine(const double *buf)
Add an array of doubles to the accumulators and counters.
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.
int HalfHeight() const
Returns the half the height of the boxcar rounded down because the boxcar size is odd.
void RemoveLine(const double *buf)
Remove an array of doubles from the accumulators and counters.
void Reset()
Reset all accumulators and counters to zero.
This is free and unencumbered software released into the public domain.
Namespace for the standard library.