17#include <nlohmann/json.hpp>
272 void close(
bool remove =
false);
274 void create(
const QString &cfile);
276 void createGdal(QString &dataFileName, QString &,
char **papszOptions);
278 void open(
const QString &cfile, QString access =
"r");
279 void openCube(
const QString &cubeFileName, QString access);
280 void openGdal(
const QString &cubeFileName, QString access);
281 void reopen(QString access =
"r");
284 const std::vector<PvlKeyword> keywords = std::vector<PvlKeyword>())
const;
288 const std::vector<PvlKeyword> keywords = std::vector<PvlKeyword>())
const;
293 void write(
Blob &blob,
bool overwrite=
true);
298 void write(
History &history,
const QString &name =
"IsisCube");
326 QString msg =
"Gathering histogram");
328 const double &validMax,
329 QString msg =
"Gathering histogram");
331 int labelSize(
bool actual =
false)
const;
339 QString msg =
"Gathering statistics");
341 const double &validMax,
342 QString msg =
"Gathering statistics");
346 bool deleteBlob(QString BlobName, QString BlobType);
351 bool hasBlob(
const QString &name,
const QString &type);
353 void latLonRange(
double &minLatitude,
double &maxLatitude,
double &minLongitude,
354 double &maxLongitude);
358 void applyVirtualBandsToLabel();
359 void cleanUp(
bool remove);
362 QFile *dataFile()
const;
363 GDALDataset *gdalDataset()
const;
366 void initCoreFromLabel(
const Pvl &
label);
367 void initCoreFromGdal(
const QString &labelFile);
368 void initLabelState(
const Pvl &
label);
369 void initLabelFromFile(
FileName labelFileName,
bool readWrite);
371 Pvl realDataFileLabel()
const;
372 void reformatOldIsisLabel(
const QString &oldCube);
396 GDALDataset *m_geodataSet =
nullptr;
451 LabelAttachment m_attached;
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *'s to be stored in a QVariant.
Buffer for reading and writing cube data.
Definition Buffer.h:53
Manipulate and parse attributes of output cube filenames.
Definition CubeAttribute.h:452
This is the parent of the caching algorithms.
Definition CubeCachingAlgorithm.h:31
IO Handler for Isis Cubes.
Definition Cube.h:168
void checkAccess(QString access)
Definition Cube.cpp:762
void addCachingAlgorithm(CubeCachingAlgorithm *)
This will add the given caching algorithm to the list of attempted caching algorithms.
Definition Cube.cpp:2305
void clearIoCache()
This will clear excess RAM used for quicker IO in the cube.
Definition Cube.cpp:2321
bool hasTable(const QString &name)
Check to see if the cube contains a pvl table by the provided name.
Definition Cube.cpp:2426
ImagePolygon readFootprint() const
Read the footprint polygon for the Cube.
Definition Cube.cpp:1233
Cube()
Constructs a Cube object.
Definition Cube.cpp:50
void setPixelType(PixelType pixelType)
Used prior to the Create method, this will specify the output pixel type.
Definition Cube.cpp:1678
void latLonRange(double &minLatitude, double &maxLatitude, double &minLongitude, double &maxLongitude)
Returns the latitude and longitude range for the Cube.
Definition Cube.cpp:2942
void deleteGroup(const QString &group)
Deletes a group from the cube labels.
Definition Cube.cpp:2360
void attachLineScanTableFromIsd(nlohmann::json isd)
Definition Cube.cpp:1902
void setFormat(Format format)
Used prior to the Create method, this will specify the format of the cube, either band,...
Definition Cube.cpp:1640
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:2338
Format format() const
Definition Cube.cpp:1968
void relocateDnData(FileName dnDataFile)
Relocates the DN data for a cube to an external cube label file.
Definition Cube.cpp:1740
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:1992
int lineCount() const
Definition Cube.cpp:2127
double multiplier() const
Returns the multiplier value for converting 8-bit/16-bit pixels to 32-bit.
Definition Cube.cpp:2141
FileName realDataFileName() const
This gets the file name of the file which actually contains the DN data.
Definition Cube.cpp:2596
CubeStretch readCubeStretch(QString name="CubeStretch", const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
Read a Stretch from a cube.
Definition Cube.cpp:1279
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:2223
void setDimensions(int ns, int nl, int nb)
Used prior to the Create method to specify the size of the cube.
Definition Cube.cpp:1588
Camera * camera()
Return a camera associated with the cube.
Definition Cube.cpp:1825
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:1929
LabelAttachment
Input cube label type tracker.
Definition Cube.h:245
@ ExternalLabel
The label is pointing to an external DN file - the label is also external to the data.
Definition Cube.h:254
@ GdalLabel
Definition Cube.h:255
@ AttachedLabel
The input label is embedded in the image file.
Definition Cube.h:246
@ DetachedLabel
The input label is in a separate data file from the image.
Definition Cube.h:247
PvlGroup & group(const QString &group) const
Read a group from the cube into a Label.
Definition Cube.cpp:2374
int sampleCount() const
Definition Cube.cpp:2200
void putGroup(const PvlGroup &group)
Adds a group in a Label to the cube.
Definition Cube.cpp:2439
bool isOpen() const
Test if a cube file has been opened/created.
Definition Cube.cpp:197
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:1522
bool isReadOnly() const
Test if the opened cube is read-only, that is write operations will fail if this is true.
Definition Cube.cpp:223
double base() const
Returns the base value for converting 8-bit/16-bit pixels to 32-bit.
Definition Cube.cpp:1801
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:105
void openGdal(const QString &cubeFileName, QString access)
This method will open an existing geotiff for reading or reading/writing.
Definition Cube.cpp:963
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:1539
void attachSpiceFromIsd(nlohmann::json Isd)
Definition Cube.cpp:1833
Cube * copy(FileName newFile, const CubeAttributeOutput &newFileAttributes)
Copies the cube to the new fileName.
Definition Cube.cpp:296
void create(const QString &cfile)
This method will create an isis cube for writing.
Definition Cube.cpp:434
bool hasBlob(const QString &name, const QString &type)
Check to see if the cube contains a BLOB.
Definition Cube.cpp:2402
void openCube(const QString &cubeFileName, QString access)
This method will open an existing isis cube for reading or reading/writing.
Definition Cube.cpp:841
ByteOrder byteOrder() const
Returns the byte order/endian-ness of the cube file.
Definition Cube.cpp:1813
void open(const QString &cfile, QString access="r")
This method will try to open a file as either a cube or geotiff in either read or read/write.
Definition Cube.cpp:782
PixelType pixelType() const
Definition Cube.cpp:2151
void setVirtualBands(const QList< QString > &vbands)
This allows the programmer to specify a subset of bands to work with.
Definition Cube.cpp:1695
LabelAttachment labelsAttached() const
Test if labels are attached.
Definition Cube.cpp:268
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:1169
bool isProjected() const
Returns true if the labels of the cube appear to have a valid mapping group.
Definition Cube.cpp:212
OriginalLabel readOriginalLabel(const QString &name="IsisCube") const
Read the original PDS3 label from a cube.
Definition Cube.cpp:1256
Format
These are the possible storage formats of ISIS cubes.
Definition Cube.h:179
@ GTiff
Definition Cube.h:234
@ 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:233
@ Bsq
Cubes are stored in band-sequential format, that is the order of the pixels in the file (on disk) is:
Definition Cube.h:200
virtual int physicalBand(const int &virtualBand) const
This method will return the physical band number given a virtual band number.
Definition Cube.cpp:2166
Table readTable(const QString &name)
Read a Table from the cube.
Definition Cube.cpp:1319
bool hasGroup(const QString &group) const
Return if the cube has a specified group in the labels.
Definition Cube.cpp:2387
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:1665
OriginalXmlLabel readOriginalXmlLabel() const
Read the original PDS4 label from a cube.
Definition Cube.cpp:1298
virtual QString fileName() const
Returns the opened cube's filename.
Definition Cube.cpp:1956
void fromLabel(const FileName &fileName, Pvl &label, QString access)
Initialize Cube data from a PVL label.
Definition Cube.cpp:80
virtual ~Cube()
Destroys the Cube object.
Definition Cube.cpp:174
void write(Blob &blob, bool overwrite=true)
This method will write a blob of data (e.g.
Definition Cube.cpp:1338
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:255
void setExternalDnData(FileName cubeFileWithDnData)
Used to set external dn data to cube.
Definition Cube.cpp:1605
void close(bool remove=false)
Closes the cube and updates the labels.
Definition Cube.cpp:280
History readHistory(const QString &name="IsisCube") const
Read the History from the Cube.
Definition Cube.cpp:1214
int labelSize(bool actual=false) const
Returns the number of bytes used by the label.
Definition Cube.cpp:2106
Projection * projection()
Definition Cube.cpp:2187
void setLabelsAttached(LabelAttachment attached)
Use prior to calling create, this sets whether or not to use separate label and data files.
Definition Cube.cpp:1652
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition Cube.cpp:1784
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:2094
void reopen(QString access="r")
This method will reopen an isis sube for reading or reading/writing.
Definition Cube.cpp:1136
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:1573
void createGdal(QString &dataFileName, QString &, char **papszOptions)
Definition Cube.cpp:672
Stores stretch information for a cube.
Definition CubeStretch.h:27
File name manipulation and expansion.
Definition FileName.h:100
Container of a cube histogram.
Definition Histogram.h:74
Handles converting buffers to and from disk.
Definition ImageIoHandler.h:99
Create cube polygons, read/write polygons to blobs.
Definition ImagePolygon.h:153
Read and store original labels.
Definition OriginalLabel.h:35
Read and store original Xml labels.
Definition OriginalXmlLabel.h:32
Base class for Map Projections.
Definition Projection.h:155
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:122
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:93
Class for storing Table blobs information.
Definition Table.h:61
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
ByteOrder
Tests the current architecture for byte order.
Definition Endian.h:42
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
PixelType
Enumerations for Isis Pixel Types.
Definition PixelType.h:29