Isis 3.0 Programmer Reference
Back | Home
Process.h
Go to the documentation of this file.
1 #ifndef Process_h
2 #define Process_h
3 
25 #include "Preference.h"
26 
27 #include "Cube.h"
28 #include "Progress.h"
29 #include "CubeAttribute.h"
30 #include "Statistics.h"
31 
32 template <typename T> class QSet;
33 template <typename T> class QList;
34 
35 namespace Isis {
36  const int SizeMatch = 1;
37  const int SpatialMatch = 2;
38  const int OneBand = 16;
39  const int BandMatchOrOne = 32;
40  const int ReadWrite = 64;
41  const int AllMatchOrOne = 128;
42 };
43 
44 namespace Isis {
45  class UserInterface;
46 
157  class Process {
158  protected:
160 
180 
186  std::vector< std::vector< Isis::Statistics * > > p_bandStats;
187 
193  std::vector< Isis::Statistics * > p_cubeStats;
194 
199  std::vector<Isis::Cube *> InputCubes;
200 
205  std::vector<Isis::Cube *> OutputCubes;
206 
214 
215  public:
216  Process();
217  virtual ~Process();
218 
227  virtual void StartProcess(void funct()) {
228  funct();
229  };
230  virtual void EndProcess();
231  virtual void Finalize();
232 
233  virtual Isis::Cube *SetInputCube(const QString &parameter,
234  const int requirements = 0);
235  virtual Isis::Cube *SetInputCube(const QString &fname,
236  const Isis::CubeAttributeInput &att,
237  int requirements = 0);
238  virtual void SetInputCube(Isis::Cube *inCube);
239 
240 
241  virtual Isis::Cube *SetOutputCube(const QString &parameter);
242  virtual Isis::Cube *SetOutputCube(const QString &parameter, const int nsamps,
243  const int nlines, const int nbands = 1);
244  virtual Isis::Cube *SetOutputCube(const QString &fname,
245  const Isis::CubeAttributeOutput &att,
246  const int nsamps, const int nlines,
247  const int nbands = 1);
248 
249  void AddInputCube(Cube *cube, bool owned = true);
250  void AddOutputCube(Cube *cube, bool owned = true);
251 
252  void ClearCubes();
253  void ClearInputCubes();
254  void ClearOutputCubes();
255 
256  void PropagateLabels(const bool prop);
257  void PropagateLabels(const QString &cube);
258  void PropagateTables(const bool prop);
259  void PropagateTables(const QString &fromName, const QList<QString>& tableNames = QList<QString>());
260  void PropagatePolygons(const bool prop);
261  void PropagateHistory(const bool prop);
262  void PropagateOriginalLabel(const bool prop);
263 
270  return p_progress;
271  };
272 
273  QString MissionData(const QString &mission, const QString &file,
274  bool highestVersion = false);
275 
276  void WriteHistory(Cube &cube);
277 
278  void CalculateStatistics();
279 
289  inline std::vector<Isis::Statistics *> BandStatistics(
290  const unsigned index) {
291  return p_bandStats[index];
292  }
293 
304  const unsigned index) {
305  return p_cubeStats[index];
306  }
307  };
308 }
309 
310 #endif
void PropagateTables(const bool prop)
This method allows the programmer to propagate input tables to the output cube (default is true) ...
Definition: Process.cpp:592
Manipulate and parse attributes of input cube filenames.
Definition: Process.h:32
void CalculateStatistics()
Calculates and stores off statistics on every band of every cube added to this process via the SetInp...
Definition: Process.cpp:735
std::vector< Isis::Statistics * > p_cubeStats
Holds the calculated statistics for every band together of every input cubei after the CalculateStati...
Definition: Process.h:193
Process()
Constructs a Process Object.
Definition: Process.cpp:44
void PropagatePolygons(const bool prop)
This method allows the programmer to propagate input blobs to the output cube (default is true) ...
Definition: Process.cpp:639
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition: Process.h:205
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition: Process.cpp:701
bool p_propagateTables
Flag indicating if tables are be propagated to output cubes.
Definition: Process.h:167
bool p_propagatePolygons
Flag indicating if blobs are be propagated to output cubes.
Definition: Process.h:171
QString MissionData(const QString &mission, const QString &file, bool highestVersion=false)
This method reads the mission specific data directory from the user preference file, makes sure that mission is available in the Isis installation, and the attaches the provided input file to the directory in order to create a full file specification.
Definition: Process.cpp:680
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: Process.cpp:481
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:186
void PropagateOriginalLabel(const bool prop)
This method allows the programmer to propagate original labels to the output cube (default is true) ...
Definition: Process.cpp:660
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:109
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time...
Definition: Process.h:227
Program progress reporter.
Definition: Progress.h:58
virtual ~Process()
Destroys the Process Object. It will close all opened cubes.
Definition: Process.cpp:59
void PropagateHistory(const bool prop)
This method allows the programmer to propagate history to the output cube (default is true) ...
Definition: Process.cpp:649
void ClearOutputCubes()
Close owned output cubes from the list and clear the list.
Definition: Process.cpp:531
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:243
Manipulate and parse attributes of output cube filenames.
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:553
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition: Process.cpp:517
bool p_propagateHistory
Flag indicating if history is to be propagated to output cubes.
Definition: Process.h:175
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition: Process.cpp:266
Isis::Progress * Progress()
This method returns a pointer to a Progress object.
Definition: Process.h:269
Isis::Progress * p_progress
Pointer to a Progress object.
Definition: Process.h:159
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition: Process.cpp:507
Isis::Statistics * CubeStatistics(const unsigned index)
Get the Statistics object for all bands of a specified input cube.
Definition: Process.h:303
QSet< Isis::Cube * > * m_ownedCubes
A list of cubes owned by this instant.
Definition: Process.h:213
bool p_propagateOriginalLabel
Flag indicating if original lable is to be propagated to output cubes.
Definition: Process.h:179
Base class for all cube processing derivatives.
Definition: Process.h:157
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition: Process.cpp:489
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition: Process.h:199
IO Handler for Isis Cubes.
Definition: Cube.h:158
bool p_propagateLabels
Flag indicating if labels are be propagated to output cubes.
Definition: Process.h:163
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:289

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:26:07