USGS

Isis 3.0 Developer's Reference (API)

Home

ProcessImport.h
Go to the documentation of this file.
1 #ifndef ProcessImport_h
2 #define ProcessImport_h
3 
25 #include <string>
26 
27 #include "Buffer.h"
28 #include "CubeAttribute.h"
29 #include "EndianSwapper.h"
30 #include "JP2Decoder.h"
31 #include "PixelType.h"
32 #include "Process.h"
33 #include "PvlTranslationManager.h"
34 #include "SpecialPixel.h"
35 
36 namespace Isis {
150  class ProcessImport : public Isis::Process {
151  public:
152  ProcessImport();
153  virtual ~ProcessImport();
154  virtual void StartProcess();
155  virtual void StartProcess(void funct(Isis::Buffer &out));
156  void SetInputFile(const QString &file);
157  QString InputFile();
158 
159  // SetOutputCube() is not virtual in the Process class, so the following
160  // definitions for this method are the only ones that are allowed for
161  // ProcessImport objects and child objects
162  Isis::Cube *SetOutputCube(const QString &parameter);
163  virtual Isis::Cube *SetOutputCube(const QString &fname,
165  void SetPixelType(const Isis::PixelType type);
171  return p_pixelType;
172  }
173  void SetDimensions(const int ns, const int nl, const int nb);
174 
179  int Samples() {
180  return p_ns;
181  }
182 
187  int Lines() {
188  return p_nl;
189  }
190 
195  int Bands() {
196  return p_nb;
197  }
198 
199  void SetByteOrder(const Isis::ByteOrder order);
200 
206  return p_byteOrder;
207  }
208 
209  void SetFileHeaderBytes(const int bytes);
210  void SetFileTrailerBytes(const int bytes);
211  void SetDataHeaderBytes(const int bytes);
212  void SetDataTrailerBytes(const int bytes);
213  void SetDataPrefixBytes(const int bytes);
214  void SetDataSuffixBytes(const int bytes);
215  void SaveFileHeader();
216  void SaveFileTrailer();
217  void SaveDataHeader();
218  void SaveDataTrailer();
219  void SaveDataPrefix();
220  void SaveDataSuffix();
221 
222  int FileHeaderBytes() const;
223  int FileTrailerBytes() const;
224  int DataHeaderBytes() const;
225  int DataTrailerBytes() const;
226  int DataPrefixBytes() const;
227  int DataSuffixBytes() const;
228 
229  char *FileHeader();
230  char *FileTrailer();
231  std::vector<char *> DataHeader();
232  std::vector<char *> DataTrailer();
233  std::vector<std::vector<char *> > DataPrefix();
234  std::vector<std::vector<char *> > DataSuffix();
235 
240  enum Interleave {
242  JP2,
243  BSQ,
246  BIL,
254  };
256  Interleave Organization() const;
257 
258  void SetBase(const double base);
259  void SetMultiplier(const double mult);
260  void SetBase(const std::vector<double> base);
261  void SetMultiplier(const std::vector<double> mult);
262 
263  void SetSpecialValues(const double null, const double lrs,
264  const double lis, const double hrs,
265  const double his);
266  void SetNull(const double null_min, const double null_max);
267  void SetLRS(const double lrs_min, const double lrs_max);
268  void SetLIS(const double lis_min, const double lis_max);
269  void SetHRS(const double hrs_min, const double hrs_max);
270  void SetHIS(const double his_min, const double his_max);
271 
272  double TestPixel(const double pixel);
273 
274 #if 0
275  void AddImportLabel(Isis::Pvl &importLab);
276  void AddLabel(Isis::Pvl &label);
277 #endif
278 
279 
280  private:
281  QString p_inFile;
282  Isis::PixelType p_pixelType;
283  int p_ns;
284  int p_nl;
285  int p_nb;
286  Isis::ByteOrder p_byteOrder;
287  int p_fileHeaderBytes;
291  int p_fileTrailerBytes;
295  int p_dataHeaderBytes;
299  int p_dataTrailerBytes;
303  int p_dataPreBytes;
306  int p_dataPostBytes;
309  bool p_saveFileHeader;
311  bool p_saveDataHeader;
313  bool p_saveDataTrailer;
315  bool p_saveDataPre;
317  bool p_saveDataPost;
319  bool p_saveFileTrailer;
321  char *p_fileHeader;
322  std::vector<char *>p_dataHeader;
323  std::vector<char *>p_dataTrailer;
324  std::vector<std::vector<char *> >p_dataPre;
325  std::vector<std::vector<char *> >p_dataPost;
326  char *p_fileTrailer;
327 
328  ProcessImport::Interleave p_organization;
335  std::vector<double> p_base;
339  std::vector<double> p_mult;
344  double p_null_min;
348  double p_null_max;
352  double p_hrs_min;
356  double p_hrs_max;
360  double p_his_min;
364  double p_his_max;
368  double p_lrs_min;
372  double p_lrs_max;
376  double p_lis_min;
380  double p_lis_max;
384  void ProcessBsq(void funct(Isis::Buffer &out) = NULL);
385  void ProcessBil(void funct(Isis::Buffer &out) = NULL);
386  void ProcessBip(void funct(Isis::Buffer &out) = NULL);
387  void ProcessJp2(void funct(Isis::Buffer &out) = NULL);
388 
389  void CheckPixelRange(QString pixelName, double min, double max);
390  };
391 };
392 #endif