Isis Developer Reference
Process.h
Go to the documentation of this file.
1#ifndef Process_h
2#define Process_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Preference.h"
10
11#include "Cube.h"
12#include "Progress.h"
13#include "CubeAttribute.h"
14#include "Statistics.h"
15
16template <typename T> class QSet;
17template <typename T> class QList;
18
19namespace Isis {
20 const int SizeMatch = 1;
21 const int SpatialMatch = 2;
22 const int OneBand = 16;
23 const int BandMatchOrOne = 32;
24 const int ReadWrite = 64;
25 const int AllMatchOrOne = 128;
26};
27
28namespace Isis {
29 class UserInterface;
30
143 class Process {
144 protected:
166
172 std::vector< std::vector< Isis::Statistics * > > p_bandStats;
173
179 std::vector< Isis::Statistics * > p_cubeStats;
180
185 std::vector<Isis::Cube *> InputCubes;
186
191 std::vector<Isis::Cube *> OutputCubes;
192
199 QSet<Isis::Cube *> *m_ownedCubes;
200
201 public:
202 Process();
203 virtual ~Process();
204
213 virtual void StartProcess(void funct()) {
214 funct();
215 };
216 virtual void EndProcess();
217 virtual void Finalize();
218
219 virtual Isis::Cube *SetInputCube(const QString &parameter,
220 const int requirements = 0);
221 virtual Isis::Cube *SetInputCube(const QString &fname,
222 const Isis::CubeAttributeInput &att,
223 int requirements = 0);
224 virtual void SetInputCube(Isis::Cube *inCube, int requirements = 0);
225
226 virtual Isis::Cube *SetOutputCube(const QString &parameter);
227 virtual Isis::Cube *SetOutputCubeStretch(const QString &parameter, UserInterface *ui=nullptr);
228 virtual Isis::Cube *SetOutputCube(const QString &parameter, const int nsamps,
229 const int nlines, const int nbands = 1);
230 virtual Isis::Cube *SetOutputCubeStretch(const QString &parameter, const int nsamps,
231 const int nlines, const int nbands = 1, UserInterface *ui=nullptr);
232 virtual Isis::Cube *SetOutputCube(const QString &fname,
233 const Isis::CubeAttributeOutput &att,
234 const int nsamps, const int nlines,
235 const int nbands = 1);
236
237 void AddInputCube(Cube *cube, bool owned = true);
238 void AddOutputCube(Cube *cube, bool owned = true);
239
240 void CheckRequirements(const Cube *cube, const int requirements);
241
242 void ClearCubes();
243 void ClearInputCubes();
244 void ClearOutputCubes();
245
246 void PropagateLabels(const bool prop);
247 void PropagateLabels(const QString &cube);
248 void PropagateTables(const bool prop);
249 void PropagateTables(const QString &fromName, const QList<QString>& tableNames = QList<QString>());
250 void PropagatePolygons(const bool prop);
251 void PropagateHistory(const bool prop);
252 void PropagateOriginalLabel(const bool prop);
253
260 return p_progress;
261 };
262
263 QString MissionData(const QString &mission, const QString &file,
264 bool highestVersion = false);
265
266 void WriteHistory(Cube &cube);
267
268 void CalculateStatistics();
269
279 inline std::vector<Isis::Statistics *> BandStatistics(
280 const unsigned index) {
281 return p_bandStats[index];
282 }
283
294 const unsigned index) {
295 return p_cubeStats[index];
296 }
297 };
298}
299
300#endif
Manipulate and parse attributes of input cube filenames.
Definition CubeAttribute.h:381
Manipulate and parse attributes of output cube filenames.
Definition CubeAttribute.h:473
IO Handler for Isis Cubes.
Definition Cube.h:168
Base class for all cube processing derivatives.
Definition Process.h:143
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time.
Definition Process.h:213
Isis::Statistics * CubeStatistics(const unsigned index)
Get the Statistics object for all bands of a specified input cube.
Definition Process.h:293
void PropagateLabels(const bool prop)
This method allows the programmer to turn on/off the propagation of labels from the 1st input cube to...
Definition Process.cpp:652
bool p_propagatePolygons
Flag indicating if blobs are be propagated to output cubes.
Definition Process.h:157
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition Process.cpp:462
void PropagateHistory(const bool prop)
This method allows the programmer to propagate history to the output cube (default is true)
Definition Process.cpp:755
bool p_propagateOriginalLabel
Flag indicating if original lable is to be propagated to output cubes.
Definition Process.h:165
bool p_propagateLabels
Flag indicating if labels are be propagated to output cubes.
Definition Process.h:149
std::vector< std::vector< Isis::Statistics * > > p_bandStats
Holds the calculated statistics for each band separately of every input cubei after the CalculateStat...
Definition Process.h:172
virtual ~Process()
Destroys the Process Object. It will close all opened cubes.
Definition Process.cpp:44
std::vector< Isis::Statistics * > p_cubeStats
Holds the calculated statistics for every band together of every input cubei after the CalculateStati...
Definition Process.h:179
void PropagateOriginalLabel(const bool prop)
This method allows the programmer to propagate original labels to the output cube (default is true)
Definition Process.cpp:767
Process()
Constructs a Process Object.
Definition Process.cpp:29
void AddOutputCube(Cube *cube, bool owned=true)
Definition Process.cpp:482
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition Process.h:185
QString MissionData(const QString &mission, const QString &file, bool highestVersion=false)
This method reads the mission specific data directory from the user preference file,...
Definition Process.cpp:788
void PropagateTables(const bool prop)
This method allows the programmer to propagate input tables to the output cube (default is true)
Definition Process.cpp:693
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition Process.cpp:822
void AddInputCube(Cube *cube, bool owned=true)
Definition Process.cpp:476
virtual Isis::Cube * SetOutputCubeStretch(const QString &parameter, UserInterface *ui=nullptr)
Allocates a user-specified output cube whose size matches the first input cube.
Definition Process.cpp:196
QSet< Isis::Cube * > * m_ownedCubes
A list of cubes owned by this instant.
Definition Process.h:199
bool p_propagateHistory
Flag indicating if history is to be propagated to output cubes.
Definition Process.h:161
Isis::Progress * p_progress
Pointer to a Progress object.
Definition Process.h:145
Isis::Progress * Progress()
This method returns a pointer to a Progress object.
Definition Process.h:259
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition Process.cpp:163
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition Process.h:191
void CalculateStatistics()
Calculates and stores off statistics on every band of every cube added to this process via the SetInp...
Definition Process.cpp:858
std::vector< Isis::Statistics * > BandStatistics(const unsigned index)
Get the vector of Statistics objects for each band separately of a specified input cube.
Definition Process.h:279
void CheckRequirements(const Cube *cube, const int requirements)
Checks to make sure the input cube meets the inputted requirements.
Definition Process.cpp:513
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
void PropagatePolygons(const bool prop)
This method allows the programmer to propagate input blobs to the output cube (default is true)
Definition Process.cpp:744
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition Process.cpp:614
bool p_propagateTables
Flag indicating if tables are be propagated to output cubes.
Definition Process.h:153
void ClearOutputCubes()
Close owned output cubes from the list and clear the list.
Definition Process.cpp:629
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition Process.cpp:603
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition Process.cpp:471
Program progress reporter.
Definition Progress.h:42
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
Command Line and Xml loader, validation, and access.
Definition UserInterface.h:139
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Process.h:16
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
const int SizeMatch
Definition Process.h:20
const int SpatialMatch
Definition Process.h:21
const int ReadWrite
Definition Process.h:24
const int AllMatchOrOne
Definition Process.h:25
const int BandMatchOrOne
Definition Process.h:23
const int OneBand
Definition Process.h:22