Isis Developer Reference
ProcessMosaic.h
Go to the documentation of this file.
1 #ifndef ProcessMosaic_h
2 #define ProcessMosaic_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "Process.h"
10 
11 namespace Isis {
12  class Portal;
13 
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  // Finish with tracking cube
227  virtual void EndProcess();
228 
229  // Accessor for the placed images.
231 
232  using Process::SetInputCube;
233 
234  // Set input cube to specified image name at the starting and count of
235  // samples, lines, bands
236  virtual Isis::Cube *SetInputCube(const QString &parameter,
237  const int ss, const int sl,
238  const int sb,
239  const int ns, const int nl,
240  const int nb);
241 
242  // Set input cube to specified image name with specified attributes at the
243  // starting and count of samples, lines, bands
244  virtual Isis::Cube *SetInputCube(const QString &fname,
246  const int ss = 1, const int sl = 1,
247  const int sb = 1,
248  const int ns = -1, const int nl = -1,
249  const int nb = -1);
250 
251  // SetOutputCube() is not virtual in the Process class, so the following
252  // definitions for this method are the only ones that are allowed for
253  // ProcessMosaic objects and child objects, unless redifined in the
254  // child class
255  Isis::Cube *SetOutputCube(const QString &psParameter);
256  Isis::Cube *SetOutputCube(const QString &psParameter, UserInterface &ui);
257 
258  void SetBandBinMatch(bool enforceBandBinMatch);
259 
260  void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue);
261  void SetBandNumber(int bandPriorityBandNumber);
262  void SetBandUseMaxValue(bool useMax);
263  void SetCreateFlag(bool createOutputMosaic);
264  void SetHighSaturationFlag(bool placeHighSatPixels);
265  void SetImageOverlay(ImageOverlay placement);
266  void SetLowSaturationFlag(bool placeLowSatPixels);
267  void SetMatchDEM(bool matchDEM);
268  void SetNullFlag(bool placeNullPixels);
269  void SetTrackFlag(bool trackingEnabled);
270 
271  bool GetHighSaturationFlag() const;
273  bool GetLowSaturationFlag() const;
274  bool GetNullFlag() const;
275  bool GetTrackFlag() const;
276 
277  int GetInputStartLineInMosaic() const;
278  int GetInputStartSampleInMosaic() const;
279  int GetInputStartBandInMosaic() const;
280 
281  static QString OverlayToString(ImageOverlay);
282  static ImageOverlay StringToOverlay(QString);
283 
284  private:
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 ins, int inl,
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  // New mosaic, add the Band Bin group specific to the mosaic
308  void AddBandBinGroup(int origIsb);
309 
310  // Default BandBin group if Match BandBin is set to False
311  void AddDefaultBandBinGroup();
312 
313  // Mosaic exists, match the band with the input image
314  void MatchBandBinGroup(int origIsb, int &inb);
315 
316  bool ProcessAveragePriority(int piPixel, Portal& pInPortal, Portal& pOutPortal,
317  Portal& pOrigPortal);
318 
319  void ResetCountBands();
320 
321  // Match DEM between Input & Mosaic if MatchDEM Flag is enabled
322  void MatchDEMShapeModel();
323 
324  bool m_trackingEnabled;
325  Cube *m_trackingCube;
326  bool m_createOutputMosaic;
327  int m_bandPriorityBandNumber;
328  QString m_bandPriorityKeyName;
329  QString m_bandPriorityKeyValue;
330  bool m_bandPriorityUseMaxValue;
331 
332 
333  int m_iss;
334  int m_isl;
335  int m_isb;
336  int m_ins;
337  int m_inl;
338  int m_inb;
339 
340  int m_oss;
341  int m_osl;
342  int m_osb;
343  int m_onb;
344 
345  bool m_enforceBandBinMatch;
349  bool m_enforceMatchDEM;
350 
351  ImageOverlay m_imageOverlay;
352 
353  PvlObject m_imagePositions;
354 
355  /*
356  * Set the Special Pixels Flags to True/False.
357  * True- allow the special pixel to be passed onto the mosaic.
358  * Holds good for input and band priority
359  */
360  bool m_placeHighSatPixels;
361  bool m_placeLowSatPixels;
362  bool m_placeNullPixels;
363  };
364 };
365 
366 #endif
Isis::SizeOf
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
Definition: PixelType.h:46
Isis::ProcessMosaic::SetBandNumber
void SetBandNumber(int bandPriorityBandNumber)
Set the band to use for priorities when using band priority.
Definition: ProcessMosaic.cpp:749
Table.h
Portal.h
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::ProcessMosaic::FLOAT_STORE_INT_PRECISELY_MAX_VALUE
static const int FLOAT_STORE_INT_PRECISELY_MAX_VALUE
Definition: ProcessMosaic.h:200
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::ProcessMosaic::ImageOverlay
ImageOverlay
Enumeration for different Mosaic priorities (input, mosaic, band)
Definition: ProcessMosaic.h:207
Isis::trackingTableName
const QString trackingTableName
Definition: TrackingTable.h:19
Isis::Portal
Buffer for containing a two dimensional section of an image.
Definition: Portal.h:36
Isis::ProcessMosaic::NumImageOverlayOptions
@ NumImageOverlayOptions
Definition: ProcessMosaic.h:212
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::ProcessMosaic::ProcessMosaic
ProcessMosaic()
ProcessMosaic Contructor.
Definition: ProcessMosaic.cpp:33
Isis::ProcessMosaic::SetBandUseMaxValue
void SetBandUseMaxValue(bool useMax)
Set whether to take the image with the max or min value when using band priority.
Definition: ProcessMosaic.cpp:758
Isis::ProcessMosaic::SetBandBinMatch
void SetBandBinMatch(bool enforceBandBinMatch)
Definition: ProcessMosaic.cpp:732
Isis::ProcessMosaic::SetHighSaturationFlag
void SetHighSaturationFlag(bool placeHighSatPixels)
When true, high saturation (HRS, HIS) will be considered valid data for the purposes of placing pixel...
Definition: ProcessMosaic.cpp:780
Isis::PvlContainer::addKeyword
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Definition: PvlContainer.cpp:202
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ProcessMosaic::EndProcess
virtual void EndProcess()
Cleans up by closing input, output and tracking cubes.
Definition: ProcessMosaic.cpp:517
Process.h
Isis::ProcessMosaic::SetMatchDEM
void SetMatchDEM(bool matchDEM)
Set the DEM match flag.
Definition: ProcessMosaic.cpp:802
Isis::ProcessMosaic::AverageImageWithMosaic
@ AverageImageWithMosaic
average priority
Definition: ProcessMosaic.h:211
Isis::IsNullPixel
bool IsNullPixel(const double d)
Returns if the input pixel is null.
Definition: SpecialPixel.h:235
Isis::ProcessMosaic::SetNullFlag
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:811
Isis::ProcessMosaic::UseBandPlacementCriteria
@ UseBandPlacementCriteria
band priority
Definition: ProcessMosaic.h:210
IsisAml::GetFileName
QString GetFileName(const QString &paramName, QString extension="") const
Allows the retrieval of a value for a parameter of type "filename".
Definition: IsisAml.cpp:607
Isis::Process
Base class for all cube processing derivatives.
Definition: Process.h:143
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::TrackingTable::fileNameToPixel
unsigned int fileNameToPixel(FileName file, QString serialNumber)
Returns the pixel value of the filename/serialnumber combination.
Definition: TrackingTable.cpp:150
Isis::NULL1
const unsigned char NULL1
Definition: SpecialPixel.h:182
Preference.h
Isis::Process::StartProcess
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time.
Definition: Process.h:213
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
IString.h
TrackingTable.h
Isis::IsHighPixel
bool IsHighPixel(const double d)
Returns if the input pixel is one of the high saturation types.
Definition: SpecialPixel.h:247
Isis::ProcessMosaic::SetCreateFlag
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:771
Isis::ProcessMosaic::imagePositions
PvlObject imagePositions()
Accessor for the placed images and their locations.
Definition: ProcessMosaic.cpp:532
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::ProcessMosaic::PlaceImagesBeneath
@ PlaceImagesBeneath
beneath priority
Definition: ProcessMosaic.h:209
Isis::ProcessMosaic::TRACKING_TABLE_NAME
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
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::ProcessMosaic::SetInputCube
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:136
Pvl.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::ProcessMosaic::StartProcess
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:106
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Application.h
Isis::ProcessMosaic::SetOutputCube
Isis::Cube * SetOutputCube(const QString &psParameter)
Opens an output cube specified by the user.
Definition: ProcessMosaic.cpp:692
Isis::Process::SetInputCube
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:136
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::TrackingTable::toTable
Table toTable()
Constrcts and returns a Table object based on values in m_fileList.
Definition: TrackingTable.cpp:69
Isis::ProcessMosaic::PlaceImagesOnTop
@ PlaceImagesOnTop
ontop priority
Definition: ProcessMosaic.h:208
Isis::ProcessMosaic::GetImageOverlay
ImageOverlay GetImageOverlay() const
Definition: ProcessMosaic.cpp:832
Isis::ProcessMosaic::SetBandKeyword
void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue)
Set the keyword/value to use for comparing when using band priority.
Definition: ProcessMosaic.cpp:740
Isis::ProcessMosaic::StringToOverlay
static ImageOverlay StringToOverlay(QString)
Convert a QString to an ImageOverlay (case-insensitive).
Definition: ProcessMosaic.cpp:927
Isis::TrackingTable
Table to store tracking information for a mosaic.
Definition: TrackingTable.h:37
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::NULL2
const short NULL2
Definition: SpecialPixel.h:154
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::PvlKeyword::setValue
void setValue(QString value, QString unit="")
Sets new values.
Definition: PvlKeyword.cpp:155
Isis::ProcessMosaic::~ProcessMosaic
virtual ~ProcessMosaic()
Destroys the Mosaic object. It will close all opened cubes.
Definition: ProcessMosaic.cpp:71
Isis::ProcessMosaic::SetTrackFlag
void SetTrackFlag(bool trackingEnabled)
Definition: ProcessMosaic.cpp:816
Isis::VALID_MINUI4
const unsigned int VALID_MINUI4
Definition: SpecialPixel.h:171
Isis::FileName::removeExtension
FileName removeExtension() const
Removes all extensions in the file name.
Definition: FileName.cpp:246
Isis::ProcessMosaic::GetLowSaturationFlag
bool GetLowSaturationFlag() const
Definition: ProcessMosaic.cpp:840
Isis::UnsignedInteger
@ UnsignedInteger
Definition: PixelType.h:33
IException.h
std
Namespace for the standard library.
Isis::IsValidPixel
bool IsValidPixel(const double d)
Returns if the input pixel is valid.
Definition: SpecialPixel.h:223
Isis::UserInterface
Command Line and Xml loader, validation, and access.
Definition: UserInterface.h:140
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::INULL4
const int INULL4
Definition: SpecialPixel.h:133
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
Isis::Buffer::size
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
Isis::Cube::setPixelType
void setPixelType(PixelType pixelType)
Used prior to the Create method, this will specify the output pixel type.
Definition: Cube.cpp:1304
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
Isis::ProcessMosaic::GetTrackFlag
bool GetTrackFlag() const
Definition: ProcessMosaic.cpp:856
Isis::ProcessMosaic::GetInputStartLineInMosaic
int GetInputStartLineInMosaic() const
This is the line where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:864
Isis::ProcessMosaic::GetInputStartSampleInMosaic
int GetInputStartSampleInMosaic() const
This is the sample where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:872
Isis::IsLowPixel
bool IsLowPixel(const double d)
Returns if the input pixel is one of the low saturation types.
Definition: SpecialPixel.h:259
Isis::ProcessMosaic
Mosaic two cubes together.
Definition: ProcessMosaic.h:194
Isis::ProcessMosaic::GetHighSaturationFlag
bool GetHighSaturationFlag() const
Definition: ProcessMosaic.cpp:824
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
SerialNumber.h
Isis::ProcessMosaic::SetImageOverlay
void SetImageOverlay(ImageOverlay placement)
Definition: ProcessMosaic.cpp:785
Isis::Portal::SetPosition
void SetPosition(const double sample, const double line, const int band)
Sets the line and sample position of the buffer.
Definition: Portal.h:93
Isis::ProcessMosaic::GetNullFlag
bool GetNullFlag() const
Definition: ProcessMosaic.cpp:848
Isis::ProcessMosaic::SetLowSaturationFlag
void SetLowSaturationFlag(bool placeLowSatPixels)
When true, low saturation (LRS, LIS) will be considered valid data for the purposes of placing pixels...
Definition: ProcessMosaic.cpp:794
Isis::ProcessMosaic::OverlayToString
static QString OverlayToString(ImageOverlay)
Convert an ImageOverlay to a QString.
Definition: ProcessMosaic.cpp:889
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
ProcessMosaic.h
Isis::ProcessMosaic::GetInputStartBandInMosaic
int GetInputStartBandInMosaic() const
This is the band where the image was placed into the output mosaic.
Definition: ProcessMosaic.cpp:880
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProcessMosaic::FLOAT_STORE_INT_PRECISELY_MIN_VALUE
static const int FLOAT_STORE_INT_PRECISELY_MIN_VALUE
Definition: ProcessMosaic.h:201