USGS

Isis 3.0 Developer's Reference (API)

Home

ProcessImport.h

Go to the documentation of this file.
00001 #ifndef ProcessImport_h
00002 #define ProcessImport_h
00003 
00025 #include <string>
00026 
00027 #include "Buffer.h"
00028 #include "CubeAttribute.h"
00029 #include "EndianSwapper.h"
00030 #include "JP2Decoder.h"
00031 #include "PixelType.h"
00032 #include "Process.h"
00033 #include "PvlTranslationManager.h"
00034 #include "SpecialPixel.h"
00035 
00036 namespace Isis {
00139   class ProcessImport : public Isis::Process {
00140     public:
00141       ProcessImport();
00142       ~ProcessImport();
00143       void StartProcess();
00144       void StartProcess(void funct(Isis::Buffer &out));
00145       void SetInputFile(const QString &file);
00146       Isis::Cube *SetOutputCube(const QString &parameter);
00147       Isis::Cube *SetOutputCube(const QString &parameter,
00148                                 Isis::CubeAttributeOutput &att);
00149       void SetPixelType(const Isis::PixelType type);
00154       Isis::PixelType PixelType() {
00155         return p_pixelType;
00156       }
00157       void SetDimensions(const int ns, const int nl, const int nb);
00158 
00163       int Samples() {
00164         return p_ns;
00165       }
00166 
00171       int Lines() {
00172         return p_nl;
00173       }
00174 
00179       int Bands() {
00180         return p_nb;
00181       }
00182 
00183       void SetByteOrder(const Isis::ByteOrder order);
00184 
00189       Isis::ByteOrder ByteOrder() {
00190         return p_byteOrder;
00191       }
00192 
00193       void SetFileHeaderBytes(const int bytes);
00194       void SetFileTrailerBytes(const int bytes);
00195       void SetDataHeaderBytes(const int bytes);
00196       void SetDataTrailerBytes(const int bytes);
00197       void SetDataPrefixBytes(const int bytes);
00198       void SetDataSuffixBytes(const int bytes);
00199       void SaveFileHeader();
00200       void SaveFileTrailer();
00201       void SaveDataHeader();
00202       void SaveDataTrailer();
00203       void SaveDataPrefix();
00204       void SaveDataSuffix();
00205       char *FileHeader();
00206       char *FileTrailer();
00207       std::vector<char *> DataHeader();
00208       std::vector<char *> DataTrailer();
00209       std::vector<std::vector<char *> > DataPrefix();
00210       std::vector<std::vector<char *> > DataSuffix();
00211 
00216       enum Interleave {
00217         InterleaveUndefined, 
00218         JP2,                 
00219         BSQ,                
00222         BIL,                 
00226         BIP                  
00230       };
00231       void SetOrganization(const ProcessImport::Interleave org);
00232 
00233       void SetBase(const double base);
00234       void SetMultiplier(const double mult);
00235       void SetBase(const std::vector<double> base);
00236       void SetMultiplier(const std::vector<double> mult);
00237 
00238       void SetSpecialValues(const double null, const double lrs,
00239                             const double lis, const double hrs,
00240                             const double his);
00241       void SetNull(const double null_min, const double null_max);
00242       void SetLRS(const double lrs_min, const double lrs_max);
00243       void SetLIS(const double lis_min, const double lis_max);
00244       void SetHRS(const double hrs_min, const double hrs_max);
00245       void SetHIS(const double his_min, const double his_max);
00246 
00247       double TestPixel(const double pixel);
00248 
00249 #if 0
00250       void AddImportLabel(Isis::Pvl &importLab);
00251       void AddLabel(Isis::Pvl &label);
00252 #endif
00253 
00254 
00255     private:
00256       QString p_inFile;        
00257       Isis::PixelType p_pixelType; 
00258       int p_ns;                    
00259       int p_nl;                    
00260       int p_nb;                    
00261       Isis::ByteOrder p_byteOrder; 
00262       int p_fileHeaderBytes;       
00266       int p_fileTrailerBytes;      
00270       int p_dataHeaderBytes;       
00274       int p_dataTrailerBytes;      
00278       int p_dataPreBytes;          
00281       int p_dataPostBytes;         
00284       bool p_saveFileHeader;       
00286       bool p_saveDataHeader;       
00288       bool p_saveDataTrailer;      
00290       bool p_saveDataPre;          
00292       bool p_saveDataPost;         
00294       bool p_saveFileTrailer;      
00296       char *p_fileHeader;                          
00297       std::vector<char *>p_dataHeader;             
00298       std::vector<char *>p_dataTrailer;            
00299       std::vector<std::vector<char *> >p_dataPre;  
00300       std::vector<std::vector<char *> >p_dataPost; 
00301       char *p_fileTrailer;                         
00302 
00303       ProcessImport::Interleave p_organization; 
00310       std::vector<double> p_base; 
00314       std::vector<double> p_mult; 
00319       double p_null_min;     
00323       double p_null_max;     
00327       double p_hrs_min;     
00331       double p_hrs_max;     
00335       double p_his_min;     
00339       double p_his_max;     
00343       double p_lrs_min;     
00347       double p_lrs_max;     
00351       double p_lis_min;     
00355       double p_lis_max;     
00359       void ProcessBsq(void funct(Isis::Buffer &out) = NULL);
00360       void ProcessBil(void funct(Isis::Buffer &out) = NULL);
00361       void ProcessBip(void funct(Isis::Buffer &out) = NULL);
00362       void ProcessJp2(void funct(Isis::Buffer &out) = NULL);
00363 
00364       void CheckPixelRange(QString pixelName, double min, double max);
00365   };
00366 };
00367 #endif