USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Cube Class Reference
[Low Level Cube I/O]

#include <Cube.h>

Inheritance diagram for Isis::Cube:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

I/O Handler for Isis Cubes.

This class is used to open, create, read, and write data from Isis cube files.

Author:
2003-02-14 Jeff Anderson

For internal use only.

Todo:
There are undocumented methods and private variables in the Cube class. Also, it needs an example.
History:
2003-03-31 Jeff Anderson - updated unitTest truth file.
History:
2003-05-16 Stuart Sides - modified schema from astrogeology...isis.astrogeology
History:
2003-05-21 Jeff Anderson - added read/write methods to improve speed for IsisLine buffer managers. Also added error checks on reads, writes, and seeks.
History:
2003-05-30 Jeff Anderson - added PhysicalBand method and updated unitTest.
History:
2003-10-06 Jeff Anderson - added PVL to create method to allow for propagation of Pixel specifications.
History:
2003-10-15 Jeff Anderson - fixed bad error check in PhysicalBand method.
History:
2004-01-30 Jeff Anderson - added many Set methods. Major refractor of the class.
History:
2004-02-12 Jeff Anderson - added pruning of the band bin group given the virtual band list.
History:
2004-02-17 Jeff Anderson - modified the number of bands in the label if a virtual band list was given.
History:
2004-03-01 Jeff Anderson - added ability to read Isis 2.1 cube format.
History:
2004-04-01 Jeff Anderson - fixed bug swapping NULL cache tile for non-native cubes in move method.
History:
2005-03-24 Jeff Anderson - Added methods to return a camera or projection associated with the cube.
History:
2005-07-18 Elizabeth Ribelin - Fixed bug in method that returns a projection associated with the cube
History:
2005-10-03 Elizabeth Miller - Added error check to Write(blob)
History:
2006-02-24 Kris Becker - Made the destructor virtual to properly allow the class to be inherited.
History:
2006-04-21 Jacob Danton - Modified the WriteLabel method to use the Pvl's format template abilities.
History:
2006-05-17 Elizabeth Miller - Depricated CameraManger to CameraFactory
History:
2006-07-10 Elizabeth Miller - Added max size preference
History:
2006-11-28 Jeff Anderson - Fixed detached blob bug
History:
2007-01-05 Jeff Anderson - Fixed bug when reading/writing outside cube
History:
2007-02-07 Tracie Sucharski - Added ReOpen method
History:
2008-05-09 Steven Lambright - Added Statistics, Histogram, PutGroup, GetGroup, DeleteGroup, HasGroup conveinience methods. Removed excess references to CubeInfo.
History:
2008-05-27 Jeff Anderson - Fixed bug in open method where virtual bands were not handled correctly if a BandBin group did not exist
History:
2008-06-09 Christopher Austin - Improved maximum cube size error message.
History:
2008-06-11 Steven Lambright - Changed prototype for SetVirtualBands
History:
2008-06-18 Christopher Austin - Fixed documentation errors
History:
2008-08-11 Steven Lambright - Added another Statistics method which accepts a valid range -- also added another Histogram method which accepts a bin/valid range (applies both).
History:
2008-08-11 Steven Lambright - Fixed definition of IsisCubeDef, problem pointed out by "novas0x2a" (Support Board Member)
History:
2008-12-15 Steven Koechle - Added a method to delete blobs from a cube
History:
2008-12-17 Steven Koechle - BlobDelete method was broken, fixed
History:
2009-06-30 Steven Lambright - Added "HasProjection" for uniform projection existance test

Definition at line 109 of file Cube.h.

Public Member Functions

 Cube ()
 Constructs a Cube object.
virtual ~Cube ()
 Destroys the Cube object.
void Open (const std::string &cfile, std::string access="r")
 This method will open an isis sube for reading or reading/writing.
void ReOpen (std::string access="r")
 This method will reopen an isis sube for reading or reading/writing.
void Create (const std::string &cfile)
 This method will create an isis cube for writing.
bool IsOpen ()
 Returns if the cube is opened.
bool IsReadOnly () const
 Returns if the cube is opened readonly.
bool IsReadWrite () const
 Returns if the cube is opened read/write.
void Close (const bool remove=false)
 Closes the cube and updates the labels.
void Read (Isis::Buffer &rbuf)
 This method will read a buffer of data from the cube as specified by the contents of the Buffer object.
void Write (Isis::Buffer &wbuf)
 This method will write a buffer of data from the cube as specified by the contents of the Buffer object.
void Read (Isis::Blob &blob)
 This method will read data from the specified Blob object.
void Write (Isis::Blob &blob)
 This method will write a blob of data (e.g.
bool BlobDelete (std::string BlobType, std::string BlobName)
 This method will delete a blob label object from the cube as specified by the Blob type and name.
std::string Filename () const
 Returns the expanded filename.
Isis::PvlLabel ()
 Returns a pointer to the IsisLabel object associated with the cube.
void SetLabelBytes (int labelBytes)
 Used prior to the Create method, this will allocate a specific number of bytes in the label area for attached files.
void SetDimensions (int ns, int nl, int nb)
 Used prior to the Create method to specify the size of the cube.
void SetPixelType (Isis::PixelType pixelType)
 Used prior to the Create method, this will specify the output pixel type.
void SetCubeFormat (Isis::CubeFormat cubeFormat)
 Used prior to the Create method, this will specify the format of the cube, either band, sequential or tiled.
void SetByteOrder (Isis::ByteOrder byteOrder)
 Used prior to the Create method, this will specify the byte order of pixels, either least or most significant byte.
void SetMinMax (double min, double max)
 Used prior to the Create method, this will compute a good base and multiplier value given the minimum/maximum range of the 32bit data.
void SetBaseMultiplier (double base, double mult)
 Used prior to the Create method, this will specify the base and multiplier for converting 8-bit/16-bit back and forth between 32-bit:

\[ 32-bit pixel = 8-bit/16-bit pixel * multiplier + base \]

.

void SetAttached ()
 Used prior to the Create method, this will specify that the labels and data will be in one file.
void SetDetached ()
 Used prior to the Create method, this will specify that the labels and data will be in separate files.
int LabelBytes () const
 Returns the number of bytes reserved for the label.
int LabelBytesUsed ()
 Returns the number of bytes used by the label.
int Samples () const
 Returns the number of samples in the cube.
int Lines () const
 Returns the number of lines in the cube.
int Bands () const
 Returns the number of bands in the cube.
Isis::PixelType PixelType () const
 Returns an enumeration of the PixelType.
Isis::CubeFormat CubeFormat () const
 Returns an enumeration of the cube format (tiled or bsq).
Isis::ByteOrder ByteOrder () const
 Returns an enumeration of the byte order (Isb or Msb).
bool IsAttached () const
 Returns if the cube and label data are in the same file.
bool IsDetached () const
 Returns if the cube and label data are in separate files.
double Base () const
 Returns the base value for converting 8-bit/16-bit pixels to 32-bit.
double Multiplier () const
 Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.
void SetVirtualBands (const std::vector< std::string > &vbands)
 Used prior to the Open method, this allows the programmer to specify a subset of bands to work with.
int PhysicalBand (const int virtualBand) const
 This method will return the physical band number given a virtual band number.
bool HasProjection ()
 Returns true if the labels of the cube appear to have a valid mapping group.
Isis::CameraCamera ()
 Return a camera associated with the cube.
Isis::ProjectionProjection ()
 Return a projection associated with the cube.
Isis::StatisticsStatistics (const int band=1, std::string msg="Gathering statistics")
 This method returns a pointer to a Statistics object which allows the program to obtain and use various statistics from the cube.
Isis::StatisticsStatistics (const int band, const double validMin, const double validMax, std::string msg="Gathering statistics")
 This method returns a pointer to a Statistics object which allows the program to obtain and use various statistics from the cube.
Isis::HistogramHistogram (const int band=1, std::string msg="Gathering histogram")
 This method returns a pointer to a Histogram object which allows the program to obtain and use various statistics and histogram information from the cube.
Isis::HistogramHistogram (const int band, const double validMin, const double validMax, std::string msg="Gathering histogram")
 This method returns a pointer to a Histogram object which allows the program to obtain and use various statistics and histogram information from the cube.
void PutGroup (Isis::PvlGroup &group)
 Adds a group in a Label to the cube.
Isis::PvlGroupGetGroup (const std::string &group)
 Read a group from the cube into a Label.
void DeleteGroup (const std::string &group)
 Deletes a group from the cube labels.
bool HasGroup (const std::string &group)
 Return if the cube has a specified group in the labels.
bool HasTable (const std::string &name)
 Check to see if the cube contains a pvl table by the provided name.

Private Member Functions

void WriteLabels ()
void ReformatOldIsisLabel (const std::string &oldCube)
void OpenCheck ()
void SetVirtualBands ()
 Used prior to the Open method this allows the programmer to specify a subset of bands to work with.

Private Attributes

IsisCubeDef p_cube
Isis::CubeIoHandlerp_ioHandler
bool p_overwritePreference
bool p_historyPreference
bool p_attachedPreference
BigInt p_maxSizePreference
std::vector< std::string > p_virtualBandList
std::string p_tempCube
std::string p_formatTemplateFile
Isis::Camerap_camera
Isis::Projectionp_projection


Constructor & Destructor Documentation

Cube::Cube (  ) 

Constructs a Cube object.

Definition at line 46 of file Cube.cpp.

References Isis::PvlContainer::Clear(), Isis::PvlObject::FindGroup(), Isis::IsBigEndian(), Isis::IsLittleEndian(), Isis::Preference::Preferences(), and Isis::iString::UpCase().

Cube::~Cube (  )  [virtual]

Destroys the Cube object.

Definition at line 99 of file Cube.cpp.


Member Function Documentation

int Cube::Bands (  )  const

Returns the number of bands in the cube.

Note that this is the number of virtual bands if the Open method was used.

Returns:
int The number of bands in the cube.

Definition at line 759 of file Cube.cpp.

Referenced by Qisis::CubeViewport::cubeBands(), Qisis::CubeViewport::CubeViewport(), Isis::Histogram::InitializeFromCube(), Isis::Process::SetInputCube(), and Isis::ProcessMapMosaic::SetOutputCube().

double Isis::Cube::Base (  )  const [inline]

Returns the base value for converting 8-bit/16-bit pixels to 32-bit.

\[ out = in * multiplier + base \]

Returns:
double The base value for converting 8-bit/16-bit pixels to 32-bit.

Definition at line 246 of file Cube.h.

References IsisCubeDef::base, and p_cube.

Referenced by Isis::Histogram::InitializeFromCube().

bool Cube::BlobDelete ( std::string  BlobType,
std::string  BlobName 
)

This method will delete a blob label object from the cube as specified by the Blob type and name.

If blob does not exist it will do nothing and return false.

Parameters:
BlobType type of blob to search for (Polygon, Table, etc)
BlobName blob to be deleted
Returns:
boolean if it found the blob and deleted it.

Definition at line 899 of file Cube.cpp.

Isis::ByteOrder Isis::Cube::ByteOrder (  )  const [inline]

Returns an enumeration of the byte order (Isb or Msb).

See also:
Endian.h
Returns:
Isis::ByteOrder An enumeration of the byte order.

Definition at line 219 of file Cube.h.

References IsisCubeDef::byteOrder, and p_cube.

Isis::Camera * Cube::Camera (  ) 

Return a camera associated with the cube.

The generation of the camera can throw an exception, so you might want to catch errors if that interests you.

Definition at line 917 of file Cube.cpp.

Referenced by Isis::ImagePolygon::Create(), Isis::Chip::Load(), and Isis::CameraPointInfo::SetCube().

void Cube::Close ( const bool  removeIt = false  ) 

Closes the cube and updates the labels.

Optionally, it deletes the cube if requested.

Parameters:
removeIt (Default value = false) Indicates if the file should be removed/deleted.

Definition at line 519 of file Cube.cpp.

Referenced by Qisis::MosaicItem::createFootprint(), Qisis::MosaicItem::drawImage(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::GuiCubeParameter::ViewCube(), Isis::GuiCubeParameter::ViewLabel(), and Qisis::ScatterPlotData::~ScatterPlotData().

void Cube::Create ( const std::string &  cfile  ) 

This method will create an isis cube for writing.

The programmer should make appropriate calls to Set methods before invoking Create. If none are made there are internal defaults which are:

        Dimensions     512x512x1
        PixelType      Real
        ByteOrder      Matches architecture of host machine
        Attached       From user preference file
        Label Size     65536 bytes
        Format         Tiled
        Base           0.0
        Multiplier     1.0 

Parameters:
cfile Name of the cube file to open. If the extenstion ".cub" is not given it will be appended (i.e., the extension of .cub is forced). Environment variables in the filename will be automatically expanded as well.

Definition at line 365 of file Cube.cpp.

References _FILEINFO_, Isis::Filename::AddExtension(), Isis::PvlObject::AddObject(), Isis::ByteOrderName(), core(), Isis::Filename::Expanded(), Isis::iException::Message(), Isis::Filename::Name(), Isis::PixelTypeName(), Isis::Filename::RemoveExtension(), size, and Isis::SizeOf().

Isis::CubeFormat Isis::Cube::CubeFormat (  )  const [inline]

Returns an enumeration of the cube format (tiled or bsq).

See also:
CubeFormat.h
Returns:
Isis::CubeFormat An enumeration of the cube format.

Definition at line 211 of file Cube.h.

References IsisCubeDef::cubeFormat, and p_cube.

void Cube::DeleteGroup ( const std::string &  group  ) 

Deletes a group from the cube labels.

If the group does not exist nothing happens; otherwise the group is removed. This will only work on output cubes, therefore, input cubes will not be updated.

Parameters:
[out] group Name of the group to delete.

Definition at line 1195 of file Cube.cpp.

References Isis::PvlObject::DeleteGroup(), and Isis::PvlObject::HasGroup().

std::string Isis::Cube::Filename (  )  const [inline]

Returns the expanded filename.

Returns:
std::string The expanded filename.

Definition at line 151 of file Cube.h.

References IsisCubeDef::labelFile, and p_cube.

Referenced by Isis::ImagePolygon::Create(), Qisis::CubeViewport::CubeViewport(), Isis::CameraPointInfo::GetPointInfo(), Isis::Chip::Load(), Qisis::CubeViewport::setCaption(), Qisis::MeasureTool::updateDist(), and Qisis::AdvancedTrackTool::updateRow().

Isis::PvlGroup & Cube::GetGroup ( const std::string &  group  ) 

Read a group from the cube into a Label.

If the group does not exist an exception will be thrown.

Parameters:
[out] group Name of the group to get
Returns:
(Isis::PvlGroup) Label which will contain the requested group.

Definition at line 1182 of file Cube.cpp.

References Isis::PvlObject::FindGroup().

Referenced by HiLab::HiLab().

bool Cube::HasGroup ( const std::string &  group  ) 

Return if the cube has a specified group in the labels.

Parameters:
[out] group Name of the group to check.
Returns:
(bool) True if the cube has the specified group, false if not.

Definition at line 1208 of file Cube.cpp.

References Isis::PvlObject::HasGroup().

Referenced by Isis::AlphaCube::UpdateGroup().

bool Cube::HasProjection (  ) 

Returns true if the labels of the cube appear to have a valid mapping group.

This returning true does not guarantee that the cube can project or that the Projection() method will succeed.

Returns:
bool True if the file should have a valid projection

Definition at line 932 of file Cube.cpp.

bool Cube::HasTable ( const std::string &  name  ) 

Check to see if the cube contains a pvl table by the provided name.

Parameters:
name The name of the pvl table to search for
Returns:
bool True if the pvl table was found

Definition at line 955 of file Cube.cpp.

References Isis::iString::UpCase().

Isis::Histogram * Cube::Histogram ( const int  band,
const double  validMin,
const double  validMax,
std::string  msg = "Gathering histogram" 
)

This method returns a pointer to a Histogram object which allows the program to obtain and use various statistics and histogram information from the cube.

Cube does not retain ownership of the returned pointer - please delete it when you are done with it.

Parameters:
[in] band Returns the histogram for the specified band. If the user specifies 0 for this parameter, the method will loop through every band in the cube and accumulate a histogram from all of them
validMin The start of the bin range and valid data range for the histogram
validMax The end of the bin range and valid data range for the histogram
msg The message to display with the percent process while gathering histogram data
Returns:
(Isis::Histogram) A pointer to a Histogram object.
Exceptions:
ProgrammerError Band was less than zero or more than the number of bands in the cube.

Definition at line 1100 of file Cube.cpp.

References _FILEINFO_, Isis::Histogram::AddData(), Isis::Histogram::BinRangeEnd(), Isis::Histogram::BinRangeStart(), Isis::Progress::CheckStatus(), line, Isis::iException::Message(), Isis::Histogram::SetBinRange(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Statistics::SetValidRange(), Isis::ValidMaximum, and Isis::ValidMinimum.

Isis::Histogram * Cube::Histogram ( const int  band = 1,
std::string  msg = "Gathering histogram" 
)

This method returns a pointer to a Histogram object which allows the program to obtain and use various statistics and histogram information from the cube.

Cube does not retain ownership of the returned pointer - please delete it when you are done with it.

Parameters:
[in] band (Default value is 1) Returns the histogram for the specified band.If the user specifies 0 for this parameter, the method will loop through every band in the cube and accumulate a histogram from all of them
msg The message to display with the percent process while gathering histogram data
Returns:
(Isis::Histogram) A pointer to a Histogram object.
Exceptions:
IsisProgrammerError Band was less than zero or more than the number of bands in the cube.

Definition at line 1070 of file Cube.cpp.

References Isis::ValidMaximum, and Isis::ValidMinimum.

Referenced by Qisis::MosaicItem::getStretch().

bool Isis::Cube::IsAttached (  )  const [inline]

Returns if the cube and label data are in the same file.

Returns:
bool True if the cube and label data are in the same file, false if they are not.

Definition at line 227 of file Cube.h.

References IsisCubeDef::attached, and p_cube.

bool Isis::Cube::IsDetached (  )  const [inline]

Returns if the cube and label data are in separate files.

Returns:
bool Returns true if the cube and label data are in separate files, false if they are in the same file.

Definition at line 235 of file Cube.h.

References IsisCubeDef::attached, and p_cube.

bool Isis::Cube::IsOpen (  )  [inline]

Returns if the cube is opened.

Returns:
bool True if the cube is opened, false if it is not.

Definition at line 123 of file Cube.h.

References p_cube, and IsisCubeDef::stream.

Referenced by Qisis::CubeViewport::CubeViewport().

bool Isis::Cube::IsReadOnly (  )  const [inline]

Returns if the cube is opened readonly.

Default more for Open method.

Returns:
bool True if the cube is opened readonly, false if it is not.

Definition at line 130 of file Cube.h.

References IsisCubeDef::access, and p_cube.

Referenced by Qisis::EditTool::mouseButtonRelease(), Qisis::EditTool::redoEdit(), Qisis::EditTool::rubberBandComplete(), Qisis::EditTool::undoAll(), and Qisis::EditTool::undoEdit().

bool Isis::Cube::IsReadWrite (  )  const [inline]

Returns if the cube is opened read/write.

Returns:
bool True if the cube is opened read/write, false if it is not.

Definition at line 137 of file Cube.h.

References IsisCubeDef::access, and p_cube.

Referenced by Isis::ProcessByBrick::StartProcess().

Isis::Pvl* Isis::Cube::Label (  )  [inline]

Returns a pointer to the IsisLabel object associated with the cube.

Modifications made to the label will be written when the file is closed if it was opened read-write or created. Take care not to mangle the Core Object as this can produce unexpected results when a new attempt is made to open the file.

Returns:
Isis::Pvl Pointer to the Label object associated with the cube.

Definition at line 162 of file Cube.h.

References IsisCubeDef::label, and p_cube.

Referenced by Isis::SerialNumber::Compose(), Isis::ObservationNumber::Compose(), Qisis::MosaicItem::createFootprint(), Isis::ProjectionFactory::CreateFromCube(), Qisis::PlotTool::getSpectralStatistics(), Isis::Sensor::Sensor(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::UniversalGroundMap::UniversalGroundMap(), Qisis::PlotTool::updateTool(), Qisis::BandTool::updateTool(), and Isis::GuiCubeParameter::ViewLabel().

int Isis::Cube::LabelBytes (  )  const [inline]

Returns the number of bytes reserved for the label.

Returns:
int The number of bytes used for the label.

Definition at line 179 of file Cube.h.

References IsisCubeDef::labelBytes, and p_cube.

int Cube::LabelBytesUsed (  ) 

Returns the number of bytes used by the label.

Returns:
int the number of bytes used by the label.

Definition at line 815 of file Cube.cpp.

int Isis::Cube::Lines (  )  const [inline]

Returns the number of lines in the cube.

Returns:
int The number of lines in the cube.

Definition at line 194 of file Cube.h.

References IsisCubeDef::lines, and p_cube.

Referenced by Isis::ImagePolygon::Create(), Qisis::CubeViewport::cubeContentsChanged(), Qisis::CubeViewport::cubeLines(), Qisis::CubeViewport::CubeViewport(), Qisis::MosaicItem::drawImage(), Qisis::ViewportBuffer::hasEntireCube(), Isis::Histogram::InitializeFromCube(), Qisis::EditTool::mouseButtonRelease(), Isis::Chip::Read(), Qisis::ScatterPlotData::ScatterPlotData(), Isis::CameraPointInfo::SetCenter(), Isis::Process::SetInputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::CameraPointInfo::SetSample(), Isis::ProcessMapMosaic::StartProcess(), and Isis::TileManager::TileManager().

double Isis::Cube::Multiplier (  )  const [inline]

Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.

\[ out = in * multiplier + base \]

Returns:
double The multiplier value for converting 8-bit/16-bit pixels to 32-bit.

Definition at line 257 of file Cube.h.

References IsisCubeDef::multiplier, and p_cube.

Referenced by Isis::Histogram::InitializeFromCube().

void Cube::Open ( const std::string &  cfile,
std::string  access = "r" 
)

This method will open an isis sube for reading or reading/writing.

Parameters:
[in] cfile Name of the cube file to open. If the extenstion ".cub" is not given it will be appended (i.e., the extension of .cub is forced). Environment variables in the filename will be automatically expanded as well.
[in] access (Default value of "r") Defines how the cube will be accessed. Either readonly "r" or read-write "rw".

Definition at line 114 of file Cube.cpp.

References _FILEINFO_, Isis::Filename::AddExtension(), Isis::ByteOrderEnumeration(), core(), e, Isis::Filename::Expanded(), Isis::Message::FileOpen(), Isis::iException::Message(), Isis::Filename::Path(), Isis::PixelTypeEnumeration(), Isis::Filename::RemoveExtension(), and Isis::PvlKeyword::Unit().

Referenced by Isis::ProcessPolygons::AppendOutputCube(), Qisis::MosaicItem::createFootprint(), Qisis::MosaicItem::displayControlPoints(), Qisis::MosaicItem::drawImage(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::Blobber::load(), Isis::Process::SetInputCube(), Isis::ProcessMosaic::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::GuiCubeParameter::ViewCube(), and Isis::GuiCubeParameter::ViewLabel().

int Cube::PhysicalBand ( const int  virtualBand  )  const

This method will return the physical band number given a virtual band number.

Physical and virtual bands always match unless the programmer made a call to SetVirtualBand prior to opening the cube.

Parameters:
virtualBand Virtual band to translate to physical band.
Returns:
int The physical band number.

Definition at line 574 of file Cube.cpp.

References _FILEINFO_, and Isis::iException::Message().

Isis::PixelType Isis::Cube::PixelType (  )  const [inline]

Returns an enumeration of the PixelType.

See also:
PixelType.h
return Isis::PixelType An enumeration of the PixelType.

Definition at line 203 of file Cube.h.

References p_cube, and IsisCubeDef::pixelType.

Referenced by Isis::ImagePolygon::Create(), Qisis::CubeViewport::CubeViewport(), Qisis::ViewportBuffer::fillBuffer(), Qisis::MosaicItem::getPixelValue(), Isis::CameraPointInfo::GetPointInfo(), Qisis::PlotTool::getSpatialStatistics(), Qisis::StatisticsTool::getStatistics(), Isis::Histogram::InitializeFromCube(), Isis::ProcessExportPds::LineBytes(), Qisis::EditTool::mouseButtonRelease(), Isis::Chip::Read(), Qisis::EditTool::redoEdit(), Qisis::ScatterPlotData::ScatterPlotData(), Isis::Sensor::Sensor(), Qisis::EditTool::undoEdit(), and Qisis::EditTool::writeToCube().

Isis::Projection * Cube::Projection (  ) 

Return a projection associated with the cube.

The generation of the projection can throw an exception, so you might want to catch errors if that interests you.

Definition at line 941 of file Cube.cpp.

Referenced by Isis::ImagePolygon::Create(), Qisis::CubeViewport::CubeViewport(), Isis::Chip::Load(), and Isis::ProcessMapMosaic::StartProcess().

void Cube::PutGroup ( Isis::PvlGroup group  ) 

Adds a group in a Label to the cube.

If the group already exists in the cube it will be completely overwritten. This will only work on output cubes, therefore, input cubes will not be updated.

Exceptions:
IsisProgrammerError The programmer attempted to overwrite the Cube group.
Parameters:
[in] group Label containing the group to put.

Definition at line 1165 of file Cube.cpp.

References Isis::PvlObject::AddGroup(), Isis::PvlObject::FindGroup(), Isis::PvlObject::HasGroup(), and Isis::PvlContainer::Name().

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

void Cube::Read ( Isis::Blob blob  ) 

This method will read data from the specified Blob object.

Parameters:
[in] blob The Blob data to be loaded
Returns:
(type)return description

Definition at line 829 of file Cube.cpp.

References _FILEINFO_, Isis::iException::Message(), and Isis::Blob::Read().

void Cube::Read ( Isis::Buffer rbuf  ) 

This method will read a buffer of data from the cube as specified by the contents of the Buffer object.

Parameters:
rbuf Buffer to be loaded

Definition at line 481 of file Cube.cpp.

References _FILEINFO_, and Isis::iException::Message().

Referenced by Qisis::CubeViewport::bluePixel(), Qisis::MosaicItem::createFootprint(), Isis::Sensor::DemRadius(), Qisis::ViewportBuffer::fillBuffer(), Isis::ImageOverlapSet::FindImageOverlaps(), Qisis::MosaicItem::getPixelValue(), Isis::CameraPointInfo::GetPointInfo(), Qisis::PlotTool::getSpatialStatistics(), Qisis::StatisticsTool::getStatistics(), Qisis::CubeViewport::grayPixel(), Qisis::CubeViewport::greenPixel(), Isis::Histogram::InitializeFromCube(), Isis::Blobber::load(), Qisis::EditTool::mouseButtonRelease(), Isis::Chip::Read(), Qisis::EditTool::redoEdit(), Qisis::CubeViewport::redPixel(), Qisis::ScatterPlotData::ScatterPlotData(), Isis::ImagePolygon::SetImage(), Isis::ProcessByBrick::StartProcess(), Qisis::EditTool::undoEdit(), and Qisis::EditTool::writeToCube().

void Cube::ReOpen ( std::string  access = "r"  ) 

This method will reopen an isis sube for reading or reading/writing.

If access requested is read/write and the open fails, open as read only and throw error.

Parameters:
[in] access (std::string) Type of access needed (read or read/write

Definition at line 288 of file Cube.cpp.

References _FILEINFO_, e, and Isis::iException::Message().

Referenced by Qisis::EditTool::mouseButtonRelease(), and Qisis::EditTool::rubberBandComplete().

int Isis::Cube::Samples (  )  const [inline]

Returns the number of samples in the cube.

Returns:
int The number of samples in the cube.

Definition at line 187 of file Cube.h.

References p_cube, and IsisCubeDef::samples.

Referenced by Isis::ImagePolygon::Create(), Qisis::CubeViewport::cubeContentsChanged(), Qisis::CubeViewport::cubeSamples(), Qisis::CubeViewport::CubeViewport(), Qisis::MosaicItem::drawImage(), Qisis::ViewportBuffer::hasEntireCube(), Isis::ProcessExportPds::LineBytes(), Qisis::EditTool::mouseButtonRelease(), Isis::CubeCalculator::PrepareCalculations(), Isis::Chip::Read(), Qisis::ScatterPlotData::ScatterPlotData(), Isis::CameraPointInfo::SetCenter(), Isis::Process::SetInputCube(), Isis::CameraPointInfo::SetLine(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessMapMosaic::StartProcess(), and Isis::TileManager::TileManager().

void Cube::SetAttached (  ) 

Used prior to the Create method, this will specify that the labels and data will be in one file.

Definition at line 738 of file Cube.cpp.

void Cube::SetBaseMultiplier ( double  base,
double  mult 
)

Used prior to the Create method, this will specify the base and multiplier for converting 8-bit/16-bit back and forth between 32-bit:

\[ 32-bit pixel = 8-bit/16-bit pixel * multiplier + base \]

.

Parameters:
base Additive constant.
mult Multiplicative constant.

Definition at line 728 of file Cube.cpp.

void Cube::SetByteOrder ( Isis::ByteOrder  byteOrder  ) 

Used prior to the Create method, this will specify the byte order of pixels, either least or most significant byte.

Parameters:
byteOrder An enumeration of either Isis::Msb or Isis::Lsb.

Definition at line 678 of file Cube.cpp.

void Cube::SetCubeFormat ( Isis::CubeFormat  cubeFormat  ) 

Used prior to the Create method, this will specify the format of the cube, either band, sequential or tiled.

If not invoked, a tiled file will be created.

Parameters:
cubeFormat An enumeration of either Isis::Bsq or Isis::Tile.

Definition at line 667 of file Cube.cpp.

void Cube::SetDetached (  ) 

Used prior to the Create method, this will specify that the labels and data will be in separate files.

In particular, filename.lbl and filename.cub will contain the labels and cube, respectively.

Definition at line 748 of file Cube.cpp.

void Cube::SetDimensions ( int  ns,
int  nl,
int  nb 
)

Used prior to the Create method to specify the size of the cube.

If not invoked, a 512 x 512 x 1 cube will be created.

Parameters:
ns Number of samples
nl Number of lines
nb Number of bands

Definition at line 637 of file Cube.cpp.

References _FILEINFO_, and Isis::iException::Message().

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

void Cube::SetLabelBytes ( int  labelBytes  ) 

Used prior to the Create method, this will allocate a specific number of bytes in the label area for attached files.

If not invoked, 65536 bytes will be reserved by default.

Parameters:
[in] labelBytes Number of bytes to reserve for label space.

Definition at line 623 of file Cube.cpp.

void Cube::SetMinMax ( double  min,
double  max 
)

Used prior to the Create method, this will compute a good base and multiplier value given the minimum/maximum range of the 32bit data.

For example, min=0.0 and max=1.0 of 32-bit pixels will ensure the base and multiplier will cause the data to be spread out fully in the 8=bit or 16-bit range.

Parameters:
min Minimum 32-bit pixel.
max Maximum 32-bit pixel.

Definition at line 694 of file Cube.cpp.

References base, Isis::VALID_MAX1, Isis::VALID_MAX2, Isis::VALID_MIN1, and Isis::VALID_MIN2.

void Cube::SetPixelType ( Isis::PixelType  pixelType  ) 

Used prior to the Create method, this will specify the output pixel type.

If not invoked, the pixel type will be Real.

Parameters:
pixelType An enumeration of the pixelType desired in the output cube. See PixelType documentation for more information.

Definition at line 655 of file Cube.cpp.

void Cube::SetVirtualBands (  )  [private]

Used prior to the Open method this allows the programmer to specify a subset of bands to work with.

Definition at line 783 of file Cube.cpp.

References _FILEINFO_, band, e, and Isis::iException::Message().

void Cube::SetVirtualBands ( const std::vector< std::string > &  vbands  ) 

Used prior to the Open method, this allows the programmer to specify a subset of bands to work with.

For example, if the programmer only wants to work with band 5 out of a 10 band cube, this can be accommodated. In the future, this method will accept BandBin FilterName as well as band numbers.

Parameters:
[in] vbands A vector of strings containing the virtual bands. The bands will be verified when the cube is opened. For now, the vector must contain integers (e.g., "5", "10", "1").

Definition at line 773 of file Cube.cpp.

Referenced by Isis::Process::SetInputCube().

Isis::Statistics * Cube::Statistics ( const int  band,
const double  validMin,
const double  validMax,
std::string  msg = "Gathering statistics" 
)

This method returns a pointer to a Statistics object which allows the program to obtain and use various statistics from the cube.

Cube does not retain ownership of the returned pointer - please delete it when you are done with it.

Parameters:
band Returns the statistics for the specified band. If the user specifies 0 for this parameter, the method will loop through every band in the cube and accumulate statistics from each band seperately
validMin 
validMax 
msg 
Returns:
Isis::Statistics*

Definition at line 1010 of file Cube.cpp.

References _FILEINFO_, Isis::Statistics::AddData(), Isis::Progress::CheckStatus(), line, Isis::iException::Message(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Statistics::SetValidRange(), and stats.

Isis::Statistics * Cube::Statistics ( const int  band = 1,
std::string  msg = "Gathering statistics" 
)

This method returns a pointer to a Statistics object which allows the program to obtain and use various statistics from the cube.

Cube does not retain ownership of the returned pointer - please delete it when you are done with it.

Parameters:
[in] band (Default value is 1) Returns the statistics for the specified band.If the user specifies 0 for this parameter, the method will loop through every band in the cube and accumulate statistics from each band seperately
msg The message to display with the percent process while gathering statistics
Returns:
(Isis::Histogram) A pointer to a Statistics object containing details such as the minimum and maximum pixel values for the input cube on the band specified, or all bands as the case may be.

Definition at line 989 of file Cube.cpp.

References Isis::ValidMaximum, and Isis::ValidMinimum.

void Cube::Write ( Isis::Blob blob  ) 

This method will write a blob of data (e.g.

History, Table, etc) to the cube as specified by the contents of the Blob object.

Parameters:
blob data to be written

Definition at line 843 of file Cube.cpp.

References _FILEINFO_, Isis::Filename::AddExtension(), Isis::Filename::Expanded(), in, Isis::iException::Message(), Isis::Filename::Name(), Isis::Blob::Name(), Isis::Filename::RemoveExtension(), Isis::Blob::Type(), and Isis::Blob::Write().

void Cube::Write ( Isis::Buffer wbuf  ) 

This method will write a buffer of data from the cube as specified by the contents of the Buffer object.

Parameters:
wbuf Buffer to be written.

Definition at line 498 of file Cube.cpp.

References _FILEINFO_, and Isis::iException::Message().

Referenced by Qisis::EditTool::redoEdit(), Isis::ProcessByBrick::StartProcess(), Qisis::EditTool::undoAll(), Qisis::EditTool::undoEdit(), Isis::Process::WriteHistory(), and Qisis::EditTool::writeToCube().


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