File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
Process.h
Go to the documentation of this file.
1 #ifndef Process_h
2 #define Process_h
3 
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 
16 template <typename T> class QSet;
17 template <typename T> class QList;
18 
19 namespace 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 
28 namespace Isis {
29  class UserInterface;
30 
143  class Process {
144  protected:
146 
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 
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
IsisAml::GetOutputAttribute
Isis::CubeAttributeOutput & GetOutputAttribute(const QString &paramName)
Gets the attributes for an output cube.
Definition: IsisAml.cpp:1919
Isis::Process::CalculateStatistics
void CalculateStatistics()
Calculates and stores off statistics on every band of every cube added to this process via the SetInp...
Definition: Process.cpp:824
Isis::iApp
Application * iApp
Definition: Application.cpp:51
FileName.h
Isis::Process::p_cubeStats
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
Isis::Process::PropagateTables
void PropagateTables(const bool prop)
This method allows the programmer to propagate input tables to the output cube (default is true)
Definition: Process.cpp:678
Isis::Process::InputCubes
std::vector< Isis::Cube * > InputCubes
A vector of pointers to opened Cube objects.
Definition: Process.h:185
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Cube.h
Isis::PvlObject::group
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
Isis::Cube::readHistory
History readHistory(const QString &name="IsisCube") const
Read the History from the Cube.
Definition: Cube.cpp:847
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::LineManager
Buffer manager, for moving through a cube in lines.
Definition: LineManager.h:39
Isis::Cube::setVirtualBands
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
Definition: Cube.cpp:1321
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
QList< QString >
Isis::Process::Process
Process()
Constructs a Process Object.
Definition: Process.cpp:28
Isis::Process::WriteHistory
void WriteHistory(Cube &cube)
Writes out the History blob to the cube.
Definition: Process.cpp:789
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
QSet
This is free and unencumbered software released into the public domain.
Definition: Process.h:16
Process.h
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
Isis::Buffer::DoubleBuffer
double * DoubleBuffer() const
Returns the value of the shape buffer.
Definition: Buffer.h:138
Isis::PvlObject::groups
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
Isis::Process::p_propagateTables
bool p_propagateTables
Flag indicating if tables are be propagated to output cubes.
Definition: Process.h:153
Isis::FileName::fileExists
bool fileExists() const
Returns true if the file exists; false otherwise.
Definition: FileName.cpp:449
Isis::Process::SetOutputCubeStretch
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:193
IsisAml::GetFileName
QString GetFileName(const QString &paramName, QString extension="") const
Allows the retrieval of a value for a parameter of type "filename".
Definition: IsisAml.cpp:607
Isis::Cube::setLabelSize
void setLabelSize(int labelBytes)
Used prior to the Create method, this will allocate a specific number of bytes in the label area for ...
Definition: Cube.cpp:1291
Isis::Process::PropagatePolygons
void PropagatePolygons(const bool prop)
This method allows the programmer to propagate input blobs to the output cube (default is true)
Definition: Process.cpp:727
Isis::Process::OutputCubes
std::vector< Isis::Cube * > OutputCubes
A vector of pointers to allocated Cube objects.
Definition: Process.h:191
LineManager.h
Isis::Cube::labelSize
int labelSize(bool actual=false) const
Returns the number of bytes used by the label.
Definition: Cube.cpp:1713
Isis::UnsignedWord
@ UnsignedWord
Definition: PixelType.h:31
Isis::Process
Base class for all cube processing derivatives.
Definition: Process.h:143
Isis::Cube::close
void close(bool remove=false)
Closes the cube and updates the labels.
Definition: Cube.cpp:260
Isis::Process::MissionData
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:768
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::PvlObject::objects
int objects() const
Returns the number of objects.
Definition: PvlObject.h:219
Isis::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
Isis::PvlObject::addObject
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Isis::Process::p_propagatePolygons
bool p_propagatePolygons
Flag indicating if blobs are be propagated to output cubes.
Definition: Process.h:157
Isis::Process::CheckRequirements
void CheckRequirements(const Cube *cube, const int requirements)
Checks to make sure the input cube meets the inputted requirements.
Definition: Process.cpp:503
Isis::SignedWord
@ SignedWord
Definition: PixelType.h:32
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
Isis::Process::AddOutputCube
void AddOutputCube(Cube *cube, bool owned=true)
Definition: Process.cpp:472
Preference.h
Isis::Process::StartProcess
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::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
IString.h
Isis::Process::EndProcess
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: Process.cpp:455
Isis::Process::PropagateOriginalLabel
void PropagateOriginalLabel(const bool prop)
This method allows the programmer to propagate original labels to the output cube (default is true)
Definition: Process.cpp:748
Isis::Process::p_bandStats
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
Isis::Process::~Process
virtual ~Process()
Destroys the Process Object. It will close all opened cubes.
Definition: Process.cpp:43
OriginalLabel.h
Isis::AttachedLabel
@ AttachedLabel
The input label is embedded in the image file.
Definition: CubeAttribute.h:32
Isis::ReadWrite
const int ReadWrite
Definition: Process.h:24
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Process::ClearInputCubes
void ClearInputCubes()
Close owned input cubes from the list and clear the list.
Definition: Process.cpp:603
Isis::Cube::setDimensions
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
Definition: Cube.cpp:1217
Isis::Cube::create
void create(const QString &cfile)
This method will create an isis cube for writing.
Definition: Cube.cpp:414
Isis::Process::PropagateHistory
void PropagateHistory(const bool prop)
This method allows the programmer to propagate history to the output cube (default is true)
Definition: Process.cpp:737
Isis::PvlContainer::isNamed
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
Isis::Progress::SetText
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
Application.h
Isis::Process::ClearOutputCubes
void ClearOutputCubes()
Close owned output cubes from the list and clear the list.
Definition: Process.cpp:617
Isis::Process::AddInputCube
void AddInputCube(Cube *cube, bool owned=true)
Definition: Process.cpp:467
Isis::CubeAttributeOutput::pixelType
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
Definition: CubeAttribute.cpp:360
Isis::Process::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::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::CubeAttributeOutput::propagateMinimumMaximum
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
Definition: CubeAttribute.cpp:177
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::Process::PropagateLabels
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:639
Isis::History::AddEntry
void AddEntry()
Adds History PvlObject.
Definition: History.cpp:52
History.h
Isis::Process::Progress
Isis::Progress * Progress()
This method returns a pointer to a Progress object.
Definition: Process.h:259
Isis::Cube::isOpen
bool isOpen() const
Test if a cube file has been opened/created.
Definition: Cube.cpp:183
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Cube::bandCount
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition: Cube.cpp:1410
Isis::SpatialMatch
const int SpatialMatch
Definition: Process.h:21
Isis::BandMatchOrOne
const int BandMatchOrOne
Definition: Process.h:23
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::Process::p_propagateHistory
bool p_propagateHistory
Flag indicating if history is to be propagated to output cubes.
Definition: Process.h:161
Isis::PvlObject::hasObject
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition: PvlObject.h:323
Isis::CubeAttributeOutput::labelAttachment
LabelAttachment labelAttachment() const
Definition: CubeAttribute.cpp:400
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Isis::Cube::setByteOrder
void setByteOrder(ByteOrder byteOrder)
Used prior to the Create method, this will specify the byte order of pixels, either least or most sig...
Definition: Cube.cpp:1202
Isis::Process::SetOutputCube
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition: Process.cpp:160
Statistics.h
Isis::UnsignedInteger
@ UnsignedInteger
Definition: PixelType.h:33
Isis::LineManager::SetLine
bool SetLine(const int line, const int band=1)
Positions the buffer at the requested line and returns a status indicator if the set was succesful or...
Definition: LineManager.cpp:44
IException.h
Isis::SizeMatch
const int SizeMatch
Definition: Process.h:20
Isis::CubeAttributeInput::bands
std::vector< QString > bands() const
Return a vector of the input bands specified.
Definition: CubeAttribute.cpp:82
std
Namespace for the standard library.
Isis::OriginalLabel
Read and store original labels.
Definition: OriginalLabel.h:35
Isis::Cube::pixelType
PixelType pixelType() const
Definition: Cube.cpp:1758
Isis::CubeAttributeOutput::byteOrder
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
Definition: CubeAttribute.cpp:455
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::SignedInteger
@ SignedInteger
Definition: PixelType.h:34
Isis::Cube::write
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition: Cube.cpp:971
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
Isis::Process::p_progress
Isis::Progress * p_progress
Pointer to a Progress object.
Definition: Process.h:145
Isis::CubeAttributeOutput::maximum
double maximum() const
Return the output cube attribute maximum.
Definition: CubeAttribute.cpp:309
Isis::Buffer::size
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
Isis::CubeAttributeOutput::minimum
double minimum() const
Return the output cube attribute minimum.
Definition: CubeAttribute.cpp:294
Isis::Cube::setFormat
void setFormat(Format format)
Used prior to the Create method, this will specify the format of the cube, either band,...
Definition: Cube.cpp:1266
Isis::Cube::setPixelType
void setPixelType(PixelType pixelType)
Used prior to the Create method, this will specify the output pixel type.
Definition: Cube.cpp:1304
Isis::Process::m_ownedCubes
QSet< Isis::Cube * > * m_ownedCubes
A list of cubes owned by this instant.
Definition: Process.h:199
Isis::Preference::Preferences
static Preference & Preferences(bool unitTest=false)
Definition: Preference.cpp:86
Isis::FileName::highestVersion
FileName highestVersion() const
Searches the directory specified in the file name for the highest version of the file name.
Definition: FileName.cpp:313
Isis::Process::CubeStatistics
Isis::Statistics * CubeStatistics(const unsigned index)
Get the Statistics object for all bands of a specified input cube.
Definition: Process.h:293
Isis::History
Definition: History.h:38
Isis::Cube::setBaseMultiplier
void setBaseMultiplier(double base, double mult)
Used prior to the Create method, this will specify the base and multiplier for converting 8-bit/16-bi...
Definition: Cube.cpp:1151
Isis::Process::ClearCubes
void ClearCubes()
Close owned cubes from the list and clear the list.
Definition: Process.cpp:593
Isis::Process::Finalize
virtual void Finalize()
Cleans up by closing cubes and freeing memory for owned cubes.
Definition: Process.cpp:463
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
Isis::Blob
Definition: Blob.h:51
Isis::CubeAttributeOutput::fileFormat
Cube::Format fileFormat() const
Return the file format an Cube::Format.
Definition: CubeAttribute.cpp:267
Isis::UnsignedByte
@ UnsignedByte
Definition: PixelType.h:29
Isis::Cube::setMinMax
void setMinMax(double min, double max)
Used prior to the Create method, this will compute a good base and multiplier value given the minimum...
Definition: Cube.cpp:1168
Isis::CubeAttributeOutput::propagatePixelType
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
Definition: CubeAttribute.cpp:165
Progress.h
Isis::Process::BandStatistics
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
Isis::Process::p_propagateLabels
bool p_propagateLabels
Flag indicating if labels are be propagated to output cubes.
Definition: Process.h:149
CubeAttribute.h
Isis::Process::p_propagateOriginalLabel
bool p_propagateOriginalLabel
Flag indicating if original lable is to be propagated to output cubes.
Definition: Process.h:165
Isis::OneBand
const int OneBand
Definition: Process.h:22
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Message.h
Isis::Cube::setLabelsAttached
void setLabelsAttached(bool attached)
Use prior to calling create, this sets whether or not to use separate label and data files.
Definition: Cube.cpp:1278
Isis::AllMatchOrOne
const int AllMatchOrOne
Definition: Process.h:25
Isis::Real
@ Real
Definition: PixelType.h:35
SessionLog.h

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 USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:12:08