Isis 3 Programmer Reference
ProcessExportPds.h
1 #ifndef ProcessExportPds_h
2 #define ProcessExportPds_h
3 /*
4  * Unless noted otherwise, the portions of Isis written by the
5  * USGS are public domain. See individual third-party library
6  * and package descriptions for intellectual property
7  * information,user agreements, and related information.
8  *
9  * Although Isis has been used by the USGS, no warranty, expressed or implied,
10  * is made by the USGS as to the accuracy and functioning of such software
11  * and related material nor shall the fact of distribution constitute any such
12  * warranty, and no responsibility is assumed by the USGS in connection
13  * therewith.
14  *
15  * For additional information, launch
16  * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see
17  * the Privacy & Disclaimers page on the Isis website,
18  * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
19  * http://www.usgs.gov/privacy.html.
20  */
21 
22 #include "ProcessExport.h"
23 #include <vector>
24 
25 class QString;
26 
27 namespace Isis {
28  class PvlFormatPds;
29  class Table;
30 
91  public:
96  enum PdsFileType {
99  Qube,
107  };
108 
115  };
116 
126  };
127 
130 
131  // Work with PDS labels for all data set types
132  void StandardAllMapping(Pvl &mainPvl);
133 
134  // Work with PDS labels for data sets of type IMAGE
135  void StreamImageRoot(Pvl &mainPvl);
136  void FixedImageRoot(Pvl &mainPvl);
137  void StreamJP2ImageRoot(Pvl &mainPvl);
138  void FixedJP2ImageRoot(Pvl &mainPvl);
139  void StandardImageImage(Pvl &mainPvl);
140  void StandardJP2Image(Pvl &mainPvl);
141 
142  void SetPdsResolution(PdsResolution resolutionUnits);
143  void SetExportType(PdsExportType recordFormat);
144 
146 
147  void OutputLabel(std::ofstream &pdsFileStream);
148  void updateChecksumInLabel(std::ofstream &pdsFileStream);
149  void OutputDetachedLabel();
150 
151  void ExportTable(Isis::Table isisTable, QString detachedPdsTableFileName="");
152 
153  // include this using declaration to indicate that ProcessExportPds
154  // objects that call a StartProcess() method that has not been overridden
155  // here should use the corresponding base class definitions
157  void StartProcess(std::ofstream &fout);
158 
159  // Accessors
160  bool Detached();
161  bool Attached();
162 
163  // Mutators
164  void SetDetached(QString detachedLabelFile);
165  void SetAttached();
166  void ForceBands(bool force);
167  void ForceBandName(bool force);
168  void ForceCenterFilterWavelength(bool force);
169  void ForceBandwidth(bool force);
170  void ForceBandStorageType(bool force);
171  void ForceOffset(bool force);
172  void ForceScalingFactor(bool force);
173  void ForceSampleBits(bool force);
174  void ForceSampleBitMask(bool force);
175  void ForceSampleType(bool force);
176  void ForceCoreNull(bool force);
177  void ForceCoreLrs(bool force);
178  void ForceCoreLis(bool force);
179  void ForceCoreHrs(bool force);
180  void ForceCoreHis(bool force);
181 
182  protected:
183  int LineBytes();
184  int LabelSize();
185  virtual void CreateImageLabel();
186  void CreateQubeLabel();
188 
189  QString ProjectionName(Pvl &inputLabel);
190 
195 
196  private:
244  std::vector<int> m_tableStartRecord;
249  std::vector<int> m_tableRecords;
254  std::vector<char *> m_tableBuffers;
260  };
261 }
262 
263 #endif
void ForceCoreLis(bool force)
Mutator method to set how the CORE_LOW_INSTR_SATURATION keyword will be handled.
std::vector< int > m_tableRecords
Number of records in each added table.
void ForceSampleBits(bool force)
Mutator method to set how the SAMPLE_BITS keyword will be handled.
bool m_forceBandName
Indicates whether to keep the BAND_NAME keyword in the PDS labels.
~ProcessExportPds()
Destructor.
void ForceScalingFactor(bool force)
Mutator method to set how the SCALING_FACTOR keyword will be handled.
void SetAttached()
Mutator method to set the output PDS file to attached.
void CreateSpectralQubeLabel()
Create a standard PDS label for type SPECTRAL_QUBE.
int LabelSize()
Return the size of the output PDS label.
void ForceBands(bool force)
Mutator method to set how the the BANDS keyword will be handled.
bool m_forceCoreNull
Indicates whether to add the CORE_NULL keyword in the PDS labels.
Process class for exporting cubes.
void OutputLabel(std::ofstream &pdsFileStream)
Write the PDS label to the supplied stream.
Fixed length records.
bool m_forceBands
Indicates whether to keep the BANDS keyword in the PDS labels.
virtual void CreateImageLabel()
Create a standard PDS label for type IMAGE.
bool m_detachedLabel
Indicates whether the PDS file will be detached.
bool m_forceOffset
Indicates whether to add the OFFSET keyword in the PDS labels.
bool m_forceSampleBitMask
Indicates whether to add the SAMPLE_BIT_MASK keyword in the PDS labels.
void ForceCoreHis(bool force)
Mutator method to set how the CORE_HIGH_INSTR_SATURATION keyword will be handled. ...
bool Attached()
Accessor function returns true if the output PDS file is set to attached.
PdsFileType m_pdsFileType
Image, Qube, Spectral Qube, or JP2 Image.
void StandardAllMapping(Pvl &mainPvl)
Create the standard keywords for the IMAGE_MAP_PROJECTION group in a PDS label.
PdsFileType
File type to be exported.
void ForceOffset(bool force)
Mutator method to set how the OFFSET keyword will be handled.
void ExportTable(Isis::Table isisTable, QString detachedPdsTableFileName="")
This method will add a table to be exported to PDS.
bool Detached()
Accessor function returns true if the output PDS file is set to detached.
void StreamJP2ImageRoot(Pvl &mainPvl)
Create the standard keywords for the ROOT object in a PDS JP2 IMAGE file.
std::vector< char * > m_tableBuffers
Vector containing the binary table data for each of the added tables.
QString m_detachedPdsLabelFile
The name of the detached PDS label file.
bool m_forceScalingFactor
Indicates whether to add the SCALING_FACTOR keyword in the PDS labels.
bool m_forceSampleBits
Indicates whether to add the SAMPLE_BITS keyword in the PDS labels.
Formats the value of a PvlKeyword into a PDS complient string.
Definition: PvlFormatPds.h:61
bool m_forceCoreLrs
Indicates whether to add the CORE_LOW_REPR_SATURATION keyword in the PDS labels.
bool m_forceCoreLis
Indicates whether to add the CORE_LOW_INSTR_SATURATION keyword in the PDS labels. ...
void ForceBandStorageType(bool force)
Mutator method to set how the BAND_STORAGE_TYPE keyword will be handled.
void ForceCoreHrs(bool force)
Mutator method to set how the CORE_HIGH_REPR_SATURATION keyword will be handled.
void ForceCoreNull(bool force)
Mutator method to set how the CORE_NULL keyword will be handled.
PvlFormatPds * m_formatter
Used to determine how to format the keyword values in the PDS file.
void ForceSampleBitMask(bool force)
Mutator method to set how the SAMPLE_BIT_MASK keyword will be handled.
void ForceBandName(bool force)
Mutator method to set how the BAND_NAME keyword will be handled.
void SetExportType(PdsExportType recordFormat)
Mutator method to set the output PDS image record type to stream or fixed.
void StandardImageImage(Pvl &mainPvl)
Create the standard keywords for an IMAGE object in a PDS IMAGE file.
virtual Pvl & StandardPdsLabel(ProcessExportPds::PdsFileType type)
Create a standard PDS label of the type specified.
void StreamImageRoot(Pvl &mainPvl)
Create the standard keywords for the ROOT object in a PDS IMAGE file.
bool m_forceSampleType
Indicates whether to add the SAMPLE_TYPE keyword in the PDS labels.
PdsExportType
Record format type of exported PDS file.
std::vector< int > m_tableStartRecord
Record number where the added table data begins.
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
Pvl * m_label
Exported PDS label.
void FixedImageRoot(Pvl &mainPvl)
Create the fixed keywords for the ROOT object in a PDS IMAGE file.
void FixedJP2ImageRoot(Pvl &mainPvl)
Create the fixed keywords for the ROOT object in a PDS JP2 IMAGE file.
Container for cube-like labels.
Definition: Pvl.h:135
void ForceCenterFilterWavelength(bool force)
Mutator method to set how the CENTER_FILTER_WAVELENGTH keyword will be handled.
void ForceCoreLrs(bool force)
Mutator method to set how the CORE_LOW_REPR_SATURATION keyword will be handled.
bool m_forceBandwidth
Indicates whether to keep the BANDWIDTH keyword in the PDS labels.
int LineBytes()
Return the line bytes (record size) for the input cube, at present this is based on the number of sam...
void SetPdsResolution(PdsResolution resolutionUnits)
Mutator method to set the output PDS image resolution to meters per pixel or kilometers per pixel...
Class for storing Table blobs information.
Definition: Table.h:77
PdsResolution
Resolution units per pixel of the exported PDS file.
Process class for exporting cubes to PDS standards.
PdsExportType m_exportType
Stream or Fixed.
ProcessExportPds()
Default Constructor - Set to default the data members.
void CreateQubeLabel()
Create a standard PDS label for type QUBE.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Three dimensional objects with two spatial dimensions and one spectral dimension. ...
PdsResolution m_exportResolution
Meters or kilometers.
void StandardJP2Image(Pvl &mainPvl)
Create the standard keywords for an IMAGE object in a PDS JP2 IMAGE file.
void SetDetached(QString detachedLabelFile)
Mutator method to set the output PDS file to detached.
Image coding system JPEG 2000 formatted image.
bool m_forceCoreHis
Indicates whether to add the CORE_HIGH_INSTR_SATURATION keyword in the PDS labels.
bool m_forceBandStorageType
Indicates whether to add the BAND_STORAGE_TYPE keyword in the PDS labels.
bool m_forceCoreHrs
Indicates whether to add the CORE_HIGH_REPR_SATURATION keyword in the PDS labels. ...
void ForceSampleType(bool force)
Mutator method to set how the SAMPLE_TYPE keyword will be handled.
void StartProcess(std::ofstream &fout)
This method fills the image data of the PDS file using the parent class ProcessExport::StartProcess, then appends any attached tables.
void ForceBandwidth(bool force)
Mutator method to set how the BANDWIDTH keyword will be handled.
Multi-dimensional array (1-3 dimensional) whose axes may be interpreted as line/sample/band.
Stream Records. This type is generally used for ASCII files.
Two dimensional array of line/sample values.
QString ProjectionName(Pvl &inputLabel)
Return a projection name.
void OutputDetachedLabel()
Write the PDS label to the a detached file.
bool m_forceCenterFilterWavelength
Indicates whether to keep the CENTER_FILTER_WAVELENGTH keyword in the PDS labels. ...
void updateChecksumInLabel(std::ofstream &pdsFileStream)
Updates the CHECKSUM value on the label and rewrites to the output file.