7 #include "BoxcarCachingAlgorithm.h"
8 #include "BoxcarManager.h"
10 #include "LineManager.h"
12 #include "ProcessByBoxcar.h"
24 void ProcessByBoxcar::SetBoxcarSize(
const int ns,
const int nl) {
42 void ProcessByBoxcar::StartProcess(
void funct(
Isis::Buffer &in,
double &out)) {
44 if(InputCubes.size() != 1) {
45 string m =
"You must specify exactly one input cube";
46 throw IException(IException::Programmer, m, _FILEINFO_);
48 else if(OutputCubes.size() != 1) {
49 string m =
"You must specify exactly one output cube";
50 throw IException(IException::Programmer, m, _FILEINFO_);
54 if(InputCubes[0]->lineCount() != OutputCubes[0]->lineCount()) {
55 string m =
"The number of lines in the input and output cubes ";
57 throw IException(IException::Programmer, m, _FILEINFO_);
61 if(InputCubes[0]->sampleCount() != OutputCubes[0]->sampleCount()) {
62 string m =
"The number of samples in the input and output cubes ";
64 throw IException(IException::Programmer, m, _FILEINFO_);
68 if(InputCubes[0]->bandCount() != OutputCubes[0]->bandCount()) {
69 string m =
"The number of bands in the input and output cubes ";
71 throw IException(IException::Programmer, m, _FILEINFO_);
76 string m =
"Use the SetBoxcarSize method to set the boxcar size";
77 throw IException(IException::Programmer, m, _FILEINFO_);
89 p_progress->SetMaximumSteps(InputCubes[0]->lineCount()*InputCubes[0]->bandCount());
90 p_progress->CheckStatus();
94 for(
int i = 0; i < line.
size(); i++) {
95 InputCubes[0]->read(box);
100 OutputCubes[0]->write(line);
101 p_progress->CheckStatus();
112 void ProcessByBoxcar::EndProcess() {
114 p_boxsizeSet =
false;
123 void ProcessByBoxcar::Finalize() {
125 p_boxsizeSet =
false;