USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Process Class Reference
[High Level Cube I/O]

#include <Process.h>

Inheritance diagram for Isis::Process:

Inheritance graph
[legend]
Collaboration diagram for Isis::Process:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for all cube processing derivatives.

This is the core of the Isis system. Process, a very important base class is often used to derive new classes which process cubes in a systematic manner. Some of these derived classes include ProcessByLine, FilterProcess, RubberSheet, and Export. For history buffs, the Process class equates to DOCUBE in Isis 2.0 and DOIO in PICS. Essentially, this class manages much of the tedious programming work for cube i/o, user interaction, history, etc.

If you would like to see Process being used in implementation, see stats.cpp. For classes that inherit from Process, see ProcessByLine, FilterProcess, ProcessByBoxcar, RubberSheet, Export, or Import

A working application example of Process can be found in the stats class.

Author:
2002-06-21 Jeff Anderson

For internal use only.

History:
2002-06-24 Jeff Anderson - Added ic_base::OneBand requirement option for SetInputCube methods
History:
2002-07-15 Stuart Sides - Added capabilities for applications to log information to standard out or the GUI log window (ShowLog and Log).
History:
2003-02-03 Jeff Anderson - Added propagation of labels from the first input cube to each output cube
History:
2003-02-04 Jeff Anderson - Added PropagateLabels method
History:
2003-02-04 Jeff Anderson - Fixed bug in propagation of input labels to output cube
History:
2003-02-07 Jeff Anderson - Integrated iString class into the Log methods
History:
2003-04-23 Jeff Anderson - Made accomodations for the updated Preference class
History:
2003-04-28 Jeff Anderson - Added method to Log Label objects
History:
2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
History:
2003-06-04 Jeff Anderson - Added Progress method
History:
2003-06-30 Jeff Anderson - Added MissionData method
History:
2003-09-02 Jeff Anderson - Added SetOutputWorkCube method
History:
2003-10-06 Jeff Anderson - Added IsisPvl pointer to the SetOutput methods so that the programmer can control characteristics of the output cube format.
History:
2003-11-07 Stuart Sides - Added "ReadWrite" capability to the requirements parameter on SetInputCube and SetInputWorkCube.
History:
2003-11-07 Jeff Anderson - Modified preference loading order so that the Init method will load $ISISROOT/testData/base/TestPreferences when the application name contains the word "unitTest". This forces unit tests to use a standard set of system preferences.
History:
2003-12-01 Jeff Anderson - Added ProgagateLabel method to allow for propagation from secondary cubes.
History:
2003-12-18 Jeff Anderson - Modifed preference loading to look for the users preference file in the directory $HOME/.Isis
History:
2003-12-18 Jeff Anderson - Modified MissionData method to allow searching for the highest version of a file
History:
2004-02-02 Jeff Anderson - Modified SetInputCube and SetOutputCube methods to accept CubeAttribute classes. Added the ClearInputCubes method.
History:
2004-02-29 Jeff Anderson - Added ability to send LogResults to the parent process
History:
2004-03-01 Jeff Anderson - Made the Init method check to see if .Isis and .Isis/history directories exist and if not then create them
History:
2004-04-17 Stuart Sides - Fixed problem when creating .Isis/history directories on Solaris.
History:
2004-06-30 Jeff Anderson - Added propagation of blobs
History:
2005-02-08 Elizabeth Ribelin - Modified file to support Doxygen documentation
History:
2006-09-19 Brendan George - Added WriteHistory function to independently write the history to the cube
History:
2007-06-27 Steven Lambright - Added propagation of polygon blobs
History:
2007-07-19 Steven Lambright - Fixed memory leak
History:
2007-07-27 Steven Lambright - Updated AllMatchOrOne and BandMatchOrOne error messages
History:
2008-05-12 Steven Lambright - Removed references to CubeInfo
Todo:
2005-02-08 Jeff Anderson - add an example to the class documentation.

Definition at line 132 of file Process.h.

Public Member Functions

 Process ()
 Constructs a Process Object.
virtual ~Process ()
 Destroys the Process Object. It will close all opened cubes.
void StartProcess (void funct())
 In the base class, this method will invoked a user-specified function exactly one time.
virtual void EndProcess ()
 End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Isis::CubeSetInputCube (const std::string &parameter, const int requirements=0)
 Opens an input cube specified by the user and verifies requirements are met.
Isis::CubeSetInputCube (const std::string &fname, const Isis::CubeAttributeInput &att, int requirements=0)
 Opens an input cube specified by the programmer and verifies requirements are met.
void ClearInputCubes ()
 This method clears the input cube list.
Isis::CubeSetOutputCube (const std::string &parameter)
 Allocates a user-specified output cube whose size matches the first input cube.
Isis::CubeSetOutputCube (const std::string &parameter, const int nsamps, const int nlines, const int nbands=1)
 Allocates a user specified output cube whose size is specified by the programmer.
Isis::CubeSetOutputCube (const std::string &fname, const Isis::CubeAttributeOutput &att, const int nsamps, const int nlines, const int nbands=1)
 Allocates a output cube whose name and size is specified by the programmer.
void PropagateLabels (const bool prop)
 This method allows the programmer to turn on/off the propagation of labels from the 1st input cube to any of the output cubes.
void PropagateLabels (const std::string &cube)
 This method allows the programmer to propagate labels from a specific secondary cube.
void PropagateTables (const bool prop)
 This method allows the programmer to propagate input tables to the output cube (default is true).
void PropagatePolygons (const bool prop)
 This method allows the programmer to propagate input blobs to the output cube (default is true).
void PropagateHistory (const bool prop)
 This method allows the programmer to propagate history to the output cube (default is true).
void PropagateOriginalLabel (const bool prop)
 This method allows the programmer to propagate original labels to the output cube (default is true).
Isis::ProgressProgress ()
 This method returns a pointer to a Progress object.
std::string MissionData (const std::string &mission, const std::string &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.
void WriteHistory (Cube &cube)
 Writes out the History blob to the cube.

Protected Attributes

Isis::Progressp_progress
 Pointer to a Progress object.
bool p_propagateLabels
 Flag indicating if labels are be propagated to output cubes.
bool p_propagateTables
 Flag indicating if tables are be propagated to output cubes.
bool p_propagatePolygons
 Flag indicating if blobs are be propagated to output cubes.
bool p_propagateHistory
 Flag indicating if history is to be propagated to output cubes.
bool p_propagateOriginalLabel
 Flag indicating if original lable is to be propagated to output cubes.
std::vector< Isis::Cube * > InputCubes
 A vector of pointers to opened Cube objects.
std::vector< Isis::Cube * > OutputCubes
 A vector of pointers to allocated Cube objects.


Constructor & Destructor Documentation

Isis::Process::Process (  ) 

Constructs a Process Object.

Definition at line 41 of file Process.cpp.

References p_progress, p_propagateHistory, p_propagateLabels, p_propagateOriginalLabel, p_propagatePolygons, p_propagateTables, and Isis::Progress::SetText().

Isis::Process::~Process (  )  [virtual]

Destroys the Process Object. It will close all opened cubes.

Definition at line 52 of file Process.cpp.

References EndProcess(), and p_progress.


Member Function Documentation

void Isis::Process::ClearInputCubes (  ) 

This method clears the input cube list.

It is most commonly used in applications which need to generate an output cube without an input cube, however, propogation of input characteristics are known. For example, creating the initial cube for a mosaic.

Definition at line 579 of file Process.cpp.

References InputCubes.

Referenced by Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessGroundPolygons::SetOutputCube(), and Isis::ProcessMapMosaic::StartProcess().

void Isis::Process::EndProcess (  )  [virtual]

End the processing sequence and cleans up by closing cubes, freeing memory, etc.

Reimplemented in Isis::ProcessByBoxcar, Isis::ProcessByBrick, Isis::ProcessByTile, Isis::ProcessGroundPolygons, Isis::ProcessImportPds, and Isis::ProcessPolygons.

Definition at line 444 of file Process.cpp.

References InputCubes, and OutputCubes.

Referenced by Isis::ProcessPolygons::EndProcess(), Isis::ProcessImportPds::EndProcess(), Isis::ProcessByBrick::EndProcess(), Isis::ProcessByBoxcar::EndProcess(), and ~Process().

string Isis::Process::MissionData ( const std::string &  mission,
const std::string &  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.

Parameters:
mission Name of the mission data directory
file Name of the file to attach to the end of the directory
highestVersion If set to true the method will return the highest version number of the given file. Therefore, file must contain question marks such as "file???.dat". See the Filename class for more information on versioned files. Defaults to false.

Definition at line 555 of file Process.cpp.

References _FILEINFO_, Isis::Filename::Exists(), Isis::Filename::Expanded(), Isis::PvlObject::FindGroup(), Isis::Filename::HighestVersion(), Isis::iException::Message(), and Isis::Preference::Preferences().

Isis::Progress* Isis::Process::Progress (  )  [inline]

This method returns a pointer to a Progress object.

Returns:
Progress*

Definition at line 211 of file Process.h.

References p_progress.

Referenced by Isis::ProcessMapMosaic::SetOutputCube(), and Isis::ProcessMapMosaic::StartProcess().

void Isis::Process::PropagateHistory ( const bool  prop  ) 

This method allows the programmer to propagate history to the output cube (default is true).

Parameters:
prop Flag indicating if history is to be propagated to output cubes.

Definition at line 524 of file Process.cpp.

References p_propagateHistory.

Referenced by Isis::ProcessMapMosaic::SetOutputCube().

void Isis::Process::PropagateLabels ( const std::string &  cube  ) 

This method allows the programmer to propagate labels from a specific secondary cube.

Parameters:
cube iString containing the name of the cube containing the labels to propagate.

Definition at line 482 of file Process.cpp.

References Isis::PvlObject::AddGroup(), g, incube, OutputCubes, and pvl().

void Isis::Process::PropagateLabels ( const bool  prop  ) 

This method allows the programmer to turn on/off the propagation of labels from the 1st input cube to any of the output cubes.

By default, propagation occurs automatically in the Process class when a call to either of the SetOutputCube methods is invoked. If the program * requires no propagation then utilize this method. This method can be invoked between successive calls of SetOutputCube so that some cube will have labels propagated while others will not.

Parameters:
prop Flag indicating if labels are be propagated to output cubes.

Definition at line 471 of file Process.cpp.

References p_propagateLabels.

Referenced by Isis::ProcessMapMosaic::SetOutputCube().

void Isis::Process::PropagateOriginalLabel ( const bool  prop  ) 

This method allows the programmer to propagate original labels to the output cube (default is true).

Parameters:
prop Flag indicating if original labels is to be propagated to output cubes.

Definition at line 535 of file Process.cpp.

References p_propagateOriginalLabel.

Referenced by Isis::ProcessMapMosaic::SetOutputCube().

void Isis::Process::PropagatePolygons ( const bool  prop  ) 

This method allows the programmer to propagate input blobs to the output cube (default is true).

Parameters:
prop Flag indicating if input blobs are to be propagated to output cubes.

Definition at line 514 of file Process.cpp.

References p_propagatePolygons.

Referenced by Isis::ProcessMapMosaic::SetOutputCube().

void Isis::Process::PropagateTables ( const bool  prop  ) 

This method allows the programmer to propagate input tables to the output cube (default is true).

Parameters:
prop Flag indicating if input tables are to be propagated to output cubes.

Definition at line 503 of file Process.cpp.

References p_propagateTables.

Referenced by Isis::ProcessMapMosaic::SetOutputCube().

Isis::Cube * Isis::Process::SetInputCube ( const std::string &  fname,
const Isis::CubeAttributeInput att,
int  requirements = 0 
)

Opens an input cube specified by the programmer and verifies requirements are met.

Parameters:
fname Programmer specified work file. For example, "myfile.cub".
att The cube attributes to use when opening the input cube.
requirements Same as requirements on SetInputCube. See that method for more details. Defaults to 0
Returns:
Cube*
Exceptions:
Isis::iException::Message 

Reimplemented in Isis::ProcessByBrick.

Definition at line 72 of file Process.cpp.

References _FILEINFO_, Isis::AllMatchOrOne, Isis::BandMatchOrOne, Isis::Cube::Bands(), Isis::CubeAttributeInput::Bands(), cube, e, InputCubes, Isis::Cube::Lines(), Isis::iException::Message(), Isis::OneBand, Isis::Cube::Open(), Isis::ReadWrite, Isis::Cube::Samples(), Isis::Cube::SetVirtualBands(), Isis::SizeMatch, and Isis::SpatialMatch.

Isis::Cube * Isis::Process::SetInputCube ( const std::string &  parameter,
const int  requirements = 0 
)

Opens an input cube specified by the user and verifies requirements are met.

Returns:
Cube*
Parameters:
parameter User parameter to obtain file to open. Typically, the value is "FROM". For example, the user can specify on the command line FROM=myfile.cub and this method will attempt to open the cube "myfile.cub" if the parameter was set to "FROM".
requirements Use to specify requirements for the input file. The following are requirments are checked against 1) ic_base::SizeMatch checks to make sure the input cube has the same bands, samples, and lines as the first input cube open using this method, 2) ic_base::SpatialMatch checks to make sure the input cube has the same samples and lines as the first input cube, 3) ic_base::Georeferenced checks to make sure latitude/longitudes can be obtained from the input cube, 4) ic_base::FullyGeoreferenced checks to make sure latitude/longitude, phase/incidence/emission, and other geometric parameters can be obtained from the input cube, 5) ic_base::OneBand checks to make sure the input cube has exactly one band. Note, that these requirements can be logically or'ed. For example, ic_base::SpatialMatch | ic_base::georeferenced. Defaults to 0
Exceptions:
Isis::iException::Message 

Reimplemented in Isis::ProcessByBrick, Isis::ProcessByLine, Isis::ProcessBySample, and Isis::ProcessBySpectra.

Definition at line 214 of file Process.cpp.

References IsisAml::GetFilename(), IsisAml::GetInputAttribute(), and Isis::Application::GetUserInterface().

Referenced by Isis::ProcessMosaic::SetInputCube(), Isis::ProcessBySample::SetInputCube(), Isis::ProcessByLine::SetInputCube(), Isis::ProcessByBrick::SetInputCube(), and Isis::ProcessGroundPolygons::SetOutputCube().

Isis::Cube * Isis::Process::SetOutputCube ( const std::string &  fname,
const Isis::CubeAttributeOutput att,
const int  ns,
const int  nl,
const int  nb = 1 
)

Allocates a output cube whose name and size is specified by the programmer.

Returns:
Cube*
Parameters:
fname Name of the output cube to allocate
att The cube attributes to use when creating the output cube.
ns Number of samples to allocate
nl Number of lines to allocate
nb Number of bands to allocate
Exceptions:
Isis::iException::Message 

Definition at line 305 of file Process.cpp.

References _FILEINFO_, Isis::PvlObject::AddGroup(), Isis::CubeAttributeOutput::AttachedLabel(), base, Isis::CubeAttributeOutput::ByteOrder(), cube, Isis::CubeAttributeOutput::DetachedLabel(), e, Isis::CubeAttributeOutput::FileFormat(), incube, InputCubes, Isis::PvlContainer::IsNamed(), Isis::CubeAttributeOutput::Maximum(), Isis::iException::Message(), Isis::CubeAttributeOutput::Minimum(), mult, Isis::PvlContainer::Name(), Isis::PvlObject::Object(), Isis::PvlObject::Objects(), OutputCubes, p_propagateLabels, p_propagateOriginalLabel, p_propagatePolygons, p_propagateTables, Isis::CubeAttributeOutput::PixelType(), Isis::CubeAttributeOutput::PropagateMinimumMaximum(), Isis::CubeAttributeOutput::PropagatePixelType(), Isis::Cube::SetDimensions(), and WriteHistory().

Isis::Cube * Isis::Process::SetOutputCube ( const std::string &  parameter,
const int  ns,
const int  nl,
const int  nb = 1 
)

Allocates a user specified output cube whose size is specified by the programmer.

Returns:
Cube*
Parameters:
parameter User specified output file. For example, "TO" is a popular user parameter. If the user specified TO=output.cub, then this routine would allocate the file output.cub with size specified by the first opened input cube. The output pixel type will be propagated from the first loaded input cube or will use the value in the application XML file for pixelType.
ns Number of samples to allocate
nl Number of lines to allocate
nb Number of bands to allocate
Exceptions:
Isis::iException::Message 

Reimplemented in Isis::ProcessPolygons.

Definition at line 273 of file Process.cpp.

References _FILEINFO_, IsisAml::GetFilename(), IsisAml::GetOutputAttribute(), Isis::Application::GetUserInterface(), Isis::iException::Message(), and SetOutputCube().

Isis::Cube * Isis::Process::SetOutputCube ( const std::string &  parameter  ) 

Allocates a user-specified output cube whose size matches the first input cube.

Returns:
Cube*
Parameters:
parameter User specified output file. For example, "TO" is a popular user parameter. If the user specified TO=output.cub, then this routine would allocate the file output.cub with size specified by the first opened input cube. The output pixel type will be propagated from the first loaded input cube or will use the value in the application XML file for pixelType.
Exceptions:
Isis::iException::Message 

Reimplemented in Isis::ProcessImport, Isis::ProcessMapMosaic, and Isis::ProcessMosaic.

Definition at line 237 of file Process.cpp.

References _FILEINFO_, InputCubes, Isis::iException::Message(), nb, nl, and ns.

Referenced by Isis::ProcessPolygons::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessImport::SetOutputCube(), Isis::ProcessGroundPolygons::SetOutputCube(), and SetOutputCube().

void Isis::Process::StartProcess ( void   funct()  )  [inline]

In the base class, this method will invoked a user-specified function exactly one time.

In derived classes such as ProcessByLine, the StartProcess will invoke a user-specified function for every line in a cube.

Parameters:
funct() Name of your processing function

Definition at line 180 of file Process.h.

void Isis::Process::WriteHistory ( Cube cube  ) 

Writes out the History blob to the cube.

Definition at line 591 of file Process.cpp.

References Isis::History::AddEntry(), cube, InputCubes, p_propagateHistory, and Isis::Cube::Write().

Referenced by SetOutputCube(), and Isis::ProcessMapMosaic::StartProcess().


Member Data Documentation

std::vector<Isis::Cube *> Isis::Process::InputCubes [protected]

A vector of pointers to opened Cube objects.

The pointers are established in the SetInputCube/SetInputWorkCube methods.

Definition at line 160 of file Process.h.

Referenced by ClearInputCubes(), Isis::ProcessExport::CreateWorldFile(), EndProcess(), Isis::ProcessExport::InitProcess(), Isis::ProcessExportPds::LineBytes(), Isis::ProcessExportPds::OutputLabel(), Isis::ProcessRubberSheet::QuadTree(), Isis::ProcessByBrick::SetBrickSize(), Isis::ProcessByBrick::SetInputBrickSize(), Isis::ProcessMosaic::SetInputCube(), SetInputCube(), Isis::ProcessExport::SetInputRange(), Isis::ProcessGroundPolygons::SetOutputCube(), SetOutputCube(), Isis::ProcessRubberSheet::SlowGeom(), Isis::ProcessRubberSheet::SlowQuad(), Isis::ProcessExportPds::StandardAllMapping(), Isis::ProcessExportPds::StandardImageImage(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessMapMosaic::StartProcess(), Isis::ProcessExport::StartProcess(), Isis::ProcessByTile::StartProcess(), Isis::ProcessBySpectra::StartProcess(), Isis::ProcessBySample::StartProcess(), Isis::ProcessByQuickFilter::StartProcess(), Isis::ProcessByLine::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), Isis::ProcessExport::StartProcessBIL(), Isis::ProcessExport::StartProcessBIP(), Isis::ProcessExport::StartProcessBSQ(), and WriteHistory().

std::vector<Isis::Cube *> Isis::Process::OutputCubes [protected]

A vector of pointers to allocated Cube objects.

The pointers are established in the SetOutputCube method.

Definition at line 166 of file Process.h.

Referenced by Isis::ProcessPolygons::AppendOutputCube(), Isis::ProcessPolygons::DoWork(), Isis::ProcessImportPds::EndProcess(), EndProcess(), Isis::ProcessPolygons::FillPolygon(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), PropagateLabels(), Isis::ProcessByBrick::SetBrickSize(), Isis::ProcessByBrick::SetOutputBrickSize(), Isis::ProcessPolygons::SetOutputCube(), Isis::ProcessMosaic::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessGroundPolygons::SetOutputCube(), SetOutputCube(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessMapMosaic::StartProcess(), Isis::ProcessByTile::StartProcess(), Isis::ProcessBySpectra::StartProcess(), Isis::ProcessBySample::StartProcess(), Isis::ProcessByQuickFilter::StartProcess(), Isis::ProcessByLine::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), and Isis::ProcessImportPds::TranslatePdsProjection().

Isis::Progress* Isis::Process::p_progress [protected]

Pointer to a Progress object.

Definition at line 134 of file Process.h.

Referenced by Isis::ProcessExport::InitProcess(), Process(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), Isis::ProcessExport::ProcessExport(), Isis::ProcessImport::ProcessImport(), Progress(), Isis::ProcessRubberSheet::StartProcess(), Isis::ProcessMosaic::StartProcess(), Isis::ProcessExport::StartProcess(), Isis::ProcessByQuickFilter::StartProcess(), Isis::ProcessByBrick::StartProcess(), Isis::ProcessByBoxcar::StartProcess(), Isis::ProcessExport::StartProcessBIL(), Isis::ProcessExport::StartProcessBIP(), Isis::ProcessExport::StartProcessBSQ(), and ~Process().

bool Isis::Process::p_propagateHistory [protected]

Flag indicating if history is to be propagated to output cubes.

Definition at line 150 of file Process.h.

Referenced by Process(), PropagateHistory(), Isis::ProcessMapMosaic::StartProcess(), and WriteHistory().

bool Isis::Process::p_propagateLabels [protected]

Flag indicating if labels are be propagated to output cubes.

Definition at line 138 of file Process.h.

Referenced by Process(), PropagateLabels(), and SetOutputCube().

bool Isis::Process::p_propagateOriginalLabel [protected]

Flag indicating if original lable is to be propagated to output cubes.

Definition at line 154 of file Process.h.

Referenced by Process(), PropagateOriginalLabel(), and SetOutputCube().

bool Isis::Process::p_propagatePolygons [protected]

Flag indicating if blobs are be propagated to output cubes.

Definition at line 146 of file Process.h.

Referenced by Process(), PropagatePolygons(), and SetOutputCube().

bool Isis::Process::p_propagateTables [protected]

Flag indicating if tables are be propagated to output cubes.

Definition at line 142 of file Process.h.

Referenced by Process(), PropagateTables(), and SetOutputCube().


The documentation for this class was generated from the following files: