Isis 3.0
Back | Home
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 
194  class ProcessMosaic : public Process {
195 
196  public:
197  static const char *TRACKING_TABLE_NAME;
198 
199  // see http://blog.stata.com/tag/binary/
200  static const int FLOAT_STORE_INT_PRECISELY_MAX_VALUE = 16777216;
201  static const int FLOAT_STORE_INT_PRECISELY_MIN_VALUE = -16777215;
202 
213  };
214 
215  // Constructs a Mosaic object
216  ProcessMosaic();
217 
218  // Destroys the Mosaic object. It will close all opened cubes.
219  virtual ~ProcessMosaic();
220 
221  using Isis::Process::StartProcess; // make parent funtions visable
222 
223  // Line Processing method for one input and output cube
224  virtual void StartProcess(const int &piOutSample, const int &piOutLine, const int &piOutBand);
225 
226  // Accessor for the placed images.
228 
229  using Process::SetInputCube;
230 
231  // Set input cube to specified image name at the starting and count of
232  // samples, lines, bands
233  virtual Isis::Cube *SetInputCube(const QString &parameter,
234  const int ss, const int sl,
235  const int sb,
236  const int ns, const int nl,
237  const int nb);
238 
239  // Set input cube to specified image name with specified attributes at the
240  // starting and count of samples, lines, bands
241  virtual Isis::Cube *SetInputCube(const QString &fname,
243  const int ss = 1, const int sl = 1,
244  const int sb = 1,
245  const int ns = -1, const int nl = -1,
246  const int nb = -1);
247 
248  // SetOutputCube() is not virtual in the Process class, so the following
249  // definitions for this method are the only ones that are allowed for
250  // ProcessMosaic objects and child objects, unless redifined in the
251  // child class
252  Isis::Cube *SetOutputCube(const QString &psParameter);
253 
254  void SetBandBinMatch(bool enforceBandBinMatch);
255  void SetMosaicOrigin(int &piIndex);
256 
257 
258  void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue);
259  void SetBandNumber(int bandPriorityBandNumber);
260  void SetBandUseMaxValue(bool useMax);
261  void SetCreateFlag(bool createOutputMosaic);
262  void SetHighSaturationFlag(bool placeHighSatPixels);
263  void SetImageOverlay(ImageOverlay placement);
264  void SetLowSaturationFlag(bool placeLowSatPixels);
265  void SetMatchDEM(bool matchDEM);
266  void SetNullFlag(bool placeNullPixels);
267  void SetTrackFlag(bool trackingEnabled);
268 
269  bool GetHighSaturationFlag() const;
271  bool GetLowSaturationFlag() const;
272  bool GetNullFlag() const;
273  bool GetTrackFlag() const;
274 
275  int GetInputStartLineInMosaic() const;
276  int GetInputStartSampleInMosaic() const;
277  int GetInputStartBandInMosaic() const;
278 
279  static QString OverlayToString(ImageOverlay);
280  static ImageOverlay StringToOverlay(QString);
281 
282  private:
283  // Get the file index offset to be saved in the band by pixel type
284  int GetIndexOffsetByPixelType();
285 
286  //Compare the input and mosaic for the specified band based on the criteria and update the
287  // mosaic origin band.
288  void BandComparison(int iss, int isl, int isb, int ins, int inl, int inb,
289  int bandPriorityInputBandNumber, int bandPriorityOutputBandNumber,
290  int index);
291 
292  // Mosaicking for Band Priority with no Tracking
293  void BandPriorityWithNoTracking(int iss, int isl, int isb,
294  int ins, int inl, int inb,
295  int bandPriorityInputBandNumber,
296  int bandPriorityOutputBandNumber);
297 
298  // Get the default origin value based on pixel type for the origin band
299  int GetOriginDefaultByPixelType();
300 
301  // Get the Band Index in an image of type (input/output)
302  int GetBandIndex(bool inputFile);
303 
304  // Checks for the table with name "InputImage"
305  bool GetTrackStatus();
306 
307  // Reset the origin band
308  void ResetOriginBand();
309 
310  // New mosaic, add the Band Bin group specific to the mosaic
311  void AddBandBinGroup(int origIsb);
312 
313  // Default BandBin group if Match BandBin is set to False
314  void AddDefaultBandBinGroup();
315 
316  // Mosaic exists, match the band with the input image
317  void MatchBandBinGroup(int origIsb, int &inb);
318 
319  bool ProcessAveragePriority(int piPixel, Portal& pInPortal, Portal& pOutPortal,
320  Portal& pOrigPortal);
321 
322  void ResetCountBands();
323 
324  // Match DEM between Input & Mosaic if MatchDEM Flag is enabled
325  void MatchDEMShapeModel();
326 
327  bool m_trackingEnabled;
328  bool m_createOutputMosaic;
329  int m_bandPriorityBandNumber;
330  QString m_bandPriorityKeyName;
331  QString m_bandPriorityKeyValue;
332  bool m_bandPriorityUseMaxValue;
333 
334 
335  int m_iss;
336  int m_isl;
337  int m_isb;
338  int m_ins;
339  int m_inl;
340  int m_inb;
341 
342  int m_oss;
343  int m_osl;
344  int m_osb;
345  int m_onb;
346 
347  bool m_enforceBandBinMatch;
351  bool m_enforceMatchDEM;
352 
353  ImageOverlay m_imageOverlay;
354 
355  PvlObject m_imagePositions;
356 
357  /*
358  * Set the Special Pixels Flags to True/False.
359  * True- allow the special pixel to be passed onto the mosaic.
360  * Holds good for input and band priority
361  */
362  bool m_placeHighSatPixels;
363  bool m_placeLowSatPixels;
364  bool m_placeNullPixels;
365  };
366 };
367 
368 #endif
static const int FLOAT_STORE_INT_PRECISELY_MIN_VALUE
Definition: ProcessMosaic.h:201
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:395
bool GetHighSaturationFlag() const
Definition: ProcessMosaic.cpp:915
void SetNullFlag(bool placeNullPixels)
When true, Null pixels will be considered valid data for the purposes of placing pixels in the output...
Definition: ProcessMosaic.cpp:902
void SetHighSaturationFlag(bool placeHighSatPixels)
When true, high saturation (HRS, HIS) will be considered valid data for the purposes of placing pixel...
Definition: ProcessMosaic.cpp:871
average priority
Definition: ProcessMosaic.h:211
bool GetNullFlag() const
Definition: ProcessMosaic.cpp:939
void SetImageOverlay(ImageOverlay placement)
Definition: ProcessMosaic.cpp:876
PvlObject imagePositions()
Accessor for the placed images and their locations.
Definition: ProcessMosaic.cpp:436
void SetLowSaturationFlag(bool placeLowSatPixels)
When true, low saturation (LRS, LIS) will be considered valid data for the purposes of placing pixels...
Definition: ProcessMosaic.cpp:885
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.
Definition: ProcessMosaic.cpp:596
void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue)
Set the keyword/value to use for comparing when using band priority.
Definition: ProcessMosaic.cpp:831
band priority
Definition: ProcessMosaic.h:210
ImageOverlay
Enumeration for different Mosaic priorities (input, mosaic, band)
Definition: ProcessMosaic.h:207
int GetInputStartBandInMosaic() const
This is the band where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:971
static QString OverlayToString(ImageOverlay)
Convert an ImageOverlay to a QString.
Definition: ProcessMosaic.cpp:980
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time...
Definition: Process.h:227
static const int FLOAT_STORE_INT_PRECISELY_MAX_VALUE
Definition: ProcessMosaic.h:200
void SetBandNumber(int bandPriorityBandNumber)
Set the band to use for priorities when using band priority.
Definition: ProcessMosaic.cpp:840
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 GetInputStartLineInMosaic() const
This is the line where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:955
void SetTrackFlag(bool trackingEnabled)
Definition: ProcessMosaic.cpp:907
bool GetTrackFlag() const
Definition: ProcessMosaic.cpp:947
Definition: ProcessMosaic.h:212
bool GetLowSaturationFlag() const
Definition: ProcessMosaic.cpp:931
void SetMatchDEM(bool matchDEM)
Set the DEM match flag.
Definition: ProcessMosaic.cpp:893
static ImageOverlay StringToOverlay(QString)
Convert a QString to an ImageOverlay (case-insensitive).
Definition: ProcessMosaic.cpp:1018
virtual ~ProcessMosaic()
Destroys the Mosaic object. It will close all opened cubes.
Definition: ProcessMosaic.cpp:84
beneath priority
Definition: ProcessMosaic.h:209
ProcessMosaic()
ProcessMosaic Contructor.
Definition: ProcessMosaic.cpp:47
ImageOverlay GetImageOverlay() const
Definition: ProcessMosaic.cpp:923
void SetBandUseMaxValue(bool useMax)
Set whether to take the image with the max or min value when using band priority. ...
Definition: ProcessMosaic.cpp:849
void SetMosaicOrigin(int &piIndex)
This method creates a table if not already created to hold the image file names if the track flag is ...
Definition: ProcessMosaic.cpp:657
Mosaic two cubes together.
Definition: ProcessMosaic.h:194
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.
Definition: ProcessMosaic.cpp:478
void SetCreateFlag(bool createOutputMosaic)
Flag to indicate that the mosaic is being newly created Indication that the new label specific to the...
Definition: ProcessMosaic.cpp:862
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...
Definition: ProcessMosaic.cpp:114
static const char * TRACKING_TABLE_NAME
This is the name of the table in the Cube which will contain the image file names.
Definition: ProcessMosaic.h:197
void SetBandBinMatch(bool enforceBandBinMatch)
Definition: ProcessMosaic.cpp:632
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
ontop priority
Definition: ProcessMosaic.h:208
Base class for all cube processing derivatives.
Definition: Process.h:157
int GetInputStartSampleInMosaic() const
This is the sample where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:963
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:26:15