Isis 3.0 Programmer Reference
Back | Home
ProcessByLine.cpp
Go to the documentation of this file.
1 
24 #include "ProcessByLine.h"
25 
26 #include "Buffer.h"
27 #include "Cube.h"
28 #include "IException.h"
29 #include "Process.h"
30 #include "ProcessByBrick.h"
31 
32 
33 using namespace std;
34 namespace Isis {
57  Isis::Cube *ProcessByLine::SetInputCube(const QString &parameter,
58  const int requirements) {
59  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
60  allRequirements |= requirements;
61  return Process::SetInputCube(parameter, allRequirements);
62  }
63 
79  Isis::Cube *ProcessByLine::SetInputCube(const QString &file,
81  const int requirements) {
82  int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
83  allRequirements |= requirements;
84  return Process::SetInputCube(file, att, allRequirements);
85  }
86 
87 
96  void ProcessByLine::SetInputCube(Isis::Cube *inCube)
97  {
98  Process::SetInputCube(inCube);
99  }
100 
101 
102 
103  void ProcessByLine::SetBricks(IOCubes cn){
104 
105  switch(cn){
106 
107  case InPlace:
108 
109  if(InputCubes.size() == 1) {
110  SetBrickSize(InputCubes[0]->sampleCount(), 1, 1);
111  }
112 
113  else {
114  SetBrickSize(OutputCubes[0]->sampleCount(), 1, 1);
115  }
116 
117  break;
118 
119 
120  case InputOutput:
121 
122  SetInputBrickSize(InputCubes[0]->sampleCount(), 1, 1);
123  SetOutputBrickSize(OutputCubes[0]->sampleCount(), 1, 1);
124 
125  break;
126 
127 
128  case InputOutputList:
129 
130  for(unsigned int i = 0; i < InputCubes.size(); i++) {
131  SetInputBrickSize(InputCubes[i]->sampleCount(), 1, 1, i + 1);
132  }
133  for(unsigned int i = 0; i < OutputCubes.size(); i++) {
134  SetOutputBrickSize(OutputCubes[i]->sampleCount(), 1, 1, i + 1);
135  }
136 
137 
138  break;
139 
140 
141  }
142 
143 
144 
145  }
146 
147 
148 
168  void ProcessByLine::StartProcess(void funct(Isis::Buffer &inout)) {
169 
170 
171  VerifyCubes(InPlace);
172  SetBricks(InPlace);
173  ProcessByBrick::StartProcess(funct);
174  }
175 
176 
177 
190  void ProcessByLine::StartProcess(void funct(Isis::Buffer &in, Isis::Buffer &out)) {
191 
192  VerifyCubes(InputOutput);
193  SetBricks(InputOutput);
194  ProcessByBrick::StartProcess(funct);
195  }
196 
197 
198 
199 
211  void ProcessByLine::StartProcess( void funct(std::vector<Isis::Buffer *> &in,
212  std::vector<Isis::Buffer *> &out)) {
213 
214  VerifyCubes(InputOutputList);
215  SetBricks(InputOutputList);
216  ProcessByBrick::StartProcess(funct);
217  }
218 }
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:12