Isis 3 Developer 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:
56  int p_spectraType;
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();
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();
127  SetBricks(InputOutput);
128  ProcessByBrick::ProcessCube(funct, threaded);
129  }
130 
136  template <typename Functor>
137  void ProcessCubes(const Functor & funct, bool threaded = true) {
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.
Definition: CubeAttribute.h:397
Definition: ProcessByBrick.h:106
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
Definition: ProcessByBrick.cpp:136
Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition: ProcessBySpectra.cpp:57
Process cubes by spectra.
Definition: ProcessBySpectra.h:54
IOCubes
Definition: ProcessByBrick.h:105
Definition: ProcessByBrick.h:105
void ProcessCubes(const Functor &functor, bool threaded=true)
Operate over an arbitrary number of input cubes given an arbitrary number of output cubes...
Definition: ProcessByBrick.h:255
Definition: ProcessByBrick.h:107
Cube * SetInputCube(const QString &parameter, int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition: ProcessByBrick.cpp:74
Process cubes by brick.
Definition: ProcessByBrick.h:97
static const int ByLine
ByLine spectra type (equal to 1)
Definition: ProcessBySpectra.h:145
int Type()
Returns the spectra type:
Definition: ProcessBySpectra.h:93
void ProcessCubeInPlace(const Functor &functor, bool threaded=true)
Operate over a single cube (either input or output).
Definition: ProcessByBrick.h:179
void ProcessCubeInPlace(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:111
void ProcessCube(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:124
ProcessBySpectra(const int type=PerPixel)
Constructs ProcessBySpectra object using specified spectra type.
Definition: ProcessBySpectra.h:71
void ProcessCubes(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:137
static const int BySample
BySample spectra type (equal to 2)
Definition: ProcessBySpectra.h:146
void ProcessCube(const Functor &functor, bool threaded=true)
Operate over a single input cube creating a separate output cube.
Definition: ProcessByBrick.h:216
void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process by spectra operation over a single input or output cube...
Definition: ProcessBySpectra.cpp:97
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void SetType(const int type)
Sets the spectra type to one of the following:
Definition: ProcessBySpectra.cpp:159
static const int PerPixel
PerPixel spectra type (equal to 0)
Definition: ProcessBySpectra.h:144
IO Handler for Isis Cubes.
Definition: Cube.h:170