USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::Cube Class Reference

IO Handler for Isis Cubes. More...

#include <Cube.h>

Public Types

enum  Format { Bsq, Tile }
 These are the possible storage formats of Isis3 cubes. More...
 

Public Member Functions

 Cube ()
 Constructs a Cube object.
 
 Cube (const FileName &fileName, QString access="r")
 Construct a cube and open it for reading or reading/writing.
 
virtual ~Cube ()
 Destroys the Cube object.
 
bool isOpen () const
 Test if a cube file has been opened/created.
 
bool isProjected () const
 Returns true if the labels of the cube appear to have a valid mapping group.
 
bool isReadOnly () const
 Test if the opened cube is read-only, that is write operations will fail if this is true.
 
bool isReadWrite () const
 Test if the opened cube is read-write, that is read and write operations should succeed if this is true.
 
bool labelsAttached () const
 Test if labels are attached.
 
void close (bool remove=false)
 Closes the cube and updates the labels.
 
Cubecopy (FileName newFile, const CubeAttributeOutput &newFileAttributes)
 
void create (const QString &cfile)
 This method will create an isis cube for writing.
 
void create (const QString &cfile, const CubeAttributeOutput &att)
 
void open (const QString &cfile, QString access="r")
 This method will open an isis sube for reading or reading/writing.
 
void reopen (QString access="r")
 This method will reopen an isis sube for reading or reading/writing.
 
void read (Blob &blob) const
 This method will read data from the specified Blob object.
 
void read (Buffer &rbuf) const
 This method will read a buffer of data from the cube as specified by the contents of the Buffer object.
 
void write (Blob &blob)
 This method will write a blob of data (e.g.
 
void write (Buffer &wbuf)
 This method will write a buffer of data from the cube as specified by the contents of the Buffer object.
 
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 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 setByteOrder (ByteOrder byteOrder)
 Used prior to the Create method, this will specify the byte order of pixels, either least or most significant byte.
 
void setDimensions (int ns, int nl, int nb)
 Used prior to the Create method to specify the size of the cube.
 
void setExternalDnData (FileName cubeFileWithDnData)
 
void setFormat (Format format)
 Used prior to the Create method, this will specify the format of the cube, either band, sequential or tiled.
 
void setLabelsAttached (bool attached)
 Use prior to calling create, this sets whether or not to use separate label and data files.
 
void setLabelSize (int labelBytes)
 Used prior to the Create method, this will allocate a specific number of bytes in the label area for attached files.
 
void setPixelType (PixelType pixelType)
 Used prior to the Create method, this will specify the output pixel type.
 
void setVirtualBands (const QList< QString > &vbands)
 This allows the programmer to specify a subset of bands to work with.
 
void setVirtualBands (const std::vector< QString > &vbands)
 This is a deprecated version of setVirtualBands(const QList<QString> &).
 
void relocateDnData (FileName dnDataFile)
 
int bandCount () const
 Returns the number of virtual bands for the cube.
 
double base () const
 Returns the base value for converting 8-bit/16-bit pixels to 32-bit.
 
ByteOrder byteOrder () const
 Returns the byte order/endian-ness of the cube file.
 
Cameracamera ()
 Return a camera associated with the cube.
 
FileName externalCubeFileName () const
 If this is an external cube label file, this will give you the cube dn file that this label references.
 
QString fileName () const
 Returns the opened cube's filename.
 
Format format () const
 
Histogramhistogram (const int &band=1, QString 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.
 
Histogramhistogram (const int &band, const double &validMin, const double &validMax, QString 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.
 
Pvllabel () const
 Returns a pointer to the IsisLabel object associated with the cube.
 
int labelSize (bool actual=false) const
 Returns the number of bytes used by the label.
 
int lineCount () const
 
double multiplier () const
 Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.
 
PixelType pixelType () const
 
int physicalBand (const int &virtualBand) const
 This method will return the physical band number given a virtual band number.
 
Projectionprojection ()
 
int sampleCount () const
 
Statisticsstatistics (const int &band=1, QString 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.
 
Statisticsstatistics (const int &band, const double &validMin, const double &validMax, QString 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.
 
bool storesDnData () const
 
void addCachingAlgorithm (CubeCachingAlgorithm *)
 This will add the given caching algorithm to the list of attempted caching algorithms.
 
void clearIoCache ()
 This will clear excess RAM used for quicker IO in the cube.
 
bool deleteBlob (QString BlobType, QString BlobName)
 This method will delete a blob label object from the cube as specified by the Blob type and name.
 
void deleteGroup (const QString &group)
 Deletes a group from the cube labels.
 
PvlGroupgroup (const QString &group) const
 Read a group from the cube into a Label.
 
bool hasGroup (const QString &group) const
 Return if the cube has a specified group in the labels.
 
bool hasTable (const QString &name)
 Check to see if the cube contains a pvl table by the provided name.
 
void putGroup (const PvlGroup &group)
 Adds a group in a Label to the cube.
 

Detailed Description

IO 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

Member Enumeration Documentation

These are the possible storage formats of Isis3 cubes.

There is an internal IO handler for each one of these.

Enumerator
Bsq 

Cubes are stored in band-sequential format, that is the order of the pixels in the file (on disk) is:

    S1,L1,B1
    S2,L1,B1
    and so on until ...
    SN,L1,B1
    S1,L2,B1
    and so on until ...
    S1,LN,B1
    S1,L1,B2
    S2,L1,B2
    and so on until ...
    S1,L1,BN
  

The idea is the cubes are stored left-to-right, top-to-bottom, then front-to-back.

Tile 

Cubes are stored in tile format, that is the order of the pixels in the file (on disk) is BSQ within a given sub-area defined by the Tile IO handler.

Typically these tiles are around 1MB for efficiency.

The idea is the cubes are stored left-to-right, top-to-bottom inside the tiles (which have 1 band). The tiles are themselves in BSQ order also. Please note that this can cause cubes to be larger on disk due to the tile size not being evenly divisible into the cube size.

Cube:

------------------------------
|Tile *Tile *Tile *Tile *Tile|*
|  0  *  1  *  2  *  3  *  4 |*
|     *     *     *     *    |*
|****************************|*
|Tile *Tile *Tile *Tile *Tile|*
|  5  *  6  *  7  *  8  *  9 |*
|     *     *     *     *    |*
|****************************|*
|Tile *Tile *Tile *Tile *Tile|*
------------------------------*
* 10  * 11  * 12  * 13  * 14  *
*******************************

The symbol '*' denotes tile boundaries. The symbols '-' and '|' denote cube boundaries.

Constructor & Destructor Documentation

Isis::Cube::Cube ( )

Constructs a Cube object.

Isis::Cube::Cube ( const FileName fileName,
QString  access = "r" 
)

Construct a cube and open it for reading or reading/writing.

Parameters
fileNameName of the cube file to open. Environment variables in the filename will be automatically expanded.
accessDefines how the cube will be opened. Either read-only "r" or read-write "rw".

References Isis::FileName::toString().

Isis::Cube::~Cube ( )
virtual

Destroys the Cube object.

Member Function Documentation

void Isis::Cube::addCachingAlgorithm ( CubeCachingAlgorithm algorithm)

This will add the given caching algorithm to the list of attempted caching algorithms.

The algorithms are tried in the opposite order that they were added - the first algorithm added is the last algorithm tried.

RegionalCachingAlgorithm is the only initial caching algorithm and works well for most cases. The caching algorithm only apply to the opened Cube and is reset by any changes to the open status of the Cube.

This method takes ownership of algorithm.

Parameters
algorithmThe caching algorithm to add to the Cube for I/O

References _FILEINFO_.

Referenced by Isis::DemShape::DemShape(), Isis::ProcessMapMosaic::RingsSetOutputCube(), and Isis::ProcessMapMosaic::SetOutputCube().

double Isis::Cube::base ( ) const

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.
ByteOrder Isis::Cube::byteOrder ( ) const

Returns the byte order/endian-ness of the cube file.

Cubes in a native byte order are quicker to read/write than those who must correct their byte order.

Returns
The byte order/endian-ness of the cube file
Camera * Isis::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.

Returns
A camera based on the open cube

Referenced by Isis::CameraStatistics::CameraStatistics(), Isis::InterestOperator::FindCnetRef(), Isis::ImagePolygon::initCube(), Isis::InterestOperator::InterestByMeasure(), Isis::Chip::Load(), Isis::ControlNetValidMeasure::MetersFromEdge(), Isis::SunShadowTool::mouseButtonPress(), Isis::SunShadowTool::updateTool(), and Isis::ControlNetValidMeasure::ValidStandardOptions().

void Isis::Cube::clearIoCache ( )

This will clear excess RAM used for quicker IO in the cube.

This should only be called if you need hundreds of cubes opened simultaneously. The IO cache will start growing again on future IO's.

void Isis::Cube::close ( 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.

Referenced by Isis::ImageOverlapSet::FindImageOverlaps(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::FileTool::saveAsCubeByOption(), Isis::ProcessMapMosaic::SetOutputCube(), and Isis::Chip::Write().

void Isis::Cube::create ( const QString &  cubeFileName)

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
ByteOrder Matches architecture of host machine
Attached From user preference file
Label Size 65536 bytes
Format Tiled
Base 0.0
Multiplier 1.0
Parameters
cubeFileNameName 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.

References _FILEINFO_, Isis::FileName::addExtension(), Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), ASSERT, Isis::ByteOrderName(), Isis::FileName::expanded(), Isis::FileName::name(), Isis::None, Isis::PixelTypeName(), Isis::ReadWrite, Isis::FileName::setExtension(), Isis::SizeOf(), and Isis::toString().

Referenced by copy(), Isis::Process::SetOutputCube(), and Isis::Chip::Write().

bool Isis::Cube::deleteBlob ( QString  BlobType,
QString  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
BlobTypetype of blob to search for (Polygon, Table, etc)
BlobNameblob to be deleted
Returns
boolean if it found the blob and deleted it.

References Isis::PvlObject::deleteObject(), Isis::PvlObject::findKeyword(), Isis::PvlContainer::name(), and Isis::PvlObject::object().

void Isis::Cube::deleteGroup ( const QString &  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]groupName of the group to delete.

References Isis::PvlObject::deleteGroup(), Isis::PvlObject::findObject(), and Isis::PvlObject::hasGroup().

Referenced by Isis::SubArea::UpdateLabel().

FileName Isis::Cube::externalCubeFileName ( ) const

If this is an external cube label file, this will give you the cube dn file that this label references.

Returns
The cube that this external label file references

References _FILEINFO_, and Isis::PvlObject::findObject().

Referenced by Isis::Image::copyToNewProjectRoot(), and Isis::Image::deleteFromDisk().

Cube::Format Isis::Cube::format ( ) const
Returns
the cube's storage format. If no cube is opened yet, then this is the storage format that will be used if create(...) is called.
PvlGroup & Isis::Cube::group ( const QString &  group) const

Read a group from the cube into a Label.

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

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

References Isis::PvlObject::findGroup(), and Isis::PvlObject::findObject().

Referenced by Isis::HiEqualization::errorCheck(), and Isis::HiLab::HiLab().

bool Isis::Cube::hasGroup ( const QString &  group) const

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

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

References Isis::PvlObject::findObject(), and Isis::PvlObject::hasGroup().

Referenced by Isis::SubArea::UpdateLabel().

bool Isis::Cube::hasTable ( const QString &  name)

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

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

References Isis::PvlObject::hasKeyword(), Isis::PvlContainer::isNamed(), and Isis::PvlObject::object().

Histogram * Isis::Cube::histogram ( const int &  band = 1,
QString  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
msgThe message to display with the percent process while gathering histogram data
Returns
(Histogram) A pointer to a Histogram object.
Exceptions
IsisProgrammerErrorBand was less than zero or more than the number of bands in the cube.

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

Histogram * Isis::Cube::histogram ( const int &  band,
const double &  validMin,
const double &  validMax,
QString  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]bandReturns 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
validMinThe start of the bin range and valid data range for the histogram
validMaxThe end of the bin range and valid data range for the histogram
msgThe message to display with the percent process while gathering histogram data
Returns
(Histogram) A pointer to a Histogram object.
Exceptions
ProgrammerErrorBand was less than zero or more than the number of bands in the cube.

References _FILEINFO_, Isis::Histogram::AddData(), Isis::Histogram::BinRangeEnd(), Isis::Histogram::BinRangeStart(), Isis::Progress::CheckStatus(), Isis::Buffer::DoubleBuffer(), Isis::Histogram::SetBinRange(), Isis::LineManager::SetLine(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Statistics::SetValidRange(), Isis::Buffer::size(), Isis::ValidMaximum, and Isis::ValidMinimum.

bool Isis::Cube::isOpen ( ) const

Test if a cube file has been opened/created.

Returns
True if a cube has been opened and I/O operations are allowed

References ASSERT.

Referenced by Isis::CubeViewport::CubeViewport(), and Isis::Process::SetInputCube().

bool Isis::Cube::isProjected ( ) const

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
bool Isis::Cube::isReadOnly ( ) const

Test if the opened cube is read-only, that is write operations will fail if this is true.

A cube must be opened in order to call this method.

Returns
True if the cube is opened read-only

References _FILEINFO_, and Isis::ReadWrite.

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

bool Isis::Cube::isReadWrite ( ) const

Test if the opened cube is read-write, that is read and write operations should succeed if this is true.

A cube must be opened in order to call this method.

Returns
True if the cube is opened read-write

Referenced by Isis::ProcessByBrick::ProcessCubeInPlace(), and Isis::ProcessByBrick::StartProcess().

Pvl * Isis::Cube::label ( ) const

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. This pointer is invalid as soon as the cube is closed.

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

Referenced by Isis::AlphaCube::AlphaCube(), Isis::AmicaCamera::AmicaCamera(), Isis::ApolloMetricCamera::ApolloMetricCamera(), Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::Camera::Camera(), Isis::CameraFactory::CameraVersion(), Isis::Chandrayaan1M3Camera::Chandrayaan1M3Camera(), Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), copy(), Isis::CameraFactory::Create(), Isis::ProjectionFactory::CreateFromCube(), Isis::CrismCamera::CrismCamera(), Isis::CTXCamera::CTXCamera(), Isis::DawnFcCamera::DawnFcCamera(), Isis::DawnVirCamera::DawnVirCamera(), Isis::DemShape::DemShape(), Isis::CubeViewport::getBandFilterName(), Isis::HiresCamera::HiresCamera(), Isis::HiriseCamera::HiriseCamera(), Isis::HrscCamera::HrscCamera(), Isis::IdealCamera::IdealCamera(), Isis::ImageImporter::import(), Isis::Image::isFootprintable(), Isis::IssNACamera::IssNACamera(), Isis::IssWACamera::IssWACamera(), Isis::KaguyaMiCamera::KaguyaMiCamera(), Isis::Kernels::Kernels(), Isis::LoHighCamera::LoHighCamera(), Isis::LoMediumCamera::LoMediumCamera(), Isis::LroNarrowAngleCamera::LroNarrowAngleCamera(), Isis::LroWideAngleCamera::LroWideAngleCamera(), Isis::LwirCamera::LwirCamera(), Isis::MarciCamera::MarciCamera(), Isis::Mariner10Camera::Mariner10Camera(), Isis::MdisCamera::MdisCamera(), Isis::MiniRF::MiniRF(), Isis::MocNarrowAngleCamera::MocNarrowAngleCamera(), Isis::MocWideAngleCamera::MocWideAngleCamera(), Isis::MsiCamera::MsiCamera(), Isis::NewHorizonsLeisaCamera::NewHorizonsLeisaCamera(), Isis::NewHorizonsLorriCamera::NewHorizonsLorriCamera(), Isis::NewHorizonsMvicFrameCamera::NewHorizonsMvicFrameCamera(), Isis::NewHorizonsMvicTdiCamera::NewHorizonsMvicTdiCamera(), Isis::NirCamera::NirCamera(), Isis::Process::PropagateTables(), Isis::ProjectionFactory::RingsCreateFromCube(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::Process::SetOutputCube(), Isis::ProcessMosaic::SetOutputCube(), Isis::Spice::Spice(), Isis::SsiCamera::SsiCamera(), Isis::ThemisIrCamera::ThemisIrCamera(), Isis::ThemisVisCamera::ThemisVisCamera(), Isis::UniversalGroundMap::UniversalGroundMap(), Isis::AlphaCube::UpdateGroup(), Isis::SubArea::UpdateLabel(), Isis::SpectralPlotTool::updateTool(), Isis::UvvisCamera::UvvisCamera(), Isis::VikingCamera::VikingCamera(), Isis::VimsCamera::VimsCamera(), and Isis::VoyagerCamera::VoyagerCamera().

bool Isis::Cube::labelsAttached ( ) const

Test if labels are attached.

If a cube is open, then this indicates whether or not the opened cube's labels are attached. If a cube is not open, then this indicates whether or not a cube will be created with attached labels if create(...) is called.

Returns
True for attached labels, false for detached
int Isis::Cube::labelSize ( bool  actual = false) const

Returns the number of bytes used by the label.

Parameters
actualTrue for consumed size, false for allocated size (i.e. the number of bytes in the cube set aside for the label).
Returns
int the number of bytes used by the label.

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

double Isis::Cube::multiplier ( ) const

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.
int Isis::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
virtualBandVirtual band to translate to physical band.
Returns
int The physical band number.

References _FILEINFO_, and Isis::toString().

Referenced by Isis::CubeViewport::getAllWhatsThisInfo().

Projection * Isis::Cube::projection ( )
Returns
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.

Referenced by Isis::ShapeModelFactory::create(), Isis::CubeViewport::CubeViewport(), Isis::DemShape::DemShape(), Isis::Equalization::errorCheck(), Isis::ImagePolygon::initCube(), Isis::Chip::Load(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ProcessMapMosaic::StartProcess(), and Isis::SubArea::UpdateLabel().

void Isis::Cube::putGroup ( const 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.

Parameters
[in]groupLabel containing the group to put.

References Isis::PvlObject::addGroup(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), and Isis::PvlContainer::name().

Referenced by Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), and Isis::SubArea::UpdateLabel().

void Isis::Cube::read ( Buffer bufferToFill) const

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

Parameters
bufferToFillBuffer to be loaded

References _FILEINFO_.

void Isis::Cube::relocateDnData ( FileName  dnDataFile)
void Isis::Cube::reopen ( QString  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(QString) Type of access needed (read or read/write

References _FILEINFO_, and Isis::FileName::expanded().

Referenced by Isis::EditTool::mouseButtonRelease(), Isis::EditTool::rubberBandComplete(), and Isis::FileTool::save().

void Isis::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
baseAdditive constant.
multMultiplicative constant.

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

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

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

Parameters
byteOrderAn enumeration of either Msb or Lsb.

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

void Isis::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
nsNumber of samples
nlNumber of lines
nbNumber of bands

References _FILEINFO_.

Referenced by copy(), Isis::ImageImporter::createOutput(), Isis::Process::SetOutputCube(), and Isis::Chip::Write().

void Isis::Cube::setExternalDnData ( FileName  cubeFileWithDnData)

Referenced by copy().

void Isis::Cube::setFormat ( Format  format)

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
formatAn enumeration of either Bsq or Tile.

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

void Isis::Cube::setLabelsAttached ( bool  attach)

Use prior to calling create, this sets whether or not to use separate label and data files.

Parameters
attachIf false, the labels and data will be in separate files.

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

void Isis::Cube::setLabelSize ( 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]labelBytesNumber of bytes to reserve for label space.

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

void Isis::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
minMinimum 32-bit pixel.
maxMaximum 32-bit pixel.

References Isis::SignedWord, Isis::UnsignedByte, Isis::VALID_MAX1, Isis::VALID_MAX2, Isis::VALID_MIN1, and Isis::VALID_MIN2.

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

void Isis::Cube::setPixelType ( 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
pixelTypeAn enumeration of the pixelType desired in the output cube. See PixelType documentation for more information.

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

void Isis::Cube::setVirtualBands ( const QList< QString > &  vbands)

This allows the programmer to specify a subset of bands to work with.

This works with both read and write operations, but is typically only used for reading. This is helpful because users can specify which bands from an input cube they want to work with. For example, if the user only wants to work with band 5 out of a 10 band cube, this can be accommodated.

Parameters
[in]vbandsA vector of strings containing the virtual bands. The vector must contain integers in string form (e.g., "5", "10", "1").

References Isis::toInt().

Referenced by Isis::Workspace::addCubeViewport(), and Isis::Process::SetInputCube().

void Isis::Cube::setVirtualBands ( const std::vector< QString > &  vbands)

This is a deprecated version of setVirtualBands(const QList<QString> &).

Parameters
[in]vbandsA vector of strings containing the virtual bands. The vector must contain integers in string form (e.g., "5", "10", "1").
Statistics * Isis::Cube::statistics ( const int &  band = 1,
QString  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
msgThe message to display with the percent process while gathering statistics
Returns
(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.

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

Statistics * Isis::Cube::statistics ( const int &  band,
const double &  validMin,
const double &  validMax,
QString  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
bandReturns 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
Statistics*

References _FILEINFO_, Isis::Statistics::AddData(), Isis::Progress::CheckStatus(), Isis::Buffer::DoubleBuffer(), Isis::LineManager::SetLine(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Statistics::SetValidRange(), and Isis::Buffer::size().

bool Isis::Cube::storesDnData ( ) const
void Isis::Cube::write ( Blob blob)
void Isis::Cube::write ( Buffer bufferToWrite)

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

Parameters
bufferToWriteBuffer to be written.

References _FILEINFO_.


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