Isis 3 Programmer Reference
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 
158  class Process {
159  protected:
161 
181 
187  std::vector< std::vector< Isis::Statistics * > > p_bandStats;
188 
194  std::vector< Isis::Statistics * > p_cubeStats;
195 
200  std::vector<Isis::Cube *> InputCubes;
201 
206  std::vector<Isis::Cube *> OutputCubes;
207 
215 
216  public:
217  Process();
218  virtual ~Process();
219 
228  virtual void StartProcess(void funct()) {
229  funct();
230  };
231  virtual void EndProcess();
232  virtual void Finalize();
233 
234  virtual Isis::Cube *SetInputCube(const QString &parameter,
235  const int requirements = 0);
236  virtual Isis::Cube *SetInputCube(const QString &fname,
237  const Isis::CubeAttributeInput &att,
238  int requirements = 0);
239  virtual void SetInputCube(Isis::Cube *inCube);
240 
241 
242  virtual Isis::Cube *SetOutputCube(const QString &parameter);
243  virtual Isis::Cube *SetOutputCube(const QString &parameter, const int nsamps,
244  const int nlines, const int nbands = 1);
245  virtual Isis::Cube *SetOutputCube(const QString &fname,
246  const Isis::CubeAttributeOutput &att,
247  const int nsamps, const int nlines,
248  const int nbands = 1);
249 
250  void AddInputCube(Cube *cube, bool owned = true);
251  void AddOutputCube(Cube *cube, bool owned = true);
252 
253  void ClearCubes();
254  void ClearInputCubes();
255  void ClearOutputCubes();
256 
257  void PropagateLabels(const bool prop);
258  void PropagateLabels(const QString &cube);
259  void PropagateTables(const bool prop);
260  void PropagateTables(const QString &fromName, const QList<QString>& tableNames = QList<QString>());
261  void PropagatePolygons(const bool prop);
262  void PropagateHistory(const bool prop);
263  void PropagateOriginalLabel(const bool prop);
264 
271  return p_progress;
272  };
273 
274  QString MissionData(const QString &mission, const QString &file,
275  bool highestVersion = false);
276 
277  void WriteHistory(Cube &cube);
278 
279  void CalculateStatistics();
280 
290  inline std::vector<Isis::Statistics *> BandStatistics(
291  const unsigned index) {
292  return p_bandStats[index];
293  }
294 
305  const unsigned index) {
306  return p_cubeStats[index];
307  }
308  };
309 }
310 
311 #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:594
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:737
std::vector< Isis::Statistics *> p_cubeStats
Holds the calculated statistics for every band together of every input cubei after the CalculateStati...
Definition: Process.h:194
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:641
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition: Process.h:206
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition: Process.cpp:703
bool p_propagateTables
Flag indicating if tables are be propagated to output cubes.
Definition: Process.h:168
bool p_propagatePolygons
Flag indicating if blobs are be propagated to output cubes.
Definition: Process.h:172
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:682
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: Process.cpp:483
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:187
void PropagateOriginalLabel(const bool prop)
This method allows the programmer to propagate original labels to the output cube (default is true) ...
Definition: Process.cpp:662
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time...
Definition: Process.h:228
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:651
void ClearOutputCubes()
Close owned output cubes from the list and clear the list.
Definition: Process.cpp:533
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:555
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition: Process.cpp:519
bool p_propagateHistory
Flag indicating if history is to be propagated to output cubes.
Definition: Process.h:176
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:270
Isis::Progress * p_progress
Pointer to a Progress object.
Definition: Process.h:160
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition: Process.cpp:509
Isis::Statistics * CubeStatistics(const unsigned index)
Get the Statistics object for all bands of a specified input cube.
Definition: Process.h:304
QSet< Isis::Cube * > * m_ownedCubes
A list of cubes owned by this instant.
Definition: Process.h:214
bool p_propagateOriginalLabel
Flag indicating if original lable is to be propagated to output cubes.
Definition: Process.h:180
Base class for all cube processing derivatives.
Definition: Process.h:158
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition: Process.cpp:491
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition: Process.h:200
IO Handler for Isis Cubes.
Definition: Cube.h:170
bool p_propagateLabels
Flag indicating if labels are be propagated to output cubes.
Definition: Process.h:164
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:290