Isis 3.0 Programmer Reference
Back | Home
ProcessBySample.cpp
Go to the documentation of this file.
1 
24 #include "ProcessBySample.h"
25 
26 #include "Buffer.h"
27 #include "Cube.h"
28 #include "IException.h"
29 #include "Process.h"
30 #include "ProcessByBrick.h"
31 
32 using namespace std;
33 namespace Isis {
56  Isis::Cube *ProcessBySample::SetInputCube(const QString &parameter,
57  int requirements) {
58  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
59  allRequirements |= requirements;
60  return Process::SetInputCube(parameter, allRequirements);
61  }
62 
63 
76  Isis::Cube *ProcessBySample::SetInputCube(const QString &file,
78  int requirements) {
79  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
80  allRequirements |= requirements;
81  return Process::SetInputCube(file, att, allRequirements);
82  }
83 
84 
100  void ProcessBySample::StartProcess(void funct(Isis::Buffer &inout)) {
101  VerifyCubes(InPlace);
102  SetBricks(InPlace);
103  //SetBrickSizesForProcessCubeInPlace();
104  ProcessByBrick::StartProcess(funct);
105  }
106 
107 
121  void ProcessBySample::StartProcess(void
122  funct(Isis::Buffer &in, Isis::Buffer &out)) {
123 
124  VerifyCubes(InputOutput);
125  SetBricks(InputOutput);
126  //SetBrickSizesForProcessCube();
127  ProcessByBrick::StartProcess(funct);
128  }
129 
130 
143  void ProcessBySample::StartProcess(void funct(std::vector<Isis::Buffer *> &in,
144  std::vector<Isis::Buffer *> &out)) {
145 
146  VerifyCubes(InputOutputList) ;
147  SetBricks(InputOutputList);
148  //SetBrickSizesForProcessCubes();
149  ProcessByBrick::StartProcess(funct);
150  }
151 
152  void ProcessBySample::SetBricks(IOCubes cn){
153 
154  switch(cn){
155 
156  case InPlace:
157  if(InputCubes.size() == 1) SetBrickSize(1, InputCubes[0]->lineCount(), 1);
158  else SetBrickSize(1, OutputCubes[0]->lineCount(), 1);
159 
160  break;
161 
162  case InputOutput:
163 
164  SetInputBrickSize(1, InputCubes[0]->lineCount(), 1);
165  SetOutputBrickSize(1, OutputCubes[0]->lineCount(), 1);
166 
167 
168 
169 
170  break;
171 
172  case InputOutputList:
173 
174  for(unsigned int i = 0; i < InputCubes.size(); i++) {
175  SetInputBrickSize(1, InputCubes[i]->lineCount(), 1, i + 1);
176  }
177  for(unsigned int i = 0; i < OutputCubes.size(); i++) {
178  SetOutputBrickSize(1, OutputCubes[i]->lineCount(), 1, i + 1);
179  }
180 
181  break;
182 
183 
184 
185  }
186 
187 
188  }
189 
190 
191 
192 
193 }
Buffer for reading and writing cube data.
Definition: Buffer.h:68
Manipulate and parse attributes of input cube filenames.
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:26:15