Isis Developer Reference
ProcessExportPds.h
Go to the documentation of this file.
1 #ifndef ProcessExportPds_h
2 #define ProcessExportPds_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include "ProcessExport.h"
11 #include <vector>
12 
13 class QString;
14 
15 namespace Isis {
16  class PvlFormatPds;
17  class Table;
18 
79  public:
84  enum PdsFileType {
85  Image,
87  Qube,
90  SpectralQube,
93  JP2Image
95  };
96 
102  Kilometer
103  };
104 
112  Fixed
114  };
115 
118 
119  // Work with PDS labels for all data set types
120  void StandardAllMapping(Pvl &mainPvl);
121 
122  // Work with PDS labels for data sets of type IMAGE
123  void StreamImageRoot(Pvl &mainPvl);
124  void FixedImageRoot(Pvl &mainPvl);
125  void StreamJP2ImageRoot(Pvl &mainPvl);
126  void FixedJP2ImageRoot(Pvl &mainPvl);
127  void StandardImageImage(Pvl &mainPvl);
128  void StandardJP2Image(Pvl &mainPvl);
129 
130  void SetPdsResolution(PdsResolution resolutionUnits);
131  void SetExportType(PdsExportType recordFormat);
132 
134 
135  void OutputLabel(std::ofstream &pdsFileStream);
136  void updateChecksumInLabel(std::ofstream &pdsFileStream);
137  void OutputDetachedLabel();
138 
139  void ExportTable(Isis::Table isisTable, QString detachedPdsTableFileName="");
140 
141  // include this using declaration to indicate that ProcessExportPds
142  // objects that call a StartProcess() method that has not been overridden
143  // here should use the corresponding base class definitions
145  void StartProcess(std::ofstream &fout);
146 
147  // Accessors
148  bool Detached();
149  bool Attached();
150 
151  // Mutators
152  void SetDetached(QString detachedLabelFile);
153  void SetAttached();
154  void ForceBands(bool force);
155  void ForceBandName(bool force);
156  void ForceCenterFilterWavelength(bool force);
157  void ForceBandwidth(bool force);
158  void ForceBandStorageType(bool force);
159  void ForceOffset(bool force);
160  void ForceScalingFactor(bool force);
161  void ForceSampleBits(bool force);
162  void ForceSampleBitMask(bool force);
163  void ForceSampleType(bool force);
164  void ForceCoreNull(bool force);
165  void ForceCoreLrs(bool force);
166  void ForceCoreLis(bool force);
167  void ForceCoreHrs(bool force);
168  void ForceCoreHis(bool force);
169 
170  protected:
171  int LineBytes();
172  int LabelSize();
173  virtual void CreateImageLabel();
174  void CreateQubeLabel();
176 
177  QString ProjectionName(Pvl &inputLabel);
178 
183 
184  private:
185  PdsResolution m_exportResolution;
186  bool m_forceBands;
188  bool m_forceBandName;
190  bool m_forceCenterFilterWavelength;
193  bool m_forceBandwidth;
195  bool m_forceBandStorageType;
198  bool m_forceOffset;
200  bool m_forceScalingFactor;
203  bool m_forceSampleBits;
205  bool m_forceSampleBitMask;
208  bool m_forceSampleType;
211  bool m_forceCoreNull;
213  bool m_forceCoreLrs;
216  bool m_forceCoreLis;
219  bool m_forceCoreHrs;
222  bool m_forceCoreHis;
225  bool m_detachedLabel;
227  QString m_detachedPdsLabelFile;
229  PdsFileType m_pdsFileType;
232  std::vector<int> m_tableStartRecord;
237  std::vector<int> m_tableRecords;
242  std::vector<char *> m_tableBuffers;
248  };
249 }
250 
251 #endif
Isis::SizeOf
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
Definition: PixelType.h:46
Isis::ProcessExportPds::ForceCenterFilterWavelength
void ForceCenterFilterWavelength(bool force)
Mutator method to set how the CENTER_FILTER_WAVELENGTH keyword will be handled.
Definition: ProcessExportPds.cpp:1150
Isis::ProcessExportPds::ForceBandName
void ForceBandName(bool force)
Mutator method to set how the BAND_NAME keyword will be handled.
Definition: ProcessExportPds.cpp:1137
Isis::ProcessExportPds::SetExportType
void SetExportType(PdsExportType recordFormat)
Mutator method to set the output PDS image record type to stream or fixed.
Definition: ProcessExportPds.cpp:1112
FileName.h
Isis::ILOW_INSTR_SAT4
const int ILOW_INSTR_SAT4
Definition: SpecialPixel.h:139
Table.h
ProjectionFactory.h
Isis::ProcessExportPds::ForceCoreLrs
void ForceCoreLrs(bool force)
Mutator method to set how the CORE_LOW_REPR_SATURATION keyword will be handled.
Definition: ProcessExportPds.cpp:1267
Isis::ExportPdsTable
Export a PDS table from an ISIS Table.
Definition: ExportPdsTable.h:52
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::ProcessExportPds::LineBytes
int LineBytes()
Return the line bytes (record size) for the input cube, at present this is based on the number of sam...
Definition: ProcessExportPds.cpp:837
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::ProcessExportPds::FixedJP2ImageRoot
void FixedJP2ImageRoot(Pvl &mainPvl)
Create the fixed keywords for the ROOT object in a PDS JP2 IMAGE file.
Definition: ProcessExportPds.cpp:330
Isis::ProcessExportPds::ForceSampleBitMask
void ForceSampleBitMask(bool force)
Mutator method to set how the SAMPLE_BIT_MASK keyword will be handled.
Definition: ProcessExportPds.cpp:1228
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::PvlFormatPds
Formats the value of a PvlKeyword into a PDS complient string.
Definition: PvlFormatPds.h:45
Isis::ProcessExportPds::m_exportType
PdsExportType m_exportType
Stream or Fixed.
Definition: ProcessExportPds.h:182
Isis::ProcessExportPds::ProcessExportPds
ProcessExportPds()
Default Constructor - Set to default the data members.
Definition: ProcessExportPds.cpp:36
PvlFormatPds.h
Isis::ProcessExportPds::StreamImageRoot
void StreamImageRoot(Pvl &mainPvl)
Create the standard keywords for the ROOT object in a PDS IMAGE file.
Definition: ProcessExportPds.cpp:205
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::IHIGH_REPR_SAT4
const int IHIGH_REPR_SAT4
Definition: SpecialPixel.h:145
Isis::ProcessExportPds::StandardImageImage
void StandardImageImage(Pvl &mainPvl)
Create the standard keywords for an IMAGE object in a PDS IMAGE file.
Definition: ProcessExportPds.cpp:390
Isis::ProcessExportPds::JP2Image
@ JP2Image
Image coding system JPEG 2000 formatted image.
Definition: ProcessExportPds.h:93
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ProcessExportPds::FixedImageRoot
void FixedImageRoot(Pvl &mainPvl)
Create the fixed keywords for the ROOT object in a PDS IMAGE file.
Definition: ProcessExportPds.cpp:295
Isis::ProcessExportPds::PdsExportType
PdsExportType
Record format type of exported PDS file.
Definition: ProcessExportPds.h:110
Isis::ProcessExportPds::ForceSampleType
void ForceSampleType(bool force)
Mutator method to set how the SAMPLE_TYPE keyword will be handled.
Definition: ProcessExportPds.cpp:1241
Isis::ProcessExportPds::m_label
Pvl * m_label
Exported PDS label.
Definition: ProcessExportPds.h:181
Isis::UnsignedWord
@ UnsignedWord
Definition: PixelType.h:31
Isis::ProcessExportPds::CreateQubeLabel
void CreateQubeLabel()
Create a standard PDS label for type QUBE.
Definition: ProcessExportPds.cpp:161
Isis::Projection::Name
virtual QString Name() const =0
This method returns the name of the map projection.
Isis::ProcessExportPds::SetPdsResolution
void SetPdsResolution(PdsResolution resolutionUnits)
Mutator method to set the output PDS image resolution to meters per pixel or kilometers per pixel.
Definition: ProcessExportPds.cpp:1101
Isis::ProcessExportPds::StandardJP2Image
void StandardJP2Image(Pvl &mainPvl)
Create the standard keywords for an IMAGE object in a PDS JP2 IMAGE file.
Definition: ProcessExportPds.cpp:531
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ProcessExportPds::PdsResolution
PdsResolution
Resolution units per pixel of the exported PDS file.
Definition: ProcessExportPds.h:100
ProcessExport.h
Isis::PvlObject::addObject
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Isis::SignedWord
@ SignedWord
Definition: PixelType.h:32
Isis::ProcessExportPds::ForceBandwidth
void ForceBandwidth(bool force)
Mutator method to set how the BANDWIDTH keyword will be handled.
Definition: ProcessExportPds.cpp:1163
Isis::ProcessExportPds::updateChecksumInLabel
void updateChecksumInLabel(std::ofstream &pdsFileStream)
Updates the CHECKSUM value on the label and rewrites to the output file.
Definition: ProcessExportPds.cpp:953
Isis::ProcessExportPds::ForceCoreLis
void ForceCoreLis(bool force)
Mutator method to set how the CORE_LOW_INSTR_SATURATION keyword will be handled.
Definition: ProcessExportPds.cpp:1281
Isis::PvlFormat::add
void add(const QString &file)
Definition: PvlFormat.cpp:68
PvlFormat.h
ExportPdsTable.h
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::ProcessExportPds::ForceSampleBits
void ForceSampleBits(bool force)
Mutator method to set how the SAMPLE_BITS keyword will be handled.
Definition: ProcessExportPds.cpp:1215
IString.h
Isis::ProcessExportPds::SetDetached
void SetDetached(QString detachedLabelFile)
Mutator method to set the output PDS file to detached.
Definition: ProcessExportPds.cpp:1061
Isis::ExportPdsTable::formatPdsTableName
QString formatPdsTableName()
Format the PDS table object name using the ISIS table name.
Definition: ExportPdsTable.cpp:205
Isis::IHIGH_INSTR_SAT4
const int IHIGH_INSTR_SAT4
Definition: SpecialPixel.h:142
Isis::ProcessExportPds::Meter
@ Meter
Meters per pixel.
Definition: ProcessExportPds.h:101
Isis::ProcessExportPds::Image
@ Image
Two dimensional array of line/sample values.
Definition: ProcessExportPds.h:85
Endian.h
Isis::PvlToPvlTranslationManager
Allows applications to translate simple text files.
Definition: PvlToPvlTranslationManager.h:65
Isis::ExportPdsTable::exportTable
PvlObject exportTable(char *pdsTableBuffer, int pdsFileRecordBytes, QString pdsByteOrder)
This methods fills the given buffer with the binary PDS table data and returns label information.
Definition: ExportPdsTable.cpp:67
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
PixelType.h
Isis::ProcessExportPds::~ProcessExportPds
~ProcessExportPds()
Destructor.
Definition: ProcessExportPds.cpp:68
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Pvl.h
Isis::ProcessExportPds::ProjectionName
QString ProjectionName(Pvl &inputLabel)
Return a projection name.
Definition: ProcessExportPds.cpp:823
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ProcessExportPds::Kilometer
@ Kilometer
Kilometers per pixel.
Definition: ProcessExportPds.h:102
Isis::ProcessExport::StartProcess
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
Definition: ProcessExport.cpp:790
Isis::ProcessExportPds::Attached
bool Attached()
Accessor function returns true if the output PDS file is set to attached.
Definition: ProcessExportPds.cpp:1091
Isis::PvlObject::hasKeyword
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
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
Isis::BigInt
long long int BigInt
Big int.
Definition: Constants.h:49
Isis::ProcessExportPds::OutputLabel
void OutputLabel(std::ofstream &pdsFileStream)
Write the PDS label to the supplied stream.
Definition: ProcessExportPds.cpp:885
Isis::PvlObject::findObject
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
Isis::ProcessExportPds::OutputDetachedLabel
void OutputDetachedLabel()
Write the PDS label to the a detached file.
Definition: ProcessExportPds.cpp:866
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::Msb
@ Msb
Definition: Endian.h:45
Isis::ProcessExportPds::StreamJP2ImageRoot
void StreamJP2ImageRoot(Pvl &mainPvl)
Create the standard keywords for the ROOT object in a PDS JP2 IMAGE file.
Definition: ProcessExportPds.cpp:239
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ILOW_REPR_SAT4
const int ILOW_REPR_SAT4
Definition: SpecialPixel.h:136
Isis::PvlKeyword::setValue
void setValue(QString value, QString unit="")
Sets new values.
Definition: PvlKeyword.cpp:155
Isis::ProcessExportPds::ForceScalingFactor
void ForceScalingFactor(bool force)
Mutator method to set how the SCALING_FACTOR keyword will be handled.
Definition: ProcessExportPds.cpp:1202
Isis::PvlObject::hasObject
bool hasObject(const QString &name) const
Returns a boolean value based on whether the object exists in the current PvlObject or not.
Definition: PvlObject.h:323
Isis::PvlContainer::format
PvlFormat * format()
Definition: PvlContainer.h:248
Isis::ProcessExportPds::SetAttached
void SetAttached()
Mutator method to set the output PDS file to attached.
Definition: ProcessExportPds.cpp:1072
Isis::ProcessExportPds::ExportTable
void ExportTable(Isis::Table isisTable, QString detachedPdsTableFileName="")
This method will add a table to be exported to PDS.
Definition: ProcessExportPds.cpp:996
Isis::ProcessExportPds::CreateImageLabel
virtual void CreateImageLabel()
Create a standard PDS label for type IMAGE.
Definition: ProcessExportPds.cpp:119
Isis::PvlContainer::deleteKeyword
void deleteKeyword(const QString &name)
Remove a specified keyword.
Definition: PvlContainer.cpp:97
Isis::ProcessExportPds::LabelSize
int LabelSize()
Return the size of the output PDS label.
Definition: ProcessExportPds.cpp:850
Isis::ProcessExportPds::CreateSpectralQubeLabel
void CreateSpectralQubeLabel()
Create a standard PDS label for type SPECTRAL_QUBE.
Definition: ProcessExportPds.cpp:182
Isis::ProcessExportPds::ForceBands
void ForceBands(bool force)
Mutator method to set how the the BANDS keyword will be handled.
Definition: ProcessExportPds.cpp:1124
IException.h
std
Namespace for the standard library.
Isis::ProcessExportPds::StandardAllMapping
void StandardAllMapping(Pvl &mainPvl)
Create the standard keywords for the IMAGE_MAP_PROJECTION group in a PDS label.
Definition: ProcessExportPds.cpp:674
Isis::INULL4
const int INULL4
Definition: SpecialPixel.h:133
Isis::ProcessExportPds::m_formatter
PvlFormatPds * m_formatter
Used to determine how to format the keyword values in the PDS file.
Definition: ProcessExportPds.h:179
Isis::ProcessExportPds::Qube
@ Qube
Multi-dimensional array (1-3 dimensional) whose axes may be interpreted as line/sample/band.
Definition: ProcessExportPds.h:87
Isis::ProcessExportPds::Stream
@ Stream
Stream Records. This type is generally used for ASCII files.
Definition: ProcessExportPds.h:111
Isis::PvlKeyword::unit
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
Isis::ProcessExportPds::ForceCoreHis
void ForceCoreHis(bool force)
Mutator method to set how the CORE_HIGH_INSTR_SATURATION keyword will be handled.
Definition: ProcessExportPds.cpp:1309
Isis::ProcessExportPds::Fixed
@ Fixed
Fixed length records.
Definition: ProcessExportPds.h:112
Projection.h
Isis::PvlObject::findKeyword
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
Isis::ByteOrderName
QString ByteOrderName(Isis::ByteOrder byteOrder)
Definition: Endian.h:48
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
Isis::ProcessExportPds
Process class for exporting cubes to PDS standards.
Definition: ProcessExportPds.h:78
Isis::ProcessExportPds::StandardPdsLabel
virtual Pvl & StandardPdsLabel(ProcessExportPds::PdsFileType type)
Create a standard PDS label of the type specified.
Definition: ProcessExportPds.cpp:92
ProcessExportPds.h
Isis::ProcessExportPds::ForceCoreHrs
void ForceCoreHrs(bool force)
Mutator method to set how the CORE_HIGH_REPR_SATURATION keyword will be handled.
Definition: ProcessExportPds.cpp:1295
Isis::Table::Records
int Records() const
Returns the number of records.
Definition: Table.cpp:313
Isis::ProcessExportPds::PdsFileType
PdsFileType
File type to be exported.
Definition: ProcessExportPds.h:84
Isis::ProcessExportPds::ForceOffset
void ForceOffset(bool force)
Mutator method to set how the OFFSET keyword will be handled.
Definition: ProcessExportPds.cpp:1189
Isis::Lsb
@ Lsb
Definition: Endian.h:44
Isis::Projection
Base class for Map Projections.
Definition: Projection.h:155
Isis::UnsignedByte
@ UnsignedByte
Definition: PixelType.h:29
Isis::ProcessExportPds::Detached
bool Detached()
Accessor function returns true if the output PDS file is set to detached.
Definition: ProcessExportPds.cpp:1082
PvlToPvlTranslationManager.h
Isis::ProcessExportPds::ForceBandStorageType
void ForceBandStorageType(bool force)
Mutator method to set how the BAND_STORAGE_TYPE keyword will be handled.
Definition: ProcessExportPds.cpp:1176
Isis::ProcessExportPds::SpectralQube
@ SpectralQube
Three dimensional objects with two spatial dimensions and one spectral dimension.
Definition: ProcessExportPds.h:90
Isis::PvlToPvlTranslationManager::Auto
void Auto(Pvl &outputLabel)
Automatically translate all the output names found in the translation table If a output name does not...
Definition: PvlToPvlTranslationManager.cpp:199
Isis::ProcessExport
Process class for exporting cubes.
Definition: ProcessExport.h:111
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProcessExportPds::StartProcess
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
Definition: ProcessExport.cpp:790
Isis::ProcessExportPds::ForceCoreNull
void ForceCoreNull(bool force)
Mutator method to set how the CORE_NULL keyword will be handled.
Definition: ProcessExportPds.cpp:1254
Isis::Real
@ Real
Definition: PixelType.h:35