USGS

Isis 3.0 Object Programmers' Reference

Home

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

#include <ProcessByBoxcar.h>

Inheritance diagram for Isis::ProcessByBoxcar:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Process cubes by boxcar.

This is the processing class used to move a boxcar through cube data. This class allows only one input cube and one output cube.

Author:
2003-01-03 Tracie Sucharski

For internal use only.

History:
2003-04-02 Tracie Sucharski - Added unitTest
History:
2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
History:
2005-02-08 Elizabeth Ribelin - Modified file to support Doxygen documentation
Todo:
2005-02-08 Tracie Sucharski - add code example and implementation example to class documentation

Definition at line 50 of file ProcessByBoxcar.h.

Public Member Functions

 ProcessByBoxcar ()
 Constructs a ProcessByBoxcar object.
 ~ProcessByBoxcar ()
 Destroys the ProcessByBoxcar object.
void SetBoxcarSize (const int ns, const int nl)
 Sets the boxcar size.
void StartProcess (void funct(Isis::Buffer &in, double &out))
 Starts the systematic processing of the input cube by moving a boxcar, p_boxSamples by p_boxLines, through the cube one pixel at a time.
void EndProcess ()
 End the boxcar processing sequence and cleans up by closing cubes, freeing memory, etc.
void StartProcess (void funct())
 In the base class, this method will invoked a user-specified function exactly one time.
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.

Private Attributes

bool p_boxsizeSet
 Indicates whether the boxcar size has been set.
int p_boxSamples
 Number of samples in boxcar.
int p_boxLines
 Number of lines in boxcar.


Constructor & Destructor Documentation

Isis::ProcessByBoxcar::ProcessByBoxcar (  )  [inline]

Constructs a ProcessByBoxcar object.

Definition at line 61 of file ProcessByBoxcar.h.

References p_boxsizeSet.

Isis::ProcessByBoxcar::~ProcessByBoxcar (  )  [inline]

Destroys the ProcessByBoxcar object.

Definition at line 64 of file ProcessByBoxcar.h.


Member Function Documentation

void Isis::Process::ClearInputCubes (  )  [inherited]

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 Isis::Process::InputCubes.

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

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

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

Reimplemented from Isis::Process.

Definition at line 122 of file ProcessByBoxcar.cpp.

References Isis::Process::EndProcess(), and p_boxsizeSet.

string Isis::Process::MissionData ( const std::string &  mission,
const std::string &  file,
bool  highestVersion = false 
) [inherited]

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, inherited]

This method returns a pointer to a Progress object.

Returns:
Progress*

Definition at line 211 of file Process.h.

References Isis::Process::p_progress.

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

void Isis::Process::PropagateHistory ( const bool  prop  )  [inherited]

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 Isis::Process::p_propagateHistory.

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

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

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, Isis::Process::OutputCubes, and pvl().

void Isis::Process::PropagateLabels ( const bool  prop  )  [inherited]

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 Isis::Process::p_propagateLabels.

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

void Isis::Process::PropagateOriginalLabel ( const bool  prop  )  [inherited]

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 Isis::Process::p_propagateOriginalLabel.

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

void Isis::Process::PropagatePolygons ( const bool  prop  )  [inherited]

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 Isis::Process::p_propagatePolygons.

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

void Isis::Process::PropagateTables ( const bool  prop  )  [inherited]

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 Isis::Process::p_propagateTables.

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

void Isis::ProcessByBoxcar::SetBoxcarSize ( const int  ns,
const int  nl 
)

Sets the boxcar size.

Parameters:
ns Number of samples
nl Number of lines

Definition at line 39 of file ProcessByBoxcar.cpp.

References p_boxLines, p_boxSamples, and p_boxsizeSet.

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

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, Isis::Process::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 
) [inherited]

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 
) [inherited]

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, Isis::Process::InputCubes, Isis::PvlContainer::IsNamed(), Isis::CubeAttributeOutput::Maximum(), Isis::iException::Message(), Isis::CubeAttributeOutput::Minimum(), mult, Isis::PvlContainer::Name(), Isis::PvlObject::Object(), Isis::PvlObject::Objects(), Isis::Process::OutputCubes, Isis::Process::p_propagateLabels, Isis::Process::p_propagateOriginalLabel, Isis::Process::p_propagatePolygons, Isis::Process::p_propagateTables, Isis::CubeAttributeOutput::PixelType(), Isis::CubeAttributeOutput::PropagateMinimumMaximum(), Isis::CubeAttributeOutput::PropagatePixelType(), Isis::Cube::SetDimensions(), and Isis::Process::WriteHistory().

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

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 Isis::Process::SetOutputCube().

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

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_, Isis::Process::InputCubes, Isis::iException::Message(), nb, nl, and ns.

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

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

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::ProcessByBoxcar::StartProcess ( void   funct(Isis::Buffer &in, double &out)  ) 

Starts the systematic processing of the input cube by moving a boxcar, p_boxSamples by p_boxLines, through the cube one pixel at a time.

The input and output buffers contain a Boxcar of the size indicated in p_boxSamples and p_boxLines. The input and output cube must be initialized prior to calling this method.

Parameters:
funct (Isis::Buffer &in, double &out) Name of your processing function
Exceptions:
Isis::iException::Programmer 

Definition at line 57 of file ProcessByBoxcar.cpp.

References _FILEINFO_, Isis::BufferManager::begin(), Isis::Progress::CheckStatus(), Isis::Process::InputCubes, line, Isis::iException::Message(), Isis::Process::OutputCubes, p_boxLines, p_boxSamples, p_boxsizeSet, Isis::Process::p_progress, and Isis::Progress::SetMaximumSteps().

void Isis::Process::WriteHistory ( Cube cube  )  [inherited]

Writes out the History blob to the cube.

Definition at line 591 of file Process.cpp.

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

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


Member Data Documentation

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

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 Isis::Process::ClearInputCubes(), Isis::ProcessExport::CreateWorldFile(), Isis::Process::EndProcess(), Isis::ProcessExport::InitProcess(), Isis::ProcessExportPds::LineBytes(), Isis::ProcessExportPds::OutputLabel(), Isis::ProcessRubberSheet::QuadTree(), Isis::ProcessByBrick::SetBrickSize(), Isis::ProcessByBrick::SetInputBrickSize(), Isis::ProcessMosaic::SetInputCube(), Isis::Process::SetInputCube(), Isis::ProcessExport::SetInputRange(), Isis::ProcessGroundPolygons::SetOutputCube(), Isis::Process::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(), StartProcess(), Isis::ProcessExport::StartProcessBIL(), Isis::ProcessExport::StartProcessBIP(), Isis::ProcessExport::StartProcessBSQ(), and Isis::Process::WriteHistory().

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

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(), Isis::Process::EndProcess(), Isis::ProcessPolygons::FillPolygon(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), Isis::Process::PropagateLabels(), Isis::ProcessByBrick::SetBrickSize(), Isis::ProcessByBrick::SetOutputBrickSize(), Isis::ProcessPolygons::SetOutputCube(), Isis::ProcessMosaic::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessGroundPolygons::SetOutputCube(), Isis::Process::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(), StartProcess(), and Isis::ProcessImportPds::TranslatePdsProjection().

int Isis::ProcessByBoxcar::p_boxLines [private]

Number of lines in boxcar.

Definition at line 55 of file ProcessByBoxcar.h.

Referenced by SetBoxcarSize(), and StartProcess().

int Isis::ProcessByBoxcar::p_boxSamples [private]

Number of samples in boxcar.

Definition at line 54 of file ProcessByBoxcar.h.

Referenced by SetBoxcarSize(), and StartProcess().

bool Isis::ProcessByBoxcar::p_boxsizeSet [private]

Indicates whether the boxcar size has been set.

Definition at line 53 of file ProcessByBoxcar.h.

Referenced by EndProcess(), ProcessByBoxcar(), SetBoxcarSize(), and StartProcess().

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

Pointer to a Progress object.

Definition at line 134 of file Process.h.

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

bool Isis::Process::p_propagateHistory [protected, inherited]

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

Definition at line 150 of file Process.h.

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

bool Isis::Process::p_propagateLabels [protected, inherited]

Flag indicating if labels are be propagated to output cubes.

Definition at line 138 of file Process.h.

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

bool Isis::Process::p_propagateOriginalLabel [protected, inherited]

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

Definition at line 154 of file Process.h.

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

bool Isis::Process::p_propagatePolygons [protected, inherited]

Flag indicating if blobs are be propagated to output cubes.

Definition at line 146 of file Process.h.

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

bool Isis::Process::p_propagateTables [protected, inherited]

Flag indicating if tables are be propagated to output cubes.

Definition at line 142 of file Process.h.

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


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