Isis 3 Programmer Reference
ProcessMosaic.h
Go to the documentation of this file.
1 #ifndef ProcessMosaic_h
2 #define ProcessMosaic_h
3 
25 #include "Process.h"
26 
27 namespace Isis {
28  class Portal;
29 
210  class ProcessMosaic : public Process {
211 
212  public:
213  static const char *TRACKING_TABLE_NAME;
214 
215  // see http://blog.stata.com/tag/binary/
216  static const int FLOAT_STORE_INT_PRECISELY_MAX_VALUE = 16777216;
217  static const int FLOAT_STORE_INT_PRECISELY_MIN_VALUE = -16777215;
218 
228  NumImageOverlayOptions
229  };
230 
231  // Constructs a Mosaic object
232  ProcessMosaic();
233 
234  // Destroys the Mosaic object. It will close all opened cubes.
235  virtual ~ProcessMosaic();
236 
237  using Isis::Process::StartProcess; // make parent funtions visable
238 
239  // Line Processing method for one input and output cube
240  virtual void StartProcess(const int &piOutSample, const int &piOutLine, const int &piOutBand);
241 
242  // Finish with tracking cube
243  virtual void EndProcess();
244 
245  // Accessor for the placed images.
247 
248  using Process::SetInputCube;
249 
250  // Set input cube to specified image name at the starting and count of
251  // samples, lines, bands
252  virtual Isis::Cube *SetInputCube(const QString &parameter,
253  const int ss, const int sl,
254  const int sb,
255  const int ns, const int nl,
256  const int nb);
257 
258  // Set input cube to specified image name with specified attributes at the
259  // starting and count of samples, lines, bands
260  virtual Isis::Cube *SetInputCube(const QString &fname,
262  const int ss = 1, const int sl = 1,
263  const int sb = 1,
264  const int ns = -1, const int nl = -1,
265  const int nb = -1);
266 
267  // SetOutputCube() is not virtual in the Process class, so the following
268  // definitions for this method are the only ones that are allowed for
269  // ProcessMosaic objects and child objects, unless redifined in the
270  // child class
271  Isis::Cube *SetOutputCube(const QString &psParameter);
272 
273  void SetBandBinMatch(bool enforceBandBinMatch);
274 
275  void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue);
276  void SetBandNumber(int bandPriorityBandNumber);
277  void SetBandUseMaxValue(bool useMax);
278  void SetCreateFlag(bool createOutputMosaic);
279  void SetHighSaturationFlag(bool placeHighSatPixels);
280  void SetImageOverlay(ImageOverlay placement);
281  void SetLowSaturationFlag(bool placeLowSatPixels);
282  void SetMatchDEM(bool matchDEM);
283  void SetNullFlag(bool placeNullPixels);
284  void SetTrackFlag(bool trackingEnabled);
285 
286  bool GetHighSaturationFlag() const;
287  ImageOverlay GetImageOverlay() const;
288  bool GetLowSaturationFlag() const;
289  bool GetNullFlag() const;
290  bool GetTrackFlag() const;
291 
292  int GetInputStartLineInMosaic() const;
293  int GetInputStartSampleInMosaic() const;
294  int GetInputStartBandInMosaic() const;
295 
296  static QString OverlayToString(ImageOverlay);
297  static ImageOverlay StringToOverlay(QString);
298 
299  private:
300 
301  //Compare the input and mosaic for the specified band based on the criteria and update the
302  // mosaic origin band.
303  void BandComparison(int iss, int isl, int ins, int inl,
304  int bandPriorityInputBandNumber, int bandPriorityOutputBandNumber,
305  int index);
306 
307  // Mosaicking for Band Priority with no Tracking
308  void BandPriorityWithNoTracking(int iss, int isl, int isb,
309  int ins, int inl, int inb,
310  int bandPriorityInputBandNumber,
311  int bandPriorityOutputBandNumber);
312 
313  // Get the default origin value based on pixel type for the origin band
315 
316  // Get the Band Index in an image of type (input/output)
317  int GetBandIndex(bool inputFile);
318 
319  // Checks for the table with name "InputImage"
320  bool GetTrackStatus();
321 
322  // New mosaic, add the Band Bin group specific to the mosaic
323  void AddBandBinGroup(int origIsb);
324 
325  // Default BandBin group if Match BandBin is set to False
326  void AddDefaultBandBinGroup();
327 
328  // Mosaic exists, match the band with the input image
329  void MatchBandBinGroup(int origIsb, int &inb);
330 
331  bool ProcessAveragePriority(int piPixel, Portal& pInPortal, Portal& pOutPortal,
332  Portal& pOrigPortal);
333 
334  void ResetCountBands();
335 
336  // Match DEM between Input & Mosaic if MatchDEM Flag is enabled
337  void MatchDEMShapeModel();
338 
339  bool m_trackingEnabled;
341  bool m_createOutputMosaic;
342  int m_bandPriorityBandNumber;
343  QString m_bandPriorityKeyName;
344  QString m_bandPriorityKeyValue;
345  bool m_bandPriorityUseMaxValue;
346 
347 
348  int m_iss;
349  int m_isl;
350  int m_isb;
351  int m_ins;
352  int m_inl;
353  int m_inb;
354 
355  int m_oss;
356  int m_osl;
357  int m_osb;
358  int m_onb;
359 
365 
366  ImageOverlay m_imageOverlay;
367 
369 
370  /*
371  * Set the Special Pixels Flags to True/False.
372  * True- allow the special pixel to be passed onto the mosaic.
373  * Holds good for input and band priority
374  */
375  bool m_placeHighSatPixels;
376  bool m_placeLowSatPixels;
377  bool m_placeNullPixels;
378  };
379 };
380 
381 #endif
Manipulate and parse attributes of input cube filenames.
bool ProcessAveragePriority(int piPixel, Portal &pInPortal, Portal &pOutPortal, Portal &pOrigPortal)
Calculate DN value for a pixel for AverageImageWithMosaic priority and set the Count band portal...
bool GetTrackStatus()
This method searchs the mosaic label for a table with name "InputFile".
void SetNullFlag(bool placeNullPixels)
When true, Null pixels will be considered valid data for the purposes of placing pixels in the output...
int m_inb
The number of bands from the input cube.
void SetHighSaturationFlag(bool placeHighSatPixels)
When true, high saturation (HRS, HIS) will be considered valid data for the purposes of placing pixel...
virtual void EndProcess()
Cleans up by closing input, output and tracking cubes.
void ResetCountBands()
Reset all the count bands to default at the time of mosaic creation.
int GetInputStartLineInMosaic() const
This is the line where the image was placed into the output mosaic.
PvlObject imagePositions()
Accessor for the placed images and their locations.
void SetLowSaturationFlag(bool placeLowSatPixels)
When true, low saturation (LRS, LIS) will be considered valid data for the purposes of placing pixels...
int m_osb
The starting band within the output cube.
Buffer for containing a two dimensional section of an image.
Definition: Portal.h:52
Isis::Cube * SetOutputCube(const QString &psParameter)
Opens an output cube specified by the user.
void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue)
Set the keyword/value to use for comparing when using band priority.
bool m_enforceBandBinMatch
True/False value to determine whether to enforce the input cube bandbin matches the mosaic bandbin gr...
int GetOriginDefaultByPixelType()
This method returns the defaults(unassigned origin value) depending on the pixel type.
int m_ins
The number of samples from the input cube.
Cube * m_trackingCube
Output tracking cube. NULL unless tracking is enabled.
int m_inl
The number of lines from the input cube.
ImageOverlay
Enumeration for different Mosaic priorities (input, mosaic, band)
bool GetLowSaturationFlag() const
static QString OverlayToString(ImageOverlay)
Convert an ImageOverlay to a QString.
void BandComparison(int iss, int isl, int ins, int inl, int bandPriorityInputBandNumber, int bandPriorityOutputBandNumber, int index)
This method compares the specified band of the input and output using the criteria (lesser or greater...
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time...
Definition: Process.h:228
int m_onb
The number of bands in the output cube.
void SetBandNumber(int bandPriorityBandNumber)
Set the band to use for priorities when using band priority.
int GetInputStartBandInMosaic() const
This is the band where the image was placed into the output mosaic.
void MatchDEMShapeModel()
Match the Shape Model for input and mosaic.
void BandPriorityWithNoTracking(int iss, int isl, int isb, int ins, int inl, int inb, int bandPriorityInputBandNumber, int bandPriorityOutputBandNumber)
Mosaicking for Band Priority with no Tracking.
virtual Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition: Process.cpp:243
int m_oss
The starting sample within the output cube.
void MatchBandBinGroup(int origIsb, int &inb)
This method matches the input BandBin group to the mosaic BandBin Group and allows band to be replace...
bool m_enforceMatchDEM
DEM of the input and mosaic should match.
int GetInputStartSampleInMosaic() const
This is the sample where the image was placed into the output mosaic.
int m_osl
The starting line within the output cube.
bool GetHighSaturationFlag() const
void SetMatchDEM(bool matchDEM)
Set the DEM match flag.
static ImageOverlay StringToOverlay(QString)
Convert a QString to an ImageOverlay (case-insensitive).
virtual ~ProcessMosaic()
Destroys the Mosaic object. It will close all opened cubes.
int m_iss
The starting sample within the input cube.
ProcessMosaic()
ProcessMosaic Contructor.
void SetBandUseMaxValue(bool useMax)
Set whether to take the image with the max or min value when using band priority. ...
Mosaic two cubes together.
virtual Isis::Cube * SetInputCube(const QString &parameter, const int ss, const int sl, const int sb, const int ns, const int nl, const int nb)
Opens an input cube specified by the user.
PvlObject m_imagePositions
List of images placed on the mosaic.
void SetCreateFlag(bool createOutputMosaic)
Flag to indicate that the mosaic is being newly created Indication that the new label specific to the...
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool GetTrackFlag() const
virtual void StartProcess(const int &piOutSample, const int &piOutLine, const int &piOutBand)
This method invokes the process by mosaic operation over a single input cube and single output cube...
static const char * TRACKING_TABLE_NAME
This is the name of the table in the Cube which will contain the image file names.
void AddDefaultBandBinGroup()
AddDefaultBandBinGroup.
int m_isb
The starting band within the input cube.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
void AddBandBinGroup(int origIsb)
This method adds the BandBin group to the mosaic corresponding to the actual bands in the mosaic...
Base class for all cube processing derivatives.
Definition: Process.h:158
bool GetNullFlag() const
int GetBandIndex(bool inputFile)
Get the Band Index in an image of type (input/output)
int m_isl
The starting line within the input cube.
IO Handler for Isis Cubes.
Definition: Cube.h:170