Isis 3 Programmer Reference
ProcessBySpectra.h
Go to the documentation of this file.
1 #ifndef ProcessBySpectra_h
2 #define ProcessBySpectra_h
3 
25 #include "ProcessByBrick.h"
26 #include "Buffer.h"
27 
28 namespace Isis {
55  private:
59  public:
71  ProcessBySpectra(const int type = PerPixel): ProcessByBrick() {
72  SetType(type);
73  };
74 
75  using Isis::ProcessByBrick::SetInputCube; // Make parent functions visable
76  Isis::Cube *SetInputCube(const QString &parameter,
77  const int requirements = 0);
78  Isis::Cube *SetInputCube(const QString &file,
80  const int requirements = 0);
81 
82  void SetType(const int type);
83 
93  int Type() {
94  return p_spectraType;
95  };
96 
97  void StartProcess(void funct(Isis::Buffer &in));
98 
99  void StartProcess(void funct(Isis::Buffer &in, Isis::Buffer &out));
100 
101  void StartProcess(void funct(std::vector<Isis::Buffer *> &in,
102  std::vector<Isis::Buffer *> &out));
103 
104 
110  template <typename Functor>
111  void ProcessCubeInPlace(const Functor & funct, bool threaded = true) {
112  //SetBrickSizesForProcessCubeInPlace();
113  VerifyCubes(InPlace);
114  SetBricks(InPlace);
115  ProcessByBrick::ProcessCubeInPlace(funct, threaded);
116  }
117 
123  template <typename Functor>
124  void ProcessCube(const Functor & funct, bool threaded = true) {
125  //SetBrickSizesForProcessCube();
126  VerifyCubes(InputOutput);
127  SetBricks(InputOutput);
128  ProcessByBrick::ProcessCube(funct, threaded);
129  }
130 
136  template <typename Functor>
137  void ProcessCubes(const Functor & funct, bool threaded = true) {
138  VerifyCubes(InputOutputList);
139  SetBricks(InputOutputList);
140  //SetBrickSizesForProcessCubes();
141  ProcessByBrick::ProcessCubes(funct, threaded);
142  }
143 
144  static const int PerPixel = 0;
145  static const int ByLine = 1;
146  static const int BySample = 2;
147 
148  private:
149 
150  void SetBricks(IOCubes cn);
151  void SetBrickSizesForProcessCubeInPlace();
152  void SetBrickSizesForProcessCube();
153  void SetBrickSizesForProcessCubes();
154  };
155 };
156 
157 #endif
Buffer for reading and writing cube data.
Definition: Buffer.h:69
Manipulate and parse attributes of input cube filenames.
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Process cubes by spectra.
void ProcessCubes(const Functor &functor, bool threaded=true)
Operate over an arbitrary number of input cubes given an arbitrary number of output cubes...
Cube * SetInputCube(const QString &parameter, int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Process cubes by brick.
static const int ByLine
ByLine spectra type (equal to 1)
int p_spectraType
Spectra type: valid values are 0 (PerPixel), 1 (ByLine), or 2 (BySample)
int Type()
Returns the spectra type:
void ProcessCubeInPlace(const Functor &functor, bool threaded=true)
Operate over a single cube (either input or output).
void ProcessCubeInPlace(const Functor &funct, bool threaded=true)
void ProcessCube(const Functor &funct, bool threaded=true)
ProcessBySpectra(const int type=PerPixel)
Constructs ProcessBySpectra object using specified spectra type.
void ProcessCubes(const Functor &funct, bool threaded=true)
static const int BySample
BySample spectra type (equal to 2)
void ProcessCube(const Functor &functor, bool threaded=true)
Operate over a single input cube creating a separate output cube.
void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process by spectra operation over a single input or output cube...
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void SetType(const int type)
Sets the spectra type to one of the following:
static const int PerPixel
PerPixel spectra type (equal to 0)
IO Handler for Isis Cubes.
Definition: Cube.h:170