|
Isis Developer Reference
|
Go to the documentation of this file.
17 #include <nlohmann/json.hpp>
31 class CubeAttributeOutput;
32 class CubeCachingAlgorithm;
44 class OriginalXmlLabel;
248 void close(
bool remove =
false);
250 void create(
const QString &cfile);
252 void open(
const QString &cfile, QString access =
"r");
253 void reopen(QString access =
"r");
256 const std::vector<PvlKeyword> keywords = std::vector<PvlKeyword>())
const;
260 const std::vector<PvlKeyword> keywords = std::vector<PvlKeyword>())
const;
265 void write(
Blob &blob,
bool overwrite=
true);
270 void write(
History &history,
const QString &name =
"IsisCube");
297 QString msg =
"Gathering histogram");
299 const double &validMax,
300 QString msg =
"Gathering histogram");
302 int labelSize(
bool actual =
false)
const;
310 QString msg =
"Gathering statistics");
312 const double &validMax,
313 QString msg =
"Gathering statistics");
318 bool deleteBlob(QString BlobName, QString BlobType);
323 bool hasBlob(
const QString &name,
const QString &type);
325 void latLonRange(
double &minLatitude,
double &maxLatitude,
double &minLongitude,
326 double &maxLongitude);
330 void applyVirtualBandsToLabel();
331 void cleanUp(
bool remove);
334 QFile *dataFile()
const;
338 void initCoreFromLabel(
const Pvl &
label);
339 void initLabelFromFile(
FileName labelFileName,
bool readWrite);
341 Pvl realDataFileLabel()
const;
342 void reformatOldIsisLabel(
const QString &oldCube);
const double ValidMaximum
The maximum valid double value for Isis pixels.
Definition: SpecialPixel.h:122
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
Definition: PixelType.h:46
QString originalPath() const
Returns the path of the original file name.
Definition: FileName.cpp:84
Isis::Blob toBlob()
Serialize the OriginalLabel data to a Blob.
Definition: OriginalLabel.cpp:82
Format
These are the possible storage formats of ISIS cubes.
Definition: Cube.h:178
PvlGroupIterator endGroup()
Returns the ending group index.
Definition: PvlObject.h:109
double base() const
Returns the base value for converting 8-bit/16-bit pixels to 32-bit.
Definition: Cube.cpp:1427
void instrumentPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
Definition: Spice.cpp:822
Application * iApp
Definition: Application.cpp:51
virtual void sunPosition(double p[3]) const
Fills the input vector with sun position information, in either body-fixed or J2000 reference frame a...
Definition: Spice.cpp:902
Blob toBlob() const
Serialize the OriginalXmlLabel to a Blob.
Definition: OriginalXmlLabel.cpp:78
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
PvlGroup & group(const int index)
Return the group at the specified index.
Definition: PvlObject.cpp:452
@ DetachedLabel
The input label is in a separate data file from the image.
Definition: CubeAttribute.h:33
History readHistory(const QString &name="IsisCube") const
Read the History from the Cube.
Definition: Cube.cpp:847
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Buffer manager, for moving through a cube in lines.
Definition: LineManager.h:39
void latLonRange(double &minLatitude, double &maxLatitude, double &minLongitude, double &maxLongitude)
Returns the latitude and longitude range for the Cube.
Definition: Cube.cpp:2514
void clear()
Clears PvlKeywords.
Definition: PvlContainer.h:91
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
Definition: Cube.cpp:1321
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
virtual ~Cube()
Destroys the Cube object.
Definition: Cube.cpp:160
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
A single keyword-value pair.
Definition: PvlKeyword.h:82
bool next()
Moves the shape buffer to the next position.
Definition: BufferManager.h:106
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition: Cube.cpp:1991
virtual double UniversalLatitude()
This returns a universal latitude (planetocentric).
Definition: TProjection.cpp:908
QString Type() const
Accessor method that returns a string containing the Blob type.
Definition: Blob.cpp:124
PvlObject & Label()
The Table's label.
Definition: Table.cpp:260
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition: Camera.cpp:154
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
double BinRangeStart() const
Definition: Histogram.h:109
File name manipulation and expansion.
Definition: FileName.h:100
Table readTable(const QString &name)
Read a Table from the cube.
Definition: Cube.cpp:952
void deleteGroup(const QString &group)
Deletes a group from the cube labels.
Definition: Cube.cpp:1977
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
double * DoubleBuffer() const
Returns the value of the shape buffer.
Definition: Buffer.h:138
ImagePolygon readFootprint() const
Read the footprint polygon for the Cube.
Definition: Cube.cpp:866
Blob toBlob() const
Serialize the ImagePolygon to a Blob.
Definition: ImagePolygon.cpp:1347
int groups() const
Returns the number of groups contained.
Definition: PvlObject.h:75
void putGroup(const PvlGroup &group)
Adds a group in a Label to the cube.
Definition: Cube.cpp:2056
virtual int physicalBand(const int &virtualBand) const
This method will return the physical band number given a virtual band number.
Definition: Cube.cpp:1773
QString FileOpen(const QString &filename)
This error should be used when a file could not be opened.
Definition: FileOpen.cpp:11
const unsigned char VALID_MIN1
Definition: SpecialPixel.h:181
void setLabelSize(int labelBytes)
Used prior to the Create method, this will allocate a specific number of bytes in the label area for ...
Definition: Cube.cpp:1291
Cube * copy(FileName newFile, const CubeAttributeOutput &newFileAttributes)
Copies the cube to the new fileName.
Definition: Cube.cpp:276
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
int labelSize(bool actual=false) const
Returns the number of bytes used by the label.
Definition: Cube.cpp:1713
@ UnsignedWord
Definition: PixelType.h:31
ByteOrder byteOrder() const
Returns the byte order/endian-ness of the cube file.
Definition: Cube.cpp:1439
void close(bool remove=false)
Closes the cube and updates the labels.
Definition: Cube.cpp:260
Container for cube-like labels.
Definition: Pvl.h:119
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Create cube polygons, read/write polygons to blobs.
Definition: ImagePolygon.h:153
Stores stretch information for a cube.
Definition: CubeStretch.h:27
@ SignedWord
Definition: PixelType.h:32
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Definition: Statistics.cpp:255
Table Cache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition: SpiceRotation.cpp:868
QString Name() const
Accessor method that returns a string containing the Blob name.
Definition: Blob.cpp:133
virtual Longitude solarLongitude()
Returns the solar longitude.
Definition: Spice.cpp:1509
bool begin()
Moves the shape buffer to the first position.
Definition: BufferManager.h:96
Manages a Buffer over a cube.
Definition: BufferManager.h:52
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 vario...
Definition: Cube.cpp:1830
ByteOrder
Tests the current architecture for byte order.
Definition: Endian.h:42
bool hasBlob(const QString &name, const QString &type)
Check to see if the cube contains a BLOB.
Definition: Cube.cpp:2019
Buffer for reading and writing cube data.
Definition: Buffer.h:53
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1622
void Write(const QString &file)
Write the blob data out to a file.
Definition: Blob.cpp:417
bool end() const
Returns true if the shape buffer has accessed the end of the cube.
Definition: BufferManager.h:115
Isis::ByteOrder ByteOrderEnumeration(const QString &order)
Definition: Endian.h:55
FileName externalCubeFileName() const
If this is an external cube label file, this will give you the cube dn file that this label reference...
Definition: Cube.cpp:1535
QString baseName() const
Returns the name of the file without the path and without extensions.
Definition: FileName.cpp:145
@ AttachedLabel
The input label is embedded in the image file.
Definition: CubeAttribute.h:32
const short VALID_MAX2
Definition: SpecialPixel.h:159
void Read(const QString &file, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >())
This method reads Pvl values from a specified file.
Definition: Blob.cpp:255
const int ReadWrite
Definition: Process.h:24
double multiplier() const
Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.
Definition: Cube.cpp:1748
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
const short VALID_MIN2
Definition: SpecialPixel.h:153
void Copy(const Buffer &in, bool includeRawBuf=true)
Allows copying of the buffer contents to another Buffer.
Definition: Buffer.cpp:255
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
virtual double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Definition: Sensor.cpp:233
int lineCount() const
Definition: Cube.cpp:1734
FileName addExtension(const QString &extension) const
Adds a new extension to the file name.
Definition: FileName.cpp:225
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
bool isReadWrite() const
Test if the opened cube is read-write, that is read and write operations should succeed if this is tr...
Definition: Cube.cpp:235
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
Definition: Cube.cpp:1217
void create(const QString &cfile)
This method will create an isis cube for writing.
Definition: Cube.cpp:414
bool IsBigEndian()
Definition: Endian.h:105
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
virtual void AddData(const double *data, const unsigned int count)
Add an array of doubles to the histogram counters.
Definition: Histogram.cpp:232
bool hasGroup(const QString &group) const
Return if the cube has a specified group in the labels.
Definition: Cube.cpp:2004
Base class for Map TProjections.
Definition: TProjection.h:166
@ Tile
Cubes are stored in tile format, that is the order of the pixels in the file (on disk) is BSQ within ...
Definition: Cube.h:232
void SetValidRange(const double minimum=Isis::ValidMinimum, const double maximum=Isis::ValidMaximum)
Changes the range of the bins.
Definition: Histogram.cpp:192
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
void addCachingAlgorithm(CubeCachingAlgorithm *)
This will add the given caching algorithm to the list of attempted caching algorithms.
Definition: Cube.cpp:1922
Blob toBlob() const
Serialze the Table to a Blob that can be written to a file.
Definition: Table.cpp:414
Read and store original Xml labels.
Definition: OriginalXmlLabel.h:32
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
This is the parent of the caching algorithms.
Definition: CubeCachingAlgorithm.h:31
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
Definition: CubeAttribute.cpp:360
Format format() const
Definition: Cube.cpp:1575
nlohmann::json json
Definition: PvlObject.cpp:22
Class for storing Table blobs information.
Definition: Table.h:61
Handles converting buffers to and from disk.
Definition: CubeIoHandler.h:109
long long int BigInt
Big int.
Definition: Constants.h:49
bool labelsAttached() const
Test if labels are attached.
Definition: Cube.cpp:248
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
Definition: CubeAttribute.cpp:177
int sampleCount() const
Definition: Cube.cpp:1807
void fromIsd(const FileName &fileName, Pvl &label, nlohmann::json &isd, QString access)
Initialize Cube data from a PVL label and JSON ISD.
Definition: Cube.cpp:99
Container of a cube histogram.
Definition: ImageHistogram.h:40
@ Msb
Definition: Endian.h:45
virtual SpiceRotation * bodyRotation() const
Accessor method for the body rotation.
Definition: Spice.cpp:1611
bool isOpen() const
Test if a cube file has been opened/created.
Definition: Cube.cpp:183
IO Handler for Isis Cubes.
Definition: Cube.h:167
void setExternalDnData(FileName cubeFileWithDnData)
Used to set external dn data to cube.
Definition: Cube.cpp:1234
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis exception class.
Definition: IException.h:91
void attachSpiceFromIsd(nlohmann::json Isd)
Definition: Cube.cpp:1459
#define ASSERT(x)
Definition: IsisDebug.h:134
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition: Cube.cpp:1410
virtual bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
Definition: Projection.cpp:497
bool isProjected() const
Returns true if the labels of the cube appear to have a valid mapping group.
Definition: Cube.cpp:202
IO Handler for Isis Cubes using the tile format.
Definition: CubeTileHandler.h:35
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
Definition: FileName.cpp:515
Program progress reporter.
Definition: Progress.h:42
Obtain SPICE information for a spacecraft.
Definition: Spice.h:283
const unsigned short VALID_MAXU2
Definition: SpecialPixel.h:168
@ Bsq
Cubes are stored in band-sequential format, that is the order of the pixels in the file (on disk) is:
Definition: Cube.h:199
OriginalXmlLabel readOriginalXmlLabel() const
Read the original PDS4 label from a cube.
Definition: Cube.cpp:931
LabelAttachment labelAttachment() const
Definition: CubeAttribute.cpp:400
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
void setByteOrder(ByteOrder byteOrder)
Used prior to the Create method, this will specify the byte order of pixels, either least or most sig...
Definition: Cube.cpp:1202
FileName removeExtension() const
Removes all extensions in the file name.
Definition: FileName.cpp:246
Camera * camera()
Return a camera associated with the cube.
Definition: Cube.cpp:1451
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:27
bool SetLine(const int line, const int band=1)
Positions the buffer at the requested line and returns a status indicator if the set was succesful or...
Definition: LineManager.cpp:44
Isis::Blob toBlob() const
Serialize the CubeStretch to a Blob.
Definition: CubeStretch.cpp:84
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.
Definition: Cube.cpp:1955
const double ValidMinimum
The minimum valid double value for Isis pixels.
Definition: SpecialPixel.h:87
Namespace for the standard library.
Read and store original labels.
Definition: OriginalLabel.h:35
bool hasTable(const QString &name)
Check to see if the cube contains a pvl table by the provided name.
Definition: Cube.cpp:2043
bool isReadOnly() const
Test if the opened cube is read-only, that is write operations will fail if this is true.
Definition: Cube.cpp:213
PixelType pixelType() const
Definition: Cube.cpp:1758
Container of a cube histogram.
Definition: Histogram.h:74
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
Definition: CubeAttribute.cpp:455
void deleteObject(const QString &name)
Remove an object from the current PvlObject.
Definition: PvlObject.cpp:366
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
QString PixelTypeName(Isis::PixelType pixelType)
Returns string name of PixelType enumeration entered as input parameter.
Definition: PixelType.h:66
Blob toBlob(const QString &name="IsisCube")
Converts a history object into a new blob object.
Definition: History.cpp:75
bool storesDnData() const
This method returns a boolean value.
Definition: Cube.cpp:1904
PvlGroupIterator beginGroup()
Returns the beginning group index.
Definition: PvlObject.h:91
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition: Cube.cpp:971
virtual double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
Definition: TProjection.cpp:922
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
Cube()
Constructs a Cube object.
Definition: Cube.cpp:50
const unsigned short VALID_MINU2
Definition: SpecialPixel.h:162
Isis::PixelType PixelTypeEnumeration(const QString &type)
Returns PixelType enumeration given a string.
Definition: PixelType.h:89
double maximum() const
Return the output cube attribute maximum.
Definition: CubeAttribute.cpp:309
double degrees() const
Get the angle in units of Degrees.
Definition: Angle.h:232
QString unit(const int index=0) const
Returns the units of measurement of the element of the array of values for the object at the specifie...
Definition: PvlKeyword.cpp:357
const unsigned char VALID_MAX1
Definition: SpecialPixel.h:187
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
double minimum() const
Return the output cube attribute minimum.
Definition: CubeAttribute.cpp:294
double BinRangeEnd() const
Definition: Histogram.h:112
void setFormat(Format format)
Used prior to the Create method, this will specify the format of the cube, either band,...
Definition: Cube.cpp:1266
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:86
void setPixelType(PixelType pixelType)
Used prior to the Create method, this will specify the output pixel type.
Definition: Cube.cpp:1304
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Definition: PvlObject.cpp:177
QString ByteOrderName(Isis::ByteOrder byteOrder)
Definition: Endian.h:48
IO Handler for Isis Cubes using the BSQ format.
Definition: CubeBsqHandler.h:41
void setBaseMultiplier(double base, double mult)
Used prior to the Create method, this will specify the base and multiplier for converting 8-bit/16-bi...
Definition: Cube.cpp:1151
OriginalLabel readOriginalLabel(const QString &name="IsisCube") const
Read the original PDS3 label from a cube.
Definition: Cube.cpp:889
QString original() const
Returns the full file name including the file path.
Definition: FileName.cpp:212
void deleteGroup(const QString &name)
Remove a group from the current PvlObject.
Definition: PvlObject.cpp:408
@ Lsb
Definition: Endian.h:44
Base class for Map Projections.
Definition: Projection.h:155
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
FileName setExtension(const QString &extension) const
Sets all current file extensions to a new extension in the file name.
Definition: FileName.cpp:265
void clearIoCache()
This will clear excess RAM used for quicker IO in the cube.
Definition: Cube.cpp:1938
Cube::Format fileFormat() const
Return the file format an Cube::Format.
Definition: CubeAttribute.cpp:267
@ UnsignedByte
Definition: PixelType.h:29
void setMinMax(double min, double max)
Used prior to the Create method, this will compute a good base and multiplier value given the minimum...
Definition: Cube.cpp:1168
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
Definition: CubeAttribute.cpp:165
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 variou...
Definition: Cube.cpp:1599
@ ExternalLabel
The label is pointing to an external DN file - the label is also external to the data.
Definition: CubeAttribute.h:40
Projection * projection()
Definition: Cube.cpp:1794
void relocateDnData(FileName dnDataFile)
Relocates the DN data for a cube to an external cube label file.
Definition: Cube.cpp:1366
CubeStretch readCubeStretch(QString name="CubeStretch", const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
Read a Stretch from a cube.
Definition: Cube.cpp:912
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *'s to be stored in a QVariant.
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
PvlObject getStoredNaifKeywords() const
This returns the PvlObject that stores all of the requested Naif data and can be a replacement for fu...
Definition: Spice.cpp:998
void reopen(QString access="r")
This method will reopen an isis sube for reading or reading/writing.
Definition: Cube.cpp:774
void fromLabel(const FileName &fileName, Pvl &label, QString access)
Initialize Cube data from a PVL label.
Definition: Cube.cpp:76
void setLabelsAttached(bool attached)
Use prior to calling create, this sets whether or not to use separate label and data files.
Definition: Cube.cpp:1278
virtual double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Definition: Sensor.cpp:210
@ Real
Definition: PixelType.h:35
@ None
Definition: PixelType.h:28