Isis 3 Programmer Reference
ProcessBySample.cpp
1
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "ProcessBySample.h"
8
9#include "Buffer.h"
10#include "Cube.h"
11#include "IException.h"
12#include "Process.h"
13#include "ProcessByBrick.h"
14
15using namespace std;
16namespace Isis {
37 Isis::Cube *ProcessBySample::SetInputCube(const QString &parameter,
38 int requirements) {
39 int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
40 allRequirements |= requirements;
41 return Process::SetInputCube(parameter, allRequirements);
42 }
43
44
59 int requirements) {
60 int allRequirements = Isis::SpatialMatch | Isis::BandMatchOrOne;
61 allRequirements |= requirements;
62 return Process::SetInputCube(file, att, allRequirements);
63 }
64
65
78 VerifyCubes(InPlace);
79 SetBricks(InPlace);
81 }
82
83
95 Isis::Buffer &out)) {
96 VerifyCubes(InputOutput);
97 SetBricks(InputOutput);
99 }
100
101
111 void ProcessBySample::StartProcess(void funct(std::vector<Isis::Buffer *> &in,
112 std::vector<Isis::Buffer *> &out)) {
113 VerifyCubes(InputOutputList) ;
114 SetBricks(InputOutputList);
116 }
117
118
119 void ProcessBySample::SetBricks(IOCubes cn){
120 switch(cn){
121 case InPlace:
122 if (InputCubes.size() == 1) {
123 SetBrickSize(1, InputCubes[0]->lineCount(), 1);
124 }
125 else {
126 SetBrickSize(1, OutputCubes[0]->lineCount(), 1);
127 }
128 break;
129
130 case InputOutput:
131 SetInputBrickSize(1, InputCubes[0]->lineCount(), 1);
132 SetOutputBrickSize(1, OutputCubes[0]->lineCount(), 1);
133 break;
134
135 case InputOutputList:
136 for(unsigned int i = 0; i < InputCubes.size(); i++) {
137 SetInputBrickSize(1, InputCubes[i]->lineCount(), 1, i + 1);
138 }
139 for(unsigned int i = 0; i < OutputCubes.size(); i++) {
140 SetOutputBrickSize(1, OutputCubes[i]->lineCount(), 1, i + 1);
141 }
142 break;
143 }
144 }
145}
Buffer for reading and writing cube data.
Definition Buffer.h:53
Manipulate and parse attributes of input cube filenames.
IO Handler for Isis Cubes.
Definition Cube.h:168
void SetOutputBrickSize(int ns, int nl, int nb)
Sets the size of all output bricks.
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
void SetInputBrickSize(int ns, int nl, int nb)
Sets the size of all input bricks.
virtual void StartProcess(void funct(Buffer &in))
Starts the systematic processing of the input cube by moving an arbitrarily-shaped brick through the ...
void SetBrickSize(int ns, int nl, int nb)
Sets the input and output bricks sizes to the given number of samples, lines, and bands.
Isis::Cube * SetInputCube(const QString &parameter, int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
void StartProcess(void funct(Isis::Buffer &inout))
This method invokes the process by sample operation over a single input or output cube.
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition Process.h:185
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition Process.h:191
virtual Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition Process.cpp:139
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.