Isis 3 Programmer Reference
ProcessExportPds4.h
1 #ifndef ProcessExportPds4_h
2 #define ProcessExportPds4_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 #include <QString>
25 #include <QDomDocument>
26 
27 namespace Isis {
28 
87  public:
88 
91 
92  enum ImageType {
93  StandardImage,
94  BinSetSpectrum,
95  UniformlySampledSpectrum
96  };
97 
98  QDomDocument &StandardPds4Label();
99  QDomDocument &SpectralPds4Label();
100  void StandardAllMapping();
101 
102  void CreateImageLabel();
103  void StandardImageImage();
104 
105  void OutputLabel(std::ofstream &os);
106 
107  // Include this using declaration to indicate that ProcessExportPds4
108  // objects that call a StartProcess() method that has not been overridden
109  // here should use the corresponding base class definitions
111  void StartProcess(std::ofstream &fout);
112  QDomDocument &GetLabel();
113  void WritePds4(QString outFile);
114  QDomElement getElement(QStringList xmlPath, QDomElement parent=QDomElement());
115  void addHistory(QString description, QString date = "tbd", QString version = "1.0");
116  void setLogicalId(QString lid);
117  void setVersionId(QString versionId);
118  void setTitle(QString title);
119  void setSchemaLocation(QString schema);
120  void setImageType(ImageType imageType);
121  void setPixelDescription(QString description);
122  static void translateUnits(QDomDocument &label,
123  QString transMapFile = "$base/translations/pds4ExportUnits.pvl");
124  void reorder();
125  void addSchema(QString sch, QString xsd, QString xmlns, QString xmlnsURI);
126  void addSchema(QString xsd, QString xmlns, QString xmlnsURI);
127 
128  protected:
129  void identificationArea();
130  void standardInstrument();
131  void standardBandBin();
132  void displaySettings();
133  void fileAreaObservational();
134  QString PDS4PixelType(PixelType pixelType, ByteOrder endianType);
135  static QMap<QString, QString> createUnitMap(Pvl configPvl);
136  static void translateChildUnits(QDomElement parent, QMap<QString, QString> transMap);
137  void translateBandBinImage(Pvl &inputLabel);
138  void translateBandBinSpectrumUniform(Pvl &inputLabel);
139  void translateBandBinSpectrumBinSet(Pvl &inputLabel);
140 
141  QDomDocument *m_domDoc;
143  QString m_lid;
144  QString m_versionId;
145  QString m_title;
146  ImageType m_imageType;
148 
149  };
150 }
151 
152 #endif
void WritePds4(QString outFile)
This method write out the labels and image data to the specified output file.
void displaySettings()
This method writes the display direction information to the PDS4 labels.
void translateBandBinSpectrumBinSet(Pvl &inputLabel)
Export BandBin group for non-uniformly spaced 3D Spectral data format.
Process class for exporting cubes to PDS4 standards.
QDomDocument * m_domDoc
XML label.
QString m_versionId
QString with specified version id.
static void translateUnits(QDomDocument &label, QString transMapFile="$base/translations/pds4ExportUnits.pvl")
This function will go through an XML document and attempt to convert all "units" attributes to the ap...
Process class for exporting cubes.
QString PDS4PixelType(PixelType pixelType, ByteOrder endianType)
Helper function for converting ISIS pixel type and byte order to a PDS4 data_type value...
QDomDocument & StandardPds4Label()
Create a standard PDS4 image label from the input cube.
void translateBandBinImage(Pvl &inputLabel)
Export BandBin group for 2D or 3D Image format.
void addSchema(QString sch, QString xsd, QString xmlns, QString xmlnsURI)
Adds necessary information to the xml header for a pds4 class.
void translateBandBinSpectrumUniform(Pvl &inputLabel)
Export BandBin group for uniformly spaced 3D Spectral data format.
ByteOrder
Tests the current architecture for byte order.
Definition: Endian.h:59
void StandardAllMapping()
Create the standard keywords for the IMAGE_MAP_PROJECTION group in a PDS label.
void setSchemaLocation(QString schema)
Allows mission specific programs to use specified versions of dictionaries.
void OutputLabel(std::ofstream &os)
Write the XML label to the supplied stream.
void standardBandBin()
Export bandbin group to sp:Spectral Characteristics.
void reorder()
This method reorders the existing m_domDoc to follow PDS4 standards and fixes time formatting if need...
PixelType
Enumerations for Isis Pixel Types.
Definition: PixelType.h:43
void addHistory(QString description, QString date="tbd", QString version="1.0")
Add a modification history instance by adding a Modification_Detail entry to the Modification_History...
void setLogicalId(QString lid)
Allows mission specific programs to set logical_identifier required for PDS4 labels.
void setTitle(QString title)
Allows mission specific programs to set the title required for PDS4 labels.
QString m_lid
QString with specified logical identifier.
void setImageType(ImageType imageType)
Create a standard PDS4 image label from the input cube.
QString m_pixelDescription
Description of pixel values.
QString m_title
QString with specified title.
static void translateChildUnits(QDomElement parent, QMap< QString, QString > transMap)
Recursive method that will translate the "unit" attribute of any child elements of a given element...
virtual void StartProcess(void funct(Isis::Buffer &in))
This method invokes the process operation over a single input cube.
Container for cube-like labels.
Definition: Pvl.h:135
void CreateImageLabel()
Creates a PDS4 label.
ProcessExportPds4()
Default Constructor - Set to default the data members.
void setVersionId(QString versionId)
Allows mission specific programs to set version_id required for PDS4 labels.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
static QMap< QString, QString > createUnitMap(Pvl configPvl)
Helper function for creating the unit translation map from a PVL object.
QString m_schemaLocation
QString with all schema locations required.
void setPixelDescription(QString description)
Sets the description string which describes the pixel vales in File_Area_Observational.
QDomElement getElement(QStringList xmlPath, QDomElement parent=QDomElement())
Convenience method to get an element given a path and its parent.
ImageType m_imageType
Type of image data to be written.
void identificationArea()
This method writes the identification information to the PDS4 labels.
QDomDocument & GetLabel()
Return the internalized PDS4 label.
void fileAreaObservational()
Create and internalize an image output label from the input image.
void StartProcess(std::ofstream &fout)
This method fills the image data of the PDS4 file using the parent class ProcessExport::StartProcess...
void standardInstrument()
This method translates the information from the ISIS Instrument group to the PDS4 labels...