Isis 3 Programmer Reference
ProcessMosaic.h
1#ifndef ProcessMosaic_h
2#define ProcessMosaic_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Process.h"
10
11namespace 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
214
215 // Constructs a Mosaic object
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
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;
272 ImageOverlay GetImageOverlay() 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
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
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;
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
350
351 ImageOverlay m_imageOverlay;
352
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
Manipulate and parse attributes of input cube filenames.
IO Handler for Isis Cubes.
Definition Cube.h:168
Buffer for containing a two dimensional section of an image.
Definition Portal.h:36
Base class for all cube processing derivatives.
Definition Process.h:143
virtual void StartProcess(void funct())
In the base class, this method will invoked a user-specified function exactly one time.
Definition Process.h:213
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:139
Mosaic two cubes together.
void SetMatchDEM(bool matchDEM)
Set the DEM match flag.
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 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.
bool m_enforceMatchDEM
DEM of the input and mosaic should match.
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...
bool GetLowSaturationFlag() const
int m_onb
The number of bands in the output cube.
int m_isl
The starting line within the input cube.
Isis::Cube * SetOutputCube(const QString &psParameter)
Opens an output cube specified by the user.
ImageOverlay
Enumeration for different Mosaic priorities (input, mosaic, band)
@ PlaceImagesOnTop
ontop priority
@ UseBandPlacementCriteria
band priority
@ PlaceImagesBeneath
beneath priority
@ AverageImageWithMosaic
average priority
bool GetTrackFlag() const
int m_oss
The starting sample within the output cube.
virtual ~ProcessMosaic()
Destroys the Mosaic object. It will close all opened cubes.
bool GetHighSaturationFlag() const
int GetInputStartLineInMosaic() const
This is the line where the image was placed into the output mosaic.
void SetLowSaturationFlag(bool placeLowSatPixels)
When true, low saturation (LRS, LIS) will be considered valid data for the purposes of placing pixels...
int m_isb
The starting band within the input cube.
virtual void EndProcess()
Cleans up by closing input, output and tracking cubes.
int m_iss
The starting sample within the input cube.
void SetHighSaturationFlag(bool placeHighSatPixels)
When true, high saturation (HRS, HIS) will be considered valid data for the purposes of placing pixel...
static ImageOverlay StringToOverlay(QString)
Convert a QString to an ImageOverlay (case-insensitive).
PvlObject imagePositions()
Accessor for the placed images and their locations.
int m_ins
The number of samples from the input cube.
Cube * m_trackingCube
Output tracking cube. NULL unless tracking is enabled.
void SetCreateFlag(bool createOutputMosaic)
Flag to indicate that the mosaic is being newly created Indication that the new label specific to the...
int m_inl
The number of lines from the input cube.
static QString OverlayToString(ImageOverlay)
Convert an ImageOverlay to a QString.
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.
bool GetTrackStatus()
This method searchs the mosaic label for a table with name "InputFile".
int m_inb
The number of bands from the input cube.
void SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue)
Set the keyword/value to use for comparing when using band priority.
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.
void AddDefaultBandBinGroup()
AddDefaultBandBinGroup.
static const char * TRACKING_TABLE_NAME
This is the name of the table in the Cube which will contain the image file names.
int m_osb
The starting band within the output cube.
ProcessMosaic()
ProcessMosaic Contructor.
void MatchBandBinGroup(int origIsb, int &inb)
This method matches the input BandBin group to the mosaic BandBin Group and allows band to be replace...
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.
int GetBandIndex(bool inputFile)
Get the Band Index in an image of type (input/output)
void SetBandUseMaxValue(bool useMax)
Set whether to take the image with the max or min value when using band priority.
void SetNullFlag(bool placeNullPixels)
When true, Null pixels will be considered valid data for the purposes of placing pixels in the output...
int GetOriginDefaultByPixelType()
This method returns the defaults(unassigned origin value) depending on the pixel type.
int GetInputStartSampleInMosaic() const
This is the sample where the image was placed into the output mosaic.
void ResetCountBands()
Reset all the count bands to default at the time of mosaic creation.
void AddBandBinGroup(int origIsb)
This method adds the BandBin group to the mosaic corresponding to the actual bands in the mosaic.
bool m_enforceBandBinMatch
True/False value to determine whether to enforce the input cube bandbin matches the mosaic bandbin gr...
PvlObject m_imagePositions
List of images placed on the mosaic.
int m_osl
The starting line within the output cube.
void MatchDEMShapeModel()
Match the Shape Model for input and mosaic.
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
Command Line and Xml loader, validation, and access.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16