![]() |
Isis 3 Programmer Reference
|
IO Handler for Isis Cubes. More...
#include <Cube.h>
Public Types | |
enum | Format { Bsq, Tile } |
These are the possible storage formats of ISIS cubes. More... | |
Public Member Functions | |
Cube () | |
Constructs a Cube object. More... | |
Cube (const FileName &fileName, QString access="r") | |
Construct a cube and open it for reading or reading/writing. More... | |
virtual | ~Cube () |
Destroys the Cube object. More... | |
void | fromIsd (const FileName &fileName, Pvl &label, nlohmann::json &isd, QString access) |
Initialize Cube data from a PVL label and JSON ISD. More... | |
void | fromIsd (const FileName &fileName, FileName &labelFile, FileName &isdFile, QString access) |
Initialize Cube data from a PVL label and JSON ISD. More... | |
void | fromLabel (const FileName &fileName, Pvl &label, QString access) |
Initialize Cube data from a PVL label. More... | |
bool | isOpen () const |
Test if a cube file has been opened/created. More... | |
bool | isProjected () const |
Returns true if the labels of the cube appear to have a valid mapping group. More... | |
bool | isReadOnly () const |
Test if the opened cube is read-only, that is write operations will fail if this is true. More... | |
bool | isReadWrite () const |
Test if the opened cube is read-write, that is read and write operations should succeed if this is true. More... | |
bool | labelsAttached () const |
Test if labels are attached. More... | |
void | attachSpiceFromIsd (nlohmann::json Isd) |
void | close (bool remove=false) |
Closes the cube and updates the labels. More... | |
Cube * | copy (FileName newFile, const CubeAttributeOutput &newFileAttributes) |
Copies the cube to the new fileName. More... | |
void | create (const QString &cfile) |
This method will create an isis cube for writing. More... | |
void | create (const QString &cfile, const CubeAttributeOutput &att) |
This method will create an isis cube for writing. More... | |
void | open (const QString &cfile, QString access="r") |
This method will open an isis cube for reading or reading/writing. More... | |
void | reopen (QString access="r") |
This method will reopen an isis sube for reading or reading/writing. More... | |
void | read (Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const |
This method will read data from the specified Blob object. More... | |
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. More... | |
OriginalLabel | readOriginalLabel (const QString &name="IsisCube") const |
Read the original PDS3 label from a cube. More... | |
CubeStretch | readCubeStretch (QString name="CubeStretch", const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const |
Read a Stretch from a cube. More... | |
OriginalXmlLabel | readOriginalXmlLabel () const |
Read the original PDS4 label from a cube. More... | |
History | readHistory (const QString &name="IsisCube") const |
Read the History from the Cube. More... | |
ImagePolygon | readFootprint () const |
Read the footprint polygon for the Cube. More... | |
Table | readTable (const QString &name) |
Read a Table from the cube. More... | |
void | write (Blob &blob, bool overwrite=true) |
This method will write a blob of data (e.g. More... | |
void | write (const Table &table) |
Write a Table to the Cube. More... | |
void | write (const CubeStretch &cubeStretch) |
Write a Stretch to the Cube. More... | |
void | write (OriginalLabel &lab) |
This method will write an OriginalLabel object. More... | |
void | write (const OriginalXmlLabel &lab) |
This method will write an OriginalXmlLabel object. More... | |
void | write (History &history, const QString &name="IsisCube") |
Write an updated History to the Cube. More... | |
void | write (const ImagePolygon &polygon) |
Write a polygon to the Cube. More... | |
void | write (Buffer &wbuf) |
This method will write a buffer of data from the cube as specified by the contents of the Buffer object. More... | |
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: More... | |
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. More... | |
void | setByteOrder (ByteOrder byteOrder) |
Used prior to the Create method, this will specify the byte order of pixels, either least or most significant byte. More... | |
void | setDimensions (int ns, int nl, int nb) |
Used prior to the Create method to specify the size of the cube. More... | |
void | setExternalDnData (FileName cubeFileWithDnData) |
Used to set external dn data to cube. More... | |
void | setFormat (Format format) |
Used prior to the Create method, this will specify the format of the cube, either band, sequential or tiled. More... | |
void | setLabelsAttached (bool attached) |
Use prior to calling create, this sets whether or not to use separate label and data files. More... | |
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. More... | |
void | setPixelType (PixelType pixelType) |
Used prior to the Create method, this will specify the output pixel type. More... | |
void | setVirtualBands (const QList< QString > &vbands) |
This allows the programmer to specify a subset of bands to work with. More... | |
void | setVirtualBands (const std::vector< QString > &vbands) |
This is a deprecated version of setVirtualBands(const QList<QString> &). More... | |
void | relocateDnData (FileName dnDataFile) |
Relocates the DN data for a cube to an external cube label file. More... | |
virtual int | bandCount () const |
Returns the number of virtual bands for the cube. More... | |
double | base () const |
Returns the base value for converting 8-bit/16-bit pixels to 32-bit. More... | |
ByteOrder | byteOrder () const |
Returns the byte order/endian-ness of the cube file. More... | |
Camera * | camera () |
Return a camera associated with the cube. More... | |
FileName | externalCubeFileName () const |
If this is an external cube label file, this will give you the cube dn file that this label references. More... | |
virtual QString | fileName () const |
Returns the opened cube's filename. More... | |
Format | format () const |
virtual Histogram * | 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. More... | |
virtual Histogram * | 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. More... | |
Pvl * | label () const |
Returns a pointer to the IsisLabel object associated with the cube. More... | |
int | labelSize (bool actual=false) const |
Returns the number of bytes used by the label. More... | |
int | lineCount () const |
double | multiplier () const |
Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit. More... | |
PixelType | pixelType () const |
virtual int | physicalBand (const int &virtualBand) const |
This method will return the physical band number given a virtual band number. More... | |
Projection * | projection () |
int | sampleCount () const |
Statistics * | 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. More... | |
Statistics * | 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. More... | |
bool | storesDnData () const |
This method returns a boolean value. More... | |
void | addCachingAlgorithm (CubeCachingAlgorithm *) |
This will add the given caching algorithm to the list of attempted caching algorithms. More... | |
void | clearIoCache () |
This will clear excess RAM used for quicker IO in the cube. More... | |
bool | deleteBlob (QString BlobName, QString BlobType) |
This method will delete a blob label object from the cube as specified by the Blob type and name. More... | |
void | deleteGroup (const QString &group) |
Deletes a group from the cube labels. More... | |
PvlGroup & | group (const QString &group) const |
Read a group from the cube into a Label. More... | |
bool | hasGroup (const QString &group) const |
Return if the cube has a specified group in the labels. More... | |
bool | hasTable (const QString &name) |
Check to see if the cube contains a pvl table by the provided name. More... | |
bool | hasBlob (const QString &name, const QString &type) |
Check to see if the cube contains a BLOB. More... | |
void | putGroup (const PvlGroup &group) |
Adds a group in a Label to the cube. More... | |
void | latLonRange (double &minLatitude, double &maxLatitude, double &minLongitude, double &maxLongitude) |
Returns the latitude and longitude range for the Cube. More... | |
Private Member Functions | |
void | applyVirtualBandsToLabel () |
Applies virtual bands to label. More... | |
void | cleanUp (bool remove) |
This clears all of the allocated memory associated with an open cube. More... | |
void | construct () |
Initialize members from their initial undefined states. More... | |
QFile * | dataFile () const |
This returns the QFile with cube DN data in it. More... | |
FileName | realDataFileName () const |
This gets the file name of the file which actually contains the DN data. More... | |
void | initialize () |
This sets Cube to its default state: Native byte order Format = Tile PixelType = Real (4 bytes per pixel) Attached labels Label size = 65536 bytes. More... | |
void | initCoreFromLabel (const Pvl &label) |
This function initializes the Cube core from a Pvl Label passed as a parameter. More... | |
void | initLabelFromFile (FileName labelFileName, bool readWrite) |
This function initializes the Cube label from a file passed as a parameter. More... | |
void | openCheck () |
Throw an exception if the cube is not open. More... | |
Pvl | realDataFileLabel () const |
Function to read data from a cube label and return it as a PVL object. More... | |
void | reformatOldIsisLabel (const QString &oldCube) |
This is a helper, used by open(...), that handles opening Isis 2 cubes as if they were Isis cubes. More... | |
void | writeLabels () |
Write the Pvl labels to the cube's label file. More... | |
Private Attributes | |
QFile * | m_labelFile |
This is the file that contains the labels always; if labels are attached then this contains the file data also. More... | |
QFile * | m_dataFile |
This is only sometimes allocated. More... | |
CubeIoHandler * | m_ioHandler |
This does the heavy lifting for cube DN IO and is always allocated when isOpen() is true. More... | |
ByteOrder | m_byteOrder |
The byte order of the opened cube; if there is no open cube then this is the byte order that will be used when a new cube is created. More... | |
Format | m_format |
If isOpen() then this is the IO format that the cube uses. More... | |
PixelType | m_pixelType |
This is the pixel type on disk. More... | |
QMutex * | m_mutex |
Basic thread-safety mutex; this class is not optimized for threads. More... | |
Camera * | m_camera |
Camera allocated from the camera() method. More... | |
Projection * | m_projection |
Projection allocated from the projection() method. More... | |
FileName * | m_labelFileName |
The full filename of the label file (.lbl or .cub) More... | |
FileName * | m_dataFileName |
The full filename of the data file (.cub) More... | |
FileName * | m_tempCube |
If open was called with an Isis 2 cube, then this will be the name of the imported ISIS cube. More... | |
FileName * | m_formatTemplateFile |
Label pvl format template file (describes how to format labels) More... | |
bool | m_attached |
True if labels are attached. More... | |
bool | m_storesDnData |
True (most common case) when the cube DN data is inside the file we're writing to. More... | |
Pvl * | m_label |
The label if IsOpen(), otherwise NULL. More... | |
int | m_labelBytes |
The maximum allowed size of the label; the allocated space. More... | |
int | m_samples |
The sample count of the open cube or the cube that will be created. More... | |
int | m_lines |
The line count of the open cube or the cube that will be created. More... | |
int | m_bands |
The band count of the open cube or the cube that will be created. More... | |
double | m_base |
The base of the open cube or the cube that will be created; does not apply if m_pixelType is Real. More... | |
double | m_multiplier |
The multiplier of the open cube or the cube that will be created; does not apply if m_pixelType is Real. More... | |
QList< int > * | m_virtualBandList |
If allocated, converts from physical on-disk band # to virtual band #. More... | |
IO Handler for Isis Cubes.
This class is used to open, create, read, and write data from Isis cube files.
enum Isis::Cube::Format |
These are the possible storage formats of ISIS 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. |
Isis::Cube::Cube | ( | const FileName & | fileName, |
QString | access = "r" |
||
) |
Construct a cube and open it for reading or reading/writing.
fileName | Name of the cube file to open. Environment variables in the filename will be automatically expanded. |
access | Defines how the cube will be opened. Either read-only "r" or read-write "rw". |
Definition at line 62 of file Cube.cpp.
References Isis::FileName::toString().
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.
algorithm | The caching algorithm to add to the Cube for I/O |
Definition at line 1922 of file Cube.cpp.
Referenced by Isis::DemShape::DemShape(), Isis::ProcessMapMosaic::RingsSetOutputCube(), and Isis::ProcessMapMosaic::SetOutputCube().
|
private |
Applies virtual bands to label.
Definition at line 2078 of file Cube.cpp.
References Isis::PvlContainer::clear(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::keywords(), Isis::toString(), and Isis::PvlKeyword::unit().
|
virtual |
Returns the number of virtual bands for the cube.
Definition at line 1410 of file Cube.cpp.
Referenced by Isis::Equalization::applyCorrection(), Isis::Process::CalculateStatistics(), Isis::Camera::Camera(), Isis::Process::CheckRequirements(), Isis::CubeViewport::cubeBands(), Isis::CubeViewport::CubeViewport(), Isis::Equalization::errorCheck(), Isis::CubeViewport::getAllWhatsThisInfo(), Isis::SpectralPlotTool::getSpectralStatistics(), Isis::ImageHistogram::ImageHistogram(), Isis::Equalization::loadInputs(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::FileTool::saveAs_FullResolution(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsEnlargedCube(), Isis::FileTool::saveAsReducedCube(), Isis::BandTool::setBandBin(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::SpectralDefinition2D::SpectralDefinition2D(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), and Isis::SpectralPlotTool::updateTool().
double Isis::Cube::base | ( | ) | const |
Returns the base value for converting 8-bit/16-bit pixels to 32-bit.
out = in * multiplier + base
Definition at line 1427 of file Cube.cpp.
Referenced by Isis::FileTool::copyCubeDetails().
ByteOrder Isis::Cube::byteOrder | ( | ) | const |
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.
Definition at line 1451 of file Cube.cpp.
Referenced by Isis::StereoTool::calculateElevation(), Isis::CameraStatistics::CameraStatistics(), Isis::InterestOperator::FindCnetRef(), Isis::ImportImagesWorkOrder::importConfirmedImages(), Isis::ImagePolygon::initCube(), Isis::InterestOperator::InterestByMeasure(), Isis::Chip::Load(), Isis::ControlNetValidMeasure::MetersFromEdge(), Isis::SunShadowTool::mouseButtonPress(), Isis::PhotometricFunction::PhotometricFunction(), Isis::SunShadowTool::recalculateShadowHeight(), Isis::SunShadowTool::updateTool(), and Isis::ControlNetValidMeasure::ValidStandardOptions().
|
private |
void Isis::Cube::clearIoCache | ( | ) |
void Isis::Cube::close | ( | bool | removeIt = false | ) |
Closes the cube and updates the labels.
Optionally, it deletes the cube if requested.
removeIt | (Default value = false) Indicates if the file should be removed/deleted. |
Definition at line 260 of file Cube.cpp.
Referenced by Isis::ImageOverlapSet::FindImageOverlaps(), Isis::Process::PropagateTables(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsReducedCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::GuiCubeParameter::ViewCube(), Isis::GuiCubeParameter::ViewLabel(), and Isis::Chip::Write().
|
private |
Cube * Isis::Cube::copy | ( | FileName | newFile, |
const CubeAttributeOutput & | newFileAttributes | ||
) |
Copies the cube to the new fileName.
newFile | FileName |
newFileAttributes | CubeAttributeOutput |
Definition at line 276 of file Cube.cpp.
References Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), Isis::BufferManager::begin(), Isis::CubeAttributeOutput::byteOrder(), Isis::Buffer::Copy(), create(), Isis::DetachedLabel, Isis::BufferManager::end(), Isis::FileName::expanded(), Isis::ExternalLabel, Isis::CubeAttributeOutput::fileFormat(), Isis::PvlObject::findObject(), Isis::PvlObject::group(), Isis::PvlObject::groups(), Isis::PvlContainer::isNamed(), label(), Isis::CubeAttributeOutput::maximum(), Isis::CubeAttributeOutput::minimum(), Isis::PvlContainer::name(), Isis::BufferManager::next(), Isis::PvlObject::object(), Isis::FileName::original(), pixelType(), Isis::CubeAttributeOutput::pixelType(), Isis::CubeAttributeOutput::propagateMinimumMaximum(), Isis::CubeAttributeOutput::propagatePixelType(), setBaseMultiplier(), setByteOrder(), setDimensions(), setExternalDnData(), setFormat(), setLabelsAttached(), setLabelSize(), setMinMax(), setPixelType(), and write().
Referenced by Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), and Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()().
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:
cubeFileName | 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 414 of file Cube.cpp.
References Isis::FileName::addExtension(), Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), Isis::FileName::expanded(), Isis::FileName::name(), Isis::PixelTypeName(), Isis::FileName::setExtension(), Isis::SizeOf(), and Isis::toString().
Referenced by copy(), Isis::FileTool::copyCubeDetails(), Isis::ImageImporter::createOutput(), Isis::Process::SetOutputCube(), and Isis::Chip::Write().
void Isis::Cube::create | ( | const QString & | cubeFileName, |
const CubeAttributeOutput & | att | ||
) |
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:
cubeFileName | 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. |
att | CubeAttributeOutput |
Definition at line 604 of file Cube.cpp.
References Isis::AttachedLabel, Isis::CubeAttributeOutput::byteOrder(), Isis::CubeAttributeOutput::fileFormat(), Isis::CubeAttributeOutput::maximum(), Isis::CubeAttributeOutput::minimum(), Isis::CubeAttributeOutput::pixelType(), and Isis::CubeAttributeOutput::propagatePixelType().
|
private |
bool Isis::Cube::deleteBlob | ( | QString | BlobName, |
QString | BlobType | ||
) |
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.
BlobName | blob to be deleted |
BlobType | type of blob to search for (Polygon, Table, etc) |
Definition at line 1955 of file Cube.cpp.
References Isis::PvlObject::deleteObject(), Isis::PvlObject::findKeyword(), Isis::PvlContainer::name(), and Isis::PvlObject::object().
Referenced by Isis::StretchTool::deleteFromCube().
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.
[out] | group | Name of the group to delete. |
Definition at line 1977 of file Cube.cpp.
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.
Definition at line 1535 of file Cube.cpp.
References Isis::PvlObject::findObject().
Referenced by Isis::Image::copyToNewProjectRoot(), Isis::Shape::copyToNewProjectRoot(), Isis::ControlPointEditWidget::createControlPoint(), Isis::Image::deleteFromDisk(), Isis::Shape::deleteFromDisk(), and Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()().
|
virtual |
Returns the opened cube's filename.
This is the name of the file which contains the labels of the cube and not necessarily the cube data.
Definition at line 1563 of file Cube.cpp.
Referenced by Isis::Workspace::addCubeViewport(), Isis::Process::CheckRequirements(), Isis::ImagePolygon::Create(), Isis::StereoTool::createPoint(), Isis::MatchTool::createPoint(), Isis::CubeViewport::CubeViewport(), Isis::FileTool::exportToList(), Isis::FeatureNomenclatureTool::featuresForViewportFound(), Isis::CubeViewport::getAllWhatsThisInfo(), Isis::Image::Image(), Isis::CSMCamera::init(), Isis::ImagePolygon::initCube(), Isis::CubeViewport::keyPressEvent(), Isis::Chip::Load(), Isis::ControlNetValidMeasure::MetersFromEdge(), Isis::EditTool::mouseButtonRelease(), Isis::ControlNetTool::mouseButtonRelease(), Isis::MatchTool::mouseButtonRelease(), Isis::QnetTool::mouseButtonRelease(), Isis::QnetTool::openGround(), Isis::InterestOperator::Operate(), Isis::OverlapStatistics::OverlapStatistics(), Isis::CubePlotCurve::paint(), Isis::ScatterPlotConfigDialog::refreshWidgetStates(), Isis::AbstractPlotTool::repaintViewports(), Isis::EditTool::rubberBandComplete(), Isis::FileTool::saveAsReducedCube(), Isis::ScatterPlotWindow::ScatterPlotWindow(), Isis::MatchTool::serialNumberList(), Isis::CubeViewport::setCaption(), Isis::StereoTool::setFiles(), Isis::CubeViewport::setTrackingCube(), Isis::Shape::Shape(), Isis::ChipViewport::stretchFromCubeViewport(), Isis::UniversalGroundMap::UniversalGroundMap(), Isis::MeasureTool::updateDist(), Isis::AdvancedTrackTool::updateRow(), and Isis::ControlNetValidMeasure::ValidStandardOptions().
Cube::Format Isis::Cube::format | ( | ) | const |
void Isis::Cube::fromIsd | ( | const FileName & | fileName, |
FileName & | labelFile, | ||
FileName & | isdFile, | ||
QString | access | ||
) |
Initialize Cube data from a PVL label and JSON ISD.
fileName | Name of the cube file to open. Environment variables in the filename will be automatically expanded. |
labelFile | Path to PVL label representing the new Cube label |
isdPath | Path to Ale compatible ISD |
access | Defines how the cube will be opened. Either read-only "r" or read-write "rw". |
Definition at line 117 of file Cube.cpp.
References Isis::FileName::baseName(), and Isis::FileName::expanded().
void Isis::Cube::fromIsd | ( | const FileName & | fileName, |
Pvl & | label, | ||
nlohmann::json & | isd, | ||
QString | access | ||
) |
Initialize Cube data from a PVL label and JSON ISD.
fileName | Name of the cube file to open. Environment variables in the filename will be automatically expanded. |
label | PVL label object representing the new Cube label |
isd | JSON object containing Ale compatible ISD |
access | Defines how the cube will be opened. Either read-only "r" or read-write "rw". |
Definition at line 99 of file Cube.cpp.
References Isis::FileName::toString().
Initialize Cube data from a PVL label.
fileName | Name of the cube file to open. Environment variables in the filename will be automatically expanded. |
label | PVL label object representing the new Cube label |
access | Defines how the cube will be opened. Either read-only "r" or read-write "rw". |
Definition at line 76 of file Cube.cpp.
References Isis::PvlObject::beginGroup(), Isis::PvlObject::endGroup(), Isis::FileName::expanded(), Isis::PvlObject::findObject(), and Isis::FileName::toString().
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.
[out] | group | Name of the group to get |
Definition at line 1991 of file Cube.cpp.
References Isis::PvlObject::findGroup(), and Isis::PvlObject::findObject().
Referenced by Isis::HiEqualization::errorCheck(), Isis::HiLab::HiLab(), and Isis::CubeViewport::setTrackingCube().
bool Isis::Cube::hasBlob | ( | const QString & | name, |
const QString & | type | ||
) |
Check to see if the cube contains a BLOB.
name | The name of the BLOB to search for |
type | The type of the BLOB to search for |
Definition at line 2019 of file Cube.cpp.
References Isis::PvlObject::hasKeyword(), Isis::PvlContainer::isNamed(), Isis::PvlObject::object(), and Isis::PvlObject::objects().
Referenced by Isis::CameraFactory::Create(), and Isis::Spice::Spice().
bool Isis::Cube::hasGroup | ( | const QString & | group | ) | const |
Return if the cube has a specified group in the labels.
[out] | group | Name of the group to check. |
Definition at line 2004 of file Cube.cpp.
References Isis::PvlObject::findObject(), and Isis::PvlObject::hasGroup().
Referenced by Isis::CubeViewport::CubeViewport(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::SubArea::UpdateLabel(), and Isis::AdvancedTrackTool::updateRow().
bool Isis::Cube::hasTable | ( | const QString & | name | ) |
Check to see if the cube contains a pvl table by the provided name.
name | The name of the pvl table to search for |
Definition at line 2043 of file Cube.cpp.
Referenced by Isis::ClipperNacRollingShutterCamera::ClipperNacRollingShutterCamera(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), and Isis::AdvancedTrackTool::updateRow().
|
virtual |
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.
[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 |
ProgrammerError | Band was less than zero or more than the number of bands in the cube. |
Definition at line 1629 of file Cube.cpp.
References Isis::Histogram::AddData(), Isis::Progress::CheckStatus(), Isis::Buffer::DoubleBuffer(), Isis::LineManager::SetLine(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Histogram::SetValidRange(), Isis::Buffer::size(), Isis::ValidMaximum, and Isis::ValidMinimum.
|
virtual |
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.
[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 |
IsisProgrammerError | Band was less than zero or more than the number of bands in the cube. |
Definition at line 1599 of file Cube.cpp.
References Isis::ValidMaximum, and Isis::ValidMinimum.
|
private |
This function initializes the Cube core from a Pvl Label passed as a parameter.
label | Pvl label to initialize from |
Definition at line 2290 of file Cube.cpp.
References Isis::FileName::expanded(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), Isis::FileName::original(), Isis::PixelTypeEnumeration(), and Isis::FileName::toString().
|
private |
|
private |
This function initializes the Cube label from a file passed as a parameter.
labelFileName | FileName to initialize from |
readWrite | bool that determines whether the label is an old isis label and needs to be reformatted |
Definition at line 2334 of file Cube.cpp.
References Isis::FileName::addExtension(), Isis::FileName::expanded(), Isis::FileName::fileExists(), Isis::FileName::original(), and Isis::FileName::setExtension().
bool Isis::Cube::isOpen | ( | ) | const |
Test if a cube file has been opened/created.
Definition at line 183 of file Cube.cpp.
Referenced by Isis::CubeViewport::CubeViewport(), and Isis::Process::SetInputCube().
bool Isis::Cube::isProjected | ( | ) | const |
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.
Definition at line 213 of file Cube.cpp.
Referenced by Isis::StretchTool::deleteFromCube(), Isis::EditTool::mouseButtonRelease(), Isis::EditTool::redoEdit(), Isis::EditTool::rubberBandComplete(), Isis::StretchTool::saveStretchToCube(), Isis::EditTool::undoAll(), and Isis::EditTool::undoEdit().
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.
Definition at line 235 of file Cube.cpp.
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.
Definition at line 1701 of file Cube.cpp.
Referenced by Isis::AlphaCube::AlphaCube(), Isis::ApolloMetricCamera::ApolloMetricCamera(), Isis::ApolloPanoramicCamera::ApolloPanoramicCamera(), Isis::Camera::Camera(), Isis::CameraFactory::CameraVersion(), Isis::Chandrayaan1M3Camera::Chandrayaan1M3Camera(), Isis::ClipperNacRollingShutterCamera::ClipperNacRollingShutterCamera(), Isis::ClipperPushBroomCamera::ClipperPushBroomCamera(), Isis::ClipperWacFcCamera::ClipperWacFcCamera(), Isis::ObservationNumber::Compose(), Isis::SerialNumber::Compose(), copy(), Isis::FileTool::copyCubeDetails(), Isis::CameraFactory::Create(), Isis::ProjectionFactory::CreateFromCube(), Isis::CrismCamera::CrismCamera(), Isis::CTXCamera::CTXCamera(), Isis::DawnFcCamera::DawnFcCamera(), Isis::DawnVirCamera::DawnVirCamera(), Isis::StretchTool::deleteFromCube(), Isis::DemShape::DemShape(), Isis::SpectralPlotWindow::drawBandMarkers(), Isis::CubeViewport::getBandFilterName(), Isis::SpectralPlotTool::getSpectralStatistics(), Isis::HayabusaAmicaCamera::HayabusaAmicaCamera(), Isis::HayabusaNirsCamera::HayabusaNirsCamera(), Isis::HiresCamera::HiresCamera(), Isis::HiriseCamera::HiriseCamera(), Isis::HrscCamera::HrscCamera(), Isis::Hyb2OncCamera::Hyb2OncCamera(), Isis::IdealCamera::IdealCamera(), Isis::ImageImporter::import(), Isis::ImportImagesWorkOrder::importConfirmedImages(), Isis::CSMCamera::init(), Isis::Image::initCamStats(), Isis::Shape::initCamStats(), Isis::Image::isFootprintable(), Isis::Shape::isFootprintable(), Isis::IssNACamera::IssNACamera(), Isis::IssWACamera::IssWACamera(), Isis::JunoCamera::JunoCamera(), Isis::KaguyaMiCamera::KaguyaMiCamera(), Isis::KaguyaTcCamera::KaguyaTcCamera(), Isis::Kernels::Kernels(), Isis::StretchTool::loadStretchFromCube(), 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::MexHrscSrcCamera::MexHrscSrcCamera(), 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::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::OsirisRexOcamsCamera::OsirisRexOcamsCamera(), Isis::Process::PropagateTables(), Isis::MocLabels::ReadLabels(), Isis::ProjectionFactory::RingsCreateFromCube(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::RosettaOsirisCamera::RosettaOsirisCamera(), Isis::RosettaVirtisCamera::RosettaVirtisCamera(), Isis::StretchTool::saveStretchToCube(), Isis::BandTool::setBandBin(), Isis::Process::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::Spice::Spice(), Isis::SsiCamera::SsiCamera(), Isis::TgoCassisCamera::TgoCassisCamera(), Isis::ThemisIrCamera::ThemisIrCamera(), Isis::ThemisVisCamera::ThemisVisCamera(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::UniversalGroundMap::UniversalGroundMap(), Isis::AlphaCube::UpdateGroup(), Isis::SubArea::UpdateLabel(), Isis::SpectralPlotTool::updateTool(), Isis::UvvisCamera::UvvisCamera(), Isis::GuiCubeParameter::ViewLabel(), 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.
int Isis::Cube::labelSize | ( | bool | actual = false | ) | const |
Returns the number of bytes used by the label.
actual | True for consumed size, false for allocated size (i.e. the number of bytes in the cube set aside for the label). |
Definition at line 1713 of file Cube.cpp.
Referenced by Isis::FileTool::copyCubeDetails(), and Isis::Process::SetOutputCube().
void Isis::Cube::latLonRange | ( | double & | minLatitude, |
double & | maxLatitude, | ||
double & | minLongitude, | ||
double & | maxLongitude | ||
) |
Returns the latitude and longitude range for the Cube.
More accurate than the minimum and maximum latitude and longitude from the mapping group.
[out] | minLatitude | minimum latitude present in the cube |
[out] | maxLatitude | maximum latitude present in the cube |
[out] | minLongitude | minimum longitude present in the cube |
[out] | maxLongitude | maximum longitude present in the cube |
Definition at line 2514 of file Cube.cpp.
References Isis::Camera::SetImage(), Isis::Projection::SetWorld(), Isis::TProjection::UniversalLatitude(), Isis::Sensor::UniversalLatitude(), Isis::TProjection::UniversalLongitude(), and Isis::Sensor::UniversalLongitude().
int Isis::Cube::lineCount | ( | ) | const |
Definition at line 1734 of file Cube.cpp.
Referenced by Isis::AlphaCube::AlphaCube(), Isis::Equalization::applyCorrection(), Isis::ImagePolygon::calcImageBorderCoordinates(), Isis::Process::CalculateStatistics(), Isis::Camera::Camera(), Isis::Process::CheckRequirements(), Isis::Image::createFootprint(), Isis::Shape::createFootprint(), Isis::StereoTool::createPoint(), Isis::CubeViewport::cubeContentsChanged(), Isis::CubeViewport::cubeDataChanged(), Isis::CubeViewport::cubeLines(), Isis::CubeViewport::CubeViewport(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::CubeViewport::getAllWhatsThisInfo(), Isis::UniversalGroundMap::GroundRange(), Isis::StretchTool::histFromCube(), Isis::ImagePolygon::initCube(), Isis::ImageExporter::initializeProcess(), Isis::ControlNetValidMeasure::MetersFromEdge(), Isis::EditTool::mouseButtonRelease(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ControlNetValidMeasure::PixelsFromEdge(), Isis::Chip::Read(), Isis::ScatterPlotConfigDialog::refreshWidgetStates(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::RosettaOsirisCamera::RosettaOsirisCamera(), Isis::FileTool::saveAs_FullResolution(), Isis::FileTool::saveAsCubeByOption(), Isis::ScatterPlotData::ScatterPlotData(), Isis::ProcessByBrick::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::SpectralDefinition2D::SpectralDefinition2D(), Isis::ProcessMapMosaic::StartProcess(), Isis::StretchTool::statsFromCube(), Isis::TileManager::TileManager(), and Isis::SubArea::UpdateLabel().
double Isis::Cube::multiplier | ( | ) | const |
Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.
out = in * multiplier + base
Definition at line 1748 of file Cube.cpp.
Referenced by Isis::FileTool::copyCubeDetails().
void Isis::Cube::open | ( | const QString & | cubeFileName, |
QString | access = "r" |
||
) |
This method will open an isis cube for reading or reading/writing.
[in] | cubeFileName | Name of the cube file to open. Environment variables in the filename will be automatically expanded. |
[in] | access | (Default value of "r") Defines how the cube will be accessed. Either read-only "r" or read-write "rw". |
Definition at line 627 of file Cube.cpp.
References Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), Isis::FileName::name(), Isis::FileName::original(), and Isis::FileName::originalPath().
Referenced by Isis::CubeDataThread::AddCube(), Isis::Workspace::addCubeViewport(), Isis::Workspace::addCubeViewportFromList(), Isis::ProcessPolygons::AppendOutputCube(), Isis::Equalization::calculateOverlapStatistics(), Isis::CameraStatistics::CameraStatistics(), Isis::ShapeModelFactory::create(), Isis::Equalization::errorCheck(), Isis::HiEqualization::errorCheck(), Isis::ImageOverlapSet::FindImageOverlaps(), Isis::GisGeometry::GisGeometry(), Isis::Blobber::load(), Isis::Equalization::loadInputs(), Isis::EditTool::mouseButtonRelease(), Isis::Process::PropagateTables(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::EditTool::rubberBandComplete(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsReducedCube(), Isis::MatchTool::selectLeftMeasure(), Isis::MatchTool::selectRightMeasure(), Isis::Process::SetInputCube(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::GuiCubeParameter::ViewCube(), and Isis::GuiCubeParameter::ViewLabel().
|
private |
|
virtual |
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.
virtualBand | Virtual band to translate to physical band. |
Definition at line 1773 of file Cube.cpp.
References Isis::toString().
Referenced by Isis::CubeViewport::getAllWhatsThisInfo(), and Isis::CubeViewport::updateWhatsThis().
PixelType Isis::Cube::pixelType | ( | ) | const |
Definition at line 1758 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), Isis::CubeViewport::CubeViewport(), Isis::DemShape::DemShape(), Isis::MosaicSceneItem::getPixelValue(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::StatisticsTool::getStatistics(), Isis::StretchTool::histFromCube(), Isis::ImageHistogram::ImageHistogram(), Isis::ImagePolygon::initCube(), Isis::InterestOperator::InterestByMeasure(), Isis::EditTool::mouseButtonRelease(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ScatterPlotWindow::paint(), Isis::Chip::Read(), Isis::EditTool::redoEdit(), Isis::FileTool::saveAs_FullResolution(), Isis::ScatterPlotData::ScatterPlotData(), Isis::ScatterPlotWindow::setMousePosition(), Isis::Process::SetOutputCube(), Isis::StretchTool::statsFromCube(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::EditTool::undoEdit(), and Isis::EditTool::writeToCube().
Projection * Isis::Cube::projection | ( | ) |
Definition at line 1794 of file Cube.cpp.
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.
[in] | group | Label containing the group to put. |
Definition at line 2056 of file Cube.cpp.
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 | ( | Blob & | blob, |
const std::vector< PvlKeyword > | keywords = std::vector<PvlKeyword>() |
||
) | const |
This method will read data from the specified Blob object.
[in] | blob | The Blob data to be loaded |
Definition at line 807 of file Cube.cpp.
References Isis::Blob::Read(), and Isis::FileName::toString().
Referenced by Isis::CubeViewport::bluePixel(), Isis::Process::CalculateStatistics(), Isis::FileTool::copyCubeDetails(), Isis::CSMCamera::CSMCamera(), Isis::InterestOperator::FindOverlapByImageFootPrint(), Isis::MosaicSceneItem::getPixelValue(), Isis::SpatialPlotTool::getSpatialStatistics(), Isis::SpectralPlotTool::getSpectralStatistics(), Isis::StatisticsTool::getStatistics(), Isis::MosaicSceneItem::getStretch(), Isis::CubeViewport::grayPixel(), Isis::CubeViewport::greenPixel(), Isis::StretchTool::histFromCube(), Isis::ImageHistogram::ImageHistogram(), Isis::InterestOperator::InterestByMeasure(), Isis::DemShape::localRadius(), Isis::EditTool::mouseButtonRelease(), Isis::ProcessByBrick::ProcessCubeInPlaceFunctor< T >::operator()(), Isis::ProcessByBrick::ProcessCubeFunctor< T >::operator()(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ScatterPlotWindow::paint(), Isis::Process::PropagateTables(), Isis::Chip::Read(), Isis::EditTool::redoEdit(), Isis::CubeViewport::redPixel(), Isis::HistogramTool::refreshPlot(), Isis::FileTool::saveAs_FullResolution(), Isis::FileTool::saveAsFullImage(), Isis::ScatterPlotData::ScatterPlotData(), Isis::ImagePolygon::SetImage(), Isis::ScatterPlotWindow::setMousePosition(), Isis::ProcessByBrick::StartProcess(), Isis::StretchTool::statsFromCube(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), Isis::EditTool::undoEdit(), and Isis::EditTool::writeToCube().
void Isis::Cube::read | ( | Buffer & | bufferToFill | ) | const |
CubeStretch Isis::Cube::readCubeStretch | ( | QString | name = "CubeStretch" , |
const std::vector< PvlKeyword > | keywords = std::vector<PvlKeyword>() |
||
) | const |
Read a Stretch from a cube.
name | The name of the Stretch Blob |
keywords | A set of keywords and values to match in the Stretch Blob label. This can be used to read the stretch for a specific band. |
Definition at line 912 of file Cube.cpp.
Referenced by Isis::StretchTool::loadStretchFromCube().
ImagePolygon Isis::Cube::readFootprint | ( | ) | const |
Read the footprint polygon for the Cube.
Definition at line 866 of file Cube.cpp.
Referenced by Isis::ImageOverlapSet::FindImageOverlaps(), Isis::GisGeometry::fromCube(), Isis::UniversalGroundMap::GroundRange(), and Isis::Image::initQuickFootprint().
History Isis::Cube::readHistory | ( | const QString & | name = "IsisCube" | ) | const |
OriginalLabel Isis::Cube::readOriginalLabel | ( | const QString & | name = "IsisCube" | ) | const |
Read the original PDS3 label from a cube.
name | The name of the OriginalLabel Blob |
Definition at line 889 of file Cube.cpp.
Referenced by Isis::FileTool::copyCubeDetails().
OriginalXmlLabel Isis::Cube::readOriginalXmlLabel | ( | ) | const |
Read the original PDS4 label from a cube.
Table Isis::Cube::readTable | ( | const QString & | name | ) |
Read a Table from the cube.
name | The name of the Table to read |
Definition at line 952 of file Cube.cpp.
Referenced by Isis::Blobber::load(), and Isis::AdvancedTrackTool::TrackMosaicOrigin().
|
private |
Function to read data from a cube label and return it as a PVL object.
Definition at line 2454 of file Cube.cpp.
References Isis::FileName::expanded(), Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), and Isis::FileName::toString().
|
private |
This gets the file name of the file which actually contains the DN data.
With ecub's, our data file name could be another ecub or a detached label, so using m_dataFileName is unreasonable.
Definition at line 2200 of file Cube.cpp.
References Isis::FileName::expanded(), Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), Isis::FileName::name(), Isis::FileName::original(), Isis::FileName::path(), and Isis::FileName::toString().
|
private |
This is a helper, used by open(...), that handles opening Isis 2 cubes as if they were Isis cubes.
oldCube | The filename of the Isis 2 cube |
Definition at line 2484 of file Cube.cpp.
References Isis::FileName::expanded(), and Isis::FileName::name().
void Isis::Cube::relocateDnData | ( | FileName | dnDataFile | ) |
Relocates the DN data for a cube to an external cube label file.
dnDataFile | FileName to relocate the dn data to |
Definition at line 1366 of file Cube.cpp.
References Isis::FileName::original().
Referenced by Isis::JigsawRunWidget::CopyImageToResultsFunctor::operator()(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), and Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()().
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.
[in] | access | (QString) Type of access needed (read or read/write |
Definition at line 774 of file Cube.cpp.
References Isis::FileName::expanded().
Referenced by Isis::StretchTool::deleteFromCube(), Isis::EditTool::mouseButtonRelease(), Isis::ImportImagesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::ImportShapesWorkOrder::OriginalFileToProjectCubeFunctor::operator()(), Isis::EditTool::rubberBandComplete(), Isis::FileTool::save(), and Isis::StretchTool::saveStretchToCube().
int Isis::Cube::sampleCount | ( | ) | const |
Definition at line 1807 of file Cube.cpp.
Referenced by Isis::AlphaCube::AlphaCube(), Isis::Equalization::applyCorrection(), Isis::Camera::Camera(), Isis::Process::CheckRequirements(), Isis::Image::createFootprint(), Isis::Shape::createFootprint(), Isis::StereoTool::createPoint(), Isis::CubeViewport::cubeContentsChanged(), Isis::CubeViewport::cubeDataChanged(), Isis::CubeViewport::cubeSamples(), Isis::CubeViewport::CubeViewport(), Isis::Enlarge::Enlarge(), Isis::ControlNetStatistics::GenerateImageStats(), Isis::CubeViewport::getAllWhatsThisInfo(), Isis::UniversalGroundMap::GroundRange(), Isis::StretchTool::histFromCube(), Isis::ImagePolygon::initCube(), Isis::ImageExporter::initializeProcess(), Isis::ProcessExportPds::LineBytes(), Isis::ControlNetValidMeasure::MetersFromEdge(), Isis::EditTool::mouseButtonRelease(), Isis::OverlapStatistics::OverlapStatistics(), Isis::ControlNetValidMeasure::PixelsFromEdge(), Isis::CubeCalculator::prepareCalculations(), Isis::Chip::Read(), Isis::Reduce::Reduce(), Isis::ScatterPlotConfigDialog::refreshWidgetStates(), Isis::ProcessMapMosaic::RingsSetOutputCube(), Isis::FileTool::saveAs_FullResolution(), Isis::FileTool::saveAsCubeByOption(), Isis::FileTool::saveAsFullImage(), Isis::ScatterPlotData::ScatterPlotData(), Isis::ProcessMapMosaic::SetOutputCube(), Isis::SpectralDefinition2D::SpectralDefinition2D(), Isis::ProcessMapMosaic::StartProcess(), Isis::StretchTool::statsFromCube(), Isis::TileManager::TileManager(), Isis::AdvancedTrackTool::TrackMosaicOrigin(), and Isis::SubArea::UpdateLabel().
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
base | Additive constant. |
mult | Multiplicative constant. |
Definition at line 1151 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
byteOrder | An enumeration of either Msb or Lsb. |
Definition at line 1202 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
ns | Number of samples |
nl | Number of lines |
nb | Number of bands |
Definition at line 1217 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), Isis::ImageImporter::createOutput(), Isis::Process::SetOutputCube(), and Isis::Chip::Write().
void Isis::Cube::setExternalDnData | ( | FileName | cubeFileWithDnData | ) |
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.
format | An enumeration of either Bsq or Tile. |
Definition at line 1266 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
attach | If false, the labels and data will be in separate files. |
Definition at line 1278 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
[in] | labelBytes | Number of bytes to reserve for label space. |
Definition at line 1291 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
min | Minimum 32-bit pixel. |
max | Maximum 32-bit pixel. |
Definition at line 1168 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), 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.
pixelType | An enumeration of the pixelType desired in the output cube. See PixelType documentation for more information. |
Definition at line 1304 of file Cube.cpp.
Referenced by copy(), Isis::FileTool::copyCubeDetails(), Isis::Process::SetOutputCube(), and Isis::ProcessMosaic::StartProcess().
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.
[in] | vbands | A vector of strings containing the virtual bands. The vector must contain integers in string form (e.g., "5", "10", "1"). |
Definition at line 1321 of file Cube.cpp.
References Isis::toInt().
Referenced by Isis::Workspace::addCubeViewport(), Isis::Workspace::addCubeViewportFromList(), and Isis::Process::SetInputCube().
void Isis::Cube::setVirtualBands | ( | const std::vector< QString > & | vbands | ) |
This is a deprecated version of setVirtualBands(const QList<QString> &).
[in] | vbands | A 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, |
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.
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 |
Definition at line 1851 of file Cube.cpp.
References Isis::Statistics::AddData(), Isis::Progress::CheckStatus(), Isis::Buffer::DoubleBuffer(), Isis::LineManager::SetLine(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), and Isis::Buffer::size().
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.
[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 |
Definition at line 1830 of file Cube.cpp.
References Isis::ValidMaximum, and Isis::ValidMinimum.
bool Isis::Cube::storesDnData | ( | ) | const |
This method returns a boolean value.
Definition at line 1904 of file Cube.cpp.
Referenced by Isis::Image::copyToNewProjectRoot(), and Isis::Shape::copyToNewProjectRoot().
void Isis::Cube::write | ( | Blob & | blob, |
bool | overwrite = true |
||
) |
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.
blob | data to be written |
Definition at line 971 of file Cube.cpp.
References Isis::FileName::addExtension(), Isis::FileName::expanded(), Isis::Blob::Name(), Isis::FileName::name(), Isis::FileName::removeExtension(), Isis::Blob::Type(), and Isis::Blob::Write().
Referenced by copy(), Isis::FileTool::copyCubeDetails(), Isis::JigsawRunWidget::on_JigsawAcceptButton_clicked(), Isis::ProcessByBrick::ProcessCubeInPlaceFunctor< T >::operator()(), Isis::ProcessByBrick::ProcessCubeFunctor< T >::operator()(), Isis::EditTool::redoEdit(), Isis::FileTool::saveAs_FullResolution(), Isis::FileTool::saveAsFullImage(), Isis::StretchTool::saveStretchToCube(), Isis::Process::SetOutputCube(), Isis::ProcessByBrick::StartProcess(), Isis::EditTool::undoAll(), Isis::EditTool::undoEdit(), Isis::Chip::Write(), Isis::Process::WriteHistory(), and Isis::EditTool::writeToCube().
void Isis::Cube::write | ( | Buffer & | bufferToWrite | ) |
void Isis::Cube::write | ( | const CubeStretch & | cubeStretch | ) |
The stretch will be written to the Cube as a BLOB and can be accessed using Cube::readCubeStretch.
cubeStretch | The stretch to write to the Cube. |
Definition at line 1078 of file Cube.cpp.
References Isis::CubeStretch::toBlob().
void Isis::Cube::write | ( | const ImagePolygon & | polygon | ) |
Write a polygon to the Cube.
The polygon will be written to the Cube as a BLOB and can be accessed using Cube::readFootprint.
Definition at line 1106 of file Cube.cpp.
References Isis::ImagePolygon::toBlob().
void Isis::Cube::write | ( | const OriginalXmlLabel & | lab | ) |
This method will write an OriginalXmlLabel object.
to the cube as specified by the contents of the Blob object.
Original | xml label data to be written |
Definition at line 1050 of file Cube.cpp.
References Isis::OriginalXmlLabel::toBlob().
void Isis::Cube::write | ( | const Table & | table | ) |
The Table will be written to the Cube as a BLOB and can be accessed using Cube::readTable.
table | The table to write to the Cube |
Definition at line 1064 of file Cube.cpp.
References Isis::Table::toBlob().
void Isis::Cube::write | ( | History & | history, |
const QString & | name = "IsisCube" |
||
) |
Write an updated History to the Cube.
The History will be written to the Cube as a BLOB and can be accessed using Cube::readHistory.
history | The history to write to the Cube. |
name | The name for the history BLOB. This is used for backwards compatibility with cubes from before the History BLOB name was standardized. |
Definition at line 1094 of file Cube.cpp.
References Isis::History::toBlob().
void Isis::Cube::write | ( | OriginalLabel & | lab | ) |
This method will write an OriginalLabel object.
to the cube as specified by the contents of the Blob object.
Original | label data to be written |
Definition at line 1038 of file Cube.cpp.
References Isis::OriginalLabel::toBlob().
|
private |
Write the Pvl labels to the cube's label file.
Excess data in the attached labels is set to 0.
Definition at line 2601 of file Cube.cpp.
References Isis::FileName::name().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
This is the file that contains the labels always; if labels are attached then this contains the file data also.
The method dataFile() will always give you the appropriate QFile member for reading cube data; this should always be used for the labels.
If isOpen() is true, then this is allocated.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Projection allocated from the projection() method.
|
private |
|
private |
|
private |
|
private |
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the USGS Astrogeology Discussion Board To report a bug, or suggest a feature go to: ISIS Github File Modified: 07/13/2023 15:18:40 |