Isis Developer Reference
ProcessBySpectra.h
Go to the documentation of this file.
1 #ifndef ProcessBySpectra_h
2 #define ProcessBySpectra_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "ProcessByBrick.h"
10 #include "Buffer.h"
11 
12 namespace Isis {
39  private:
40  int p_spectraType;
43  public:
55  ProcessBySpectra(const int type = PerPixel): ProcessByBrick() {
56  SetType(type);
57  };
58 
59  using Isis::ProcessByBrick::SetInputCube; // Make parent functions visable
60  Isis::Cube *SetInputCube(const QString &parameter,
61  const int requirements = 0);
62  Isis::Cube *SetInputCube(const QString &file,
64  const int requirements = 0);
65 
66  void SetType(const int type);
67 
77  int Type() {
78  return p_spectraType;
79  };
80 
81  void StartProcess(void funct(Isis::Buffer &in));
82 
83  void StartProcess(void funct(Isis::Buffer &in, Isis::Buffer &out));
84 
85  void StartProcess(void funct(std::vector<Isis::Buffer *> &in,
86  std::vector<Isis::Buffer *> &out));
87 
88 
94  template <typename Functor>
95  void ProcessCubeInPlace(const Functor & funct, bool threaded = true) {
96  //SetBrickSizesForProcessCubeInPlace();
98  SetBricks(InPlace);
99  ProcessByBrick::ProcessCubeInPlace(funct, threaded);
100  }
101 
107  template <typename Functor>
108  void ProcessCube(const Functor & funct, bool threaded = true) {
109  //SetBrickSizesForProcessCube();
111  SetBricks(InputOutput);
112  ProcessByBrick::ProcessCube(funct, threaded);
113  }
114 
120  template <typename Functor>
121  void ProcessCubes(const Functor & funct, bool threaded = true) {
123  SetBricks(InputOutputList);
124  //SetBrickSizesForProcessCubes();
125  ProcessByBrick::ProcessCubes(funct, threaded);
126  }
127 
128  static const int PerPixel = 0;
129  static const int ByLine = 1;
130  static const int BySample = 2;
131 
132  private:
133 
134  void SetBricks(IOCubes cn);
135  void SetBrickSizesForProcessCubeInPlace();
136  void SetBrickSizesForProcessCube();
137  void SetBrickSizesForProcessCubes();
138  };
139 };
140 
141 #endif
Isis::ProcessBySpectra::PerPixel
static const int PerPixel
PerPixel spectra type (equal to 0)
Definition: ProcessBySpectra.h:128
Cube.h
Isis::ProcessByBrick::VerifyCubes
void VerifyCubes(IOCubes cn)
Verifies the dimensions of the input/output cubes.
Definition: ProcessByBrick.cpp:120
Isis::ProcessBySpectra::Type
int Type()
Returns the spectra type:
Definition: ProcessBySpectra.h:77
Process.h
ProcessBySpectra.h
Isis::ProcessByBrick::SetInputCube
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:136
Isis::ProcessBySpectra::ProcessCubes
void ProcessCubes(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:121
Isis::ProcessByBrick::ProcessCubeInPlace
void ProcessCubeInPlace(const Functor &functor, bool threaded=true)
Operate over a single cube (either input or output).
Definition: ProcessByBrick.h:163
Isis::ProcessBySpectra::BySample
static const int BySample
BySample spectra type (equal to 2)
Definition: ProcessBySpectra.h:130
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::ProcessByBrick::IOCubes
IOCubes
Definition: ProcessByBrick.h:89
ProcessByBrick.h
Buffer.h
Isis::ProcessByBrick::ProcessCube
void ProcessCube(const Functor &functor, bool threaded=true)
Operate over a single input cube creating a separate output cube.
Definition: ProcessByBrick.h:200
Isis::ProcessBySpectra::StartProcess
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:81
Isis::ProcessBySpectra::ProcessBySpectra
ProcessBySpectra(const int type=PerPixel)
Constructs ProcessBySpectra object using specified spectra type.
Definition: ProcessBySpectra.h:55
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ProcessByBrick
Process cubes by brick.
Definition: ProcessByBrick.h:81
Isis::ProcessBySpectra::ProcessCubeInPlace
void ProcessCubeInPlace(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:95
Isis::ProcessByBrick::ProcessCubes
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:239
Isis::ProcessByBrick::InPlace
@ InPlace
Definition: ProcessByBrick.h:89
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::SpatialMatch
const int SpatialMatch
Definition: Process.h:21
Isis::ProcessByBrick::InputOutputList
@ InputOutputList
Definition: ProcessByBrick.h:91
Isis::ProcessBySpectra::SetType
void SetType(const int type)
Sets the spectra type to one of the following:
Definition: ProcessBySpectra.cpp:143
IException.h
std
Namespace for the standard library.
Isis::ProcessBySpectra::ByLine
static const int ByLine
ByLine spectra type (equal to 1)
Definition: ProcessBySpectra.h:129
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
Isis::ProcessBySpectra
Process cubes by spectra.
Definition: ProcessBySpectra.h:38
Isis::ProcessBySpectra::ProcessCube
void ProcessCube(const Functor &funct, bool threaded=true)
Definition: ProcessBySpectra.h:108
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProcessByBrick::InputOutput
@ InputOutput
Definition: ProcessByBrick.h:90