Isis 3 Programmer Reference
ProcessMosaic.cpp
1 
6 /* SPDX-License-Identifier: CC0-1.0 */
7 #include "Preference.h"
8 
9 #include "Application.h"
10 #include "IException.h"
11 #include "IString.h"
12 #include "Portal.h"
13 #include "ProcessMosaic.h"
14 #include "Pvl.h"
15 #include "SerialNumber.h"
16 #include "SpecialPixel.h"
17 #include "Table.h"
18 #include "TrackingTable.h"
19 
20 using namespace std;
21 
22 namespace Isis {
26  const char *ProcessMosaic::TRACKING_TABLE_NAME = "InputImages";
27 
33  ProcessMosaic::ProcessMosaic() {
34  // Set the BandBin Match
35  SetBandBinMatch(true);
36 
37  // Initialize the structure Track Info
38  m_trackingEnabled = false;
39  m_trackingCube = NULL;
40  m_createOutputMosaic = false;
41  m_bandPriorityBandNumber = 0;
42  m_bandPriorityKeyName = "";
43  m_bandPriorityKeyValue = "";
44  m_bandPriorityUseMaxValue = false;
45 
46  // Initialize the Special Pixel Flags
47  m_placeHighSatPixels = false;
48  m_placeLowSatPixels = false;
49  m_placeNullPixels = false;
50 
51  // Default Priority OnTop
52  m_imageOverlay = PlaceImagesOnTop;
53 
54  m_enforceMatchDEM = false;
55 
56  // Initialize the data members
57  m_iss = -1;
58  m_isl = -1;
59  m_isb = -1;
60  m_ins = -1;
61  m_inl = -1;
62  m_inb = -1;
63  m_oss = -1;
64  m_osl = -1;
65  m_osb = -1;
66  m_onb = -1;
67  }
68 
69 
71  ProcessMosaic::~ProcessMosaic() {
72  if (m_trackingCube) {
73  m_trackingCube->close();
74  delete m_trackingCube;
75  m_trackingCube = NULL;
76  }
77  }
78 
79 
106  void ProcessMosaic::StartProcess(const int &os, const int &ol, const int &ob) {
107  // Error checks ... there must be one input and one output
108  if ((OutputCubes.size() != 1) || (InputCubes.size() != 1)) {
109  QString m = "You must specify exactly one input and one output cube";
110  throw IException(IException::Programmer, m, _FILEINFO_);
111  }
112 
113  bool bTrackExists = false;
114  if (!m_createOutputMosaic) {
115  bTrackExists = GetTrackStatus();
116  if (m_trackingEnabled &&
117  !(OutputCubes[0]->hasGroup("Tracking") || OutputCubes[0]->hasTable("InputImages"))) {
118  QString m = "Cannot enable tracking while adding to a mosaic without tracking ";
119  m += "information. Confirm that your mosaic was originally created with tracking enabled.";
120  throw IException(IException::User, m, _FILEINFO_);
121  }
122  }
123 
124  int ins = m_ins;
125  int inl = m_inl;
126  int inb = m_inb;
127  int iss = m_iss;
128  int isl = m_isl;
129  int isb = m_isb;
130 
131  if (ins == -1)
132  ins = (int)InputCubes[0]->sampleCount();
133 
134  if (inl == -1)
135  inl = (int)InputCubes[0]->lineCount();
136 
137  if (inb == -1)
138  inb = (int)InputCubes[0]->bandCount();
139 
140  // Adjust the input sub-area if it overlaps any edge of the output cube
141  m_oss = os;
142  m_osl = ol;
143  m_osb = ob;
144 
145  // Left edge
146  if (m_oss < 1) {
147  iss = iss - m_oss + 1;
148  ins = ins + m_oss - 1;
149  m_oss = 1;
150  }
151  // Top edge
152  if (m_osl < 1) {
153  isl = isl - m_osl + 1;
154  inl = inl + m_osl - 1;
155  m_osl = 1;
156  }
157  // Right edge
158  if ((m_oss + ins - 1) > OutputCubes[0]->sampleCount()) {
159  ins = OutputCubes[0]->sampleCount() - m_oss + 1;
160  }
161  // Bottom edge
162  if ((m_osl + inl - 1) > OutputCubes[0]->lineCount()) {
163  inl = OutputCubes[0]->lineCount() - m_osl + 1;
164  }
165 
166  PvlGroup imgPosition("ImageLocation");
167  imgPosition += PvlKeyword("File", InputCubes[0]->fileName());
168  imgPosition += PvlKeyword("StartSample", toString(m_oss));
169  imgPosition += PvlKeyword("StartLine", toString(m_osl));
170  m_imagePositions += imgPosition;
171 
172  // Tests for completly off the mosaic
173  if ((ins < 1) || (inl < 1)) {
174  QString m = "The input cube does not overlap the mosaic";
175  throw IException(IException::User, m, _FILEINFO_);
176  }
177 
178  // Band Adjustments
179  if (m_osb < 1) {
180  isb = isb - m_osb + 1;
181  inb = inb + m_osb - 1;
182  m_osb = 1;
183  }
184 
185  p_progress->SetMaximumSteps(
186  (int)InputCubes[0]->lineCount() * (int)InputCubes[0]->bandCount());
187  p_progress->CheckStatus();
188 
189  // Tracking is done for:
190  // (1) Band priority,
191  // (2) Ontop and Beneath priority with number of bands equal to 1,
192  // (3) Ontop priority with all the special pixel flags set to true. (All special pixel flags
193  // must be set to true in order to handle multiple bands since we need to force pixels
194  // from all bands in a single image to be copied to the mosaic with ontop priority so we
195  // don't have multiple input bands to track for any single pixel in our tracking band.)
196  if (m_trackingEnabled) {
197  if (!(m_imageOverlay == UseBandPlacementCriteria ||
198  ((m_imageOverlay == PlaceImagesOnTop || m_imageOverlay == PlaceImagesBeneath) &&
199  // tracking band was already created for Tracking=true
200  (OutputCubes[0]->bandCount()) == 1) ||
201  (m_imageOverlay == PlaceImagesOnTop && m_placeHighSatPixels && m_placeLowSatPixels &&
202  m_placeNullPixels)) ){
203  QString m = "Tracking cannot be True for multi-band Mosaic with ontop or beneath priority";
204  throw IException(IException::Programmer, m, _FILEINFO_);
205  }
206  }
207 
208  // *******************************************************************************
209 
210  Pvl *inLab = InputCubes[0]->label();
211  // Create / Match DEM Shape Model if bMatchDEM Flag is enabled
212  if (m_enforceMatchDEM){
213  MatchDEMShapeModel();
214  }
215 
216  // Check to make sure the bandbins match if necessary
217  if (m_enforceBandBinMatch) {
218  Pvl *outLab = OutputCubes[0]->label();
219 
220  if (inLab->findObject("IsisCube").hasGroup("BandBin")) {
221  // Check to make sure the output cube has a bandbin group & make sure it
222  // matches the input cube bandbin group
223  if (!m_createOutputMosaic && outLab->findObject("IsisCube").hasGroup("BandBin")) {
224  MatchBandBinGroup(isb, inb);
225  }
226  // Otherwise copy the input cube bandbin to the output file
227  else {
228  AddBandBinGroup(isb);
229  }
230  }
231  // BandBin group is not found
232  else {
233  QString m = "Match BandBin cannot be True when the Image does not have the BandBin group";
234  throw IException(IException::Programmer, m, _FILEINFO_);
235  }
236  }
237  // Match BandBin set to false and CREATE and TRACKING is true
238  else {
239  if (m_createOutputMosaic) {
240  if (inLab->findObject("IsisCube").hasGroup("BandBin")) {
241  AddBandBinGroup(isb);
242  }
243  else {
244  AddDefaultBandBinGroup();
245  }
246  }
247  }
248 
249  // Even if the track flag is off, if the track table exists and "TRACKING" exists in bandbin
250  // group continue tracking
251  if (bTrackExists) {
252  m_trackingEnabled = true;
253  }
254 
255  // We don't want to set the filename in the table unless the band info is valid
256  int bandPriorityInputBandNumber = -1;
257  int bandPriorityOutputBandNumber = -1;
258  if (m_imageOverlay == UseBandPlacementCriteria ) {
259  bandPriorityInputBandNumber = GetBandIndex(true);
260  bandPriorityOutputBandNumber = GetBandIndex(false);
261  }
262 
263  // Set index of tracking image to the default offset of the Isis::UnsignedByte
264  int iIndex = VALID_MINUI4;
265  // Propogate tracking if adding to mosaic that was previouly tracked.
266  if (OutputCubes[0]->hasGroup("Tracking") && !m_createOutputMosaic) {
267  m_trackingEnabled = true;
268  }
269 
270  // Create tracking cube if need-be, add bandbin group, and update tracking table. Add tracking
271  // group to mosaic cube.
272  if (m_trackingEnabled) {
273  TrackingTable *trackingTable;
274 
275  if (!m_trackingCube) {
276  m_trackingCube = new Cube;
277 
278  // A new mosaic cube is being created
279  if (m_createOutputMosaic) {
280 
281  // Tracking cubes are always unsigned 4 byte integer
282  m_trackingCube->setPixelType(PixelType::UnsignedInteger);
283 
284  // Tracking cube has the same number of lines and samples as the mosaic and 1 band
285  m_trackingCube->setDimensions(OutputCubes[0]->sampleCount(),
286  OutputCubes[0]->lineCount(),
287  1);
288 
289  // The tracking cube file name convention is "output_cube_file_name" + "_tracking.cub"
290  QString trackingBase = FileName(OutputCubes[0]->fileName()).removeExtension().expanded().split("/").last();//toString();
291  m_trackingCube->create(FileName(OutputCubes[0]->fileName()).path()
292  + "/" + trackingBase + "_tracking.cub");
293 
294  // Add the tracking group to the mosaic cube label
295  Pvl *mosaicLabel = OutputCubes[0]->label();
296  PvlGroup trackingFileGroup("Tracking");
297  PvlKeyword trackingFileName("FileName");
298  trackingFileName.setValue(trackingBase + "_tracking.cub");
299  trackingFileGroup.addKeyword(trackingFileName);
300  mosaicLabel->findObject("IsisCube").addGroup(trackingFileGroup);
301 
302  // Write the bandbin group to the tracking cube label
303  Pvl *trackingLabel = m_trackingCube->label();
304  PvlGroup bandBin("BandBin");
305  PvlKeyword trackBand("FilterName");
306  trackBand += "TRACKING";
307  bandBin.addKeyword(trackBand);
308  trackingLabel->findObject("IsisCube").addGroup(bandBin);
309 
310  // Initialize an empty TrackingTable object to manage tracking table in tracking cube
311  trackingTable = new TrackingTable();
312  }
313 
314  // An existing mosaic cube is being added to
315  else {
316  // Confirm tracking group exists in mosaic cube to address backwards compatibility
317  if ( OutputCubes[0]->hasGroup("Tracking") ) {
318  QString trackingPath = FileName(OutputCubes[0]->fileName()).path();
319  QString trackingFile = OutputCubes[0]->group("Tracking").findKeyword("FileName")[0];
320  m_trackingCube->open(trackingPath + "/" + trackingFile, "rw");
321 
322  // Initialize a TrackingTable object from current mosaic
323  Table *table;
324  try {
325  table = new Table(TRACKING_TABLE_NAME, m_trackingCube->fileName());
326  trackingTable = new TrackingTable(*table);
327  }
328  catch (IException &e) {
329  QString msg = "Unable to find Tracking Table in " + m_trackingCube->fileName() + ".";
330  throw IException(IException::User, msg, _FILEINFO_);
331  }
332  }
333  // If no tracking group exists in mosaic cube, warn user to run utility application to
334  // add it and create a separate tracking cube
335  else {
336  QString msg = "Tracking cannot be enabled when adding to an existing mosaic "
337  "that does not already have a tracking cube. Mosaics with a tracking band must "
338  "have the tracking band extracted into an external tracking cube.";
339  throw IException(IException::User, msg, _FILEINFO_);
340  }
341  }
342 
343  // Add current file to the TrackingTable object
344  iIndex = trackingTable->fileNameToPixel(InputCubes[0]->fileName(),
345  SerialNumber::Compose(*(InputCubes[0])));
346 
347  // Write the tracking table to the tracking cube, overwriting if need-be
348  m_trackingCube->deleteBlob(Isis::trackingTableName, "Table");
349  Table table = trackingTable->toTable();
350  m_trackingCube->write(table);
351  }
352 
353  }
354  else if (m_imageOverlay == AverageImageWithMosaic && m_createOutputMosaic) {
355  ResetCountBands();
356  }
357 
358  m_onb = OutputCubes[0]->bandCount();
359 
360  if (m_trackingEnabled) {
361 
362  // For mosaic creation, the input is copied onto mosaic by default
363  if (m_imageOverlay == UseBandPlacementCriteria && !m_createOutputMosaic) {
364  BandComparison(iss, isl, ins, inl,
365  bandPriorityInputBandNumber, bandPriorityOutputBandNumber, iIndex);
366  }
367  }
368  else if (m_imageOverlay == AverageImageWithMosaic) {
369  m_onb /= 2;
370  if (m_onb < 1) {
371  QString msg = "The mosaic cube needs a count band.";
372  throw IException(IException::Unknown, msg, _FILEINFO_);
373  }
374  }
375 
376  // Process Band Priority with no tracking
377  if (m_imageOverlay == UseBandPlacementCriteria && !m_trackingEnabled ) {
378  BandPriorityWithNoTracking(iss, isl, isb, ins, inl, inb, bandPriorityInputBandNumber,
379  bandPriorityOutputBandNumber);
380  }
381  else {
382  // Create portal buffers for the input and output files
383  Portal iPortal(ins, 1, InputCubes[0]->pixelType());
384  Portal oPortal(ins, 1, OutputCubes[0]->pixelType());
385  Portal countPortal(ins, 1, OutputCubes[0]->pixelType());
386  Portal trackingPortal(ins, 1, PixelType::UnsignedInteger);
387 
388  for (int ib = isb, ob = m_osb; ib < (isb + inb) && ob <= m_onb; ib++, ob++) {
389  for (int il = isl, ol = m_osl; il < isl + inl; il++, ol++) {
390  // Set the position of the portals in the input and output cubes
391  iPortal.SetPosition(iss, il, ib);
392  InputCubes[0]->read(iPortal);
393 
394  oPortal.SetPosition(m_oss, ol, ob);
395  OutputCubes[0]->read(oPortal);
396 
397  if (m_trackingEnabled) {
398  trackingPortal.SetPosition(m_oss, ol, 1);
399  m_trackingCube->read(trackingPortal);
400  }
401  else if (m_imageOverlay == AverageImageWithMosaic) {
402  countPortal.SetPosition(m_oss, ol, (ob+m_onb));
403  OutputCubes[0]->read(countPortal);
404  }
405 
406  bool bChanged = false;
407  // Move the input data to the output
408  for (int pixel = 0; pixel < oPortal.size(); pixel++) {
409  // Creating Mosaic, copy the input onto mosaic
410  // regardless of the priority
411  if (m_createOutputMosaic) {
412  oPortal[pixel] = iPortal[pixel];
413  if (m_trackingEnabled) {
414  trackingPortal[pixel] = iIndex;
415  bChanged = true;
416  }
417  else if (m_imageOverlay == AverageImageWithMosaic) {
418  if (IsValidPixel(iPortal[pixel])) {
419  countPortal[pixel]=1;
420  bChanged = true;
421  }
422  }
423  }
424  // Band Priority
425  else if (m_trackingEnabled && m_imageOverlay == UseBandPlacementCriteria) {
426  int iPixelOrigin = qRound(trackingPortal[pixel]);
427 
428  Portal iComparePortal( ins, 1, InputCubes[0]->pixelType() );
429  Portal oComparePortal( ins, 1, OutputCubes[0]->pixelType() );
430  iComparePortal.SetPosition(iss, il, bandPriorityInputBandNumber);
431  InputCubes[0]->read(iComparePortal);
432  oComparePortal.SetPosition(m_oss, ol, bandPriorityOutputBandNumber);
433  OutputCubes[0]->read(oComparePortal);
434 
435  if (iPixelOrigin == iIndex) {
436  if ( ( IsValidPixel(iComparePortal[pixel]) &&
437  IsValidPixel(oComparePortal[pixel]) ) &&
438  ( (!m_bandPriorityUseMaxValue &&
439  iComparePortal[pixel] < oComparePortal[pixel]) ||
440  (m_bandPriorityUseMaxValue &&
441  iComparePortal[pixel] > oComparePortal[pixel]) ) ) {
442 
443  if ( IsValidPixel(iPortal[pixel]) ||
444  ( m_placeHighSatPixels && IsHighPixel(iPortal[pixel]) ) ||
445  ( m_placeLowSatPixels && IsLowPixel (iPortal[pixel]) ) ||
446  ( m_placeNullPixels && IsNullPixel(iPortal[pixel]) ) ){
447  oPortal[pixel] = iPortal[pixel];
448  bChanged = true;
449  }
450  }
451  else { //bad comparison
452  if ( ( IsValidPixel(iPortal[pixel]) && !IsValidPixel(oPortal[pixel]) ) ||
453  ( m_placeHighSatPixels && IsHighPixel(iPortal[pixel]) ) ||
454  ( m_placeLowSatPixels && IsLowPixel (iPortal[pixel]) ) ||
455  ( m_placeNullPixels && IsNullPixel(iPortal[pixel]) ) ) {
456  oPortal[pixel] = iPortal[pixel];
457  bChanged = true;
458  }
459  }
460  }
461  }
462  // OnTop/Input Priority
463  else if (m_imageOverlay == PlaceImagesOnTop) {
464  if (IsNullPixel(oPortal[pixel]) ||
465  IsValidPixel(iPortal[pixel]) ||
466  (m_placeHighSatPixels && IsHighPixel(iPortal[pixel])) ||
467  (m_placeLowSatPixels && IsLowPixel(iPortal[pixel])) ||
468  (m_placeNullPixels && IsNullPixel(iPortal[pixel]))) {
469  oPortal[pixel] = iPortal[pixel];
470  if (m_trackingEnabled) {
471  trackingPortal[pixel] = iIndex;
472  bChanged = true;
473  }
474  }
475  }
476  // AverageImageWithMosaic priority
477  else if (m_imageOverlay == AverageImageWithMosaic) {
478  bChanged |= ProcessAveragePriority(pixel, iPortal, oPortal, countPortal);
479  }
480  // Beneath/Mosaic Priority
481  else if (m_imageOverlay == PlaceImagesBeneath) {
482  if (IsNullPixel(oPortal[pixel])) {
483  oPortal[pixel] = iPortal[pixel];
484  // Set the origin if number of input bands equal to 1
485  // and if the track flag was set
486  if (m_trackingEnabled) {
487  trackingPortal[pixel] = iIndex;
488  bChanged = true;
489  }
490  }
491  }
492  } // End sample loop
493  if (bChanged) {
494  if (m_trackingEnabled) {
495  m_trackingCube->write(trackingPortal);
496  }
497  if (m_imageOverlay == AverageImageWithMosaic) {
498  OutputCubes[0]->write(countPortal);
499  }
500  }
501  OutputCubes[0]->write(oPortal);
502  p_progress->CheckStatus();
503  } // End line loop
504  } // End band loop
505  }
506  if (m_trackingCube) {
507  m_trackingCube->close();
508  delete m_trackingCube;
509  m_trackingCube = NULL;
510  }
511  } // End StartProcess
512 
513 
517  void ProcessMosaic::EndProcess() {
518  if (m_trackingCube) {
519  m_trackingCube->close();
520  delete m_trackingCube;
521  m_trackingCube = NULL;
522  }
523  Process::EndProcess();
524  }
525 
526 
532  PvlObject ProcessMosaic::imagePositions() {
533  return m_imagePositions;
534  }
535 
536 
574  Cube *ProcessMosaic::SetInputCube(const QString &parameter,
575  const int ss, const int sl, const int sb,
576  const int ns, const int nl, const int nb) {
577 
578  // Make sure only one input is active at a time
579  if (InputCubes.size() > 0) {
580  QString m = "You must specify exactly one input cube";
581  throw IException(IException::Programmer, m, _FILEINFO_);
582  }
583 
584  m_iss = ss;
585  m_isl = sl;
586  m_isb = sb;
587  m_ins = ns;
588  m_inl = nl;
589  m_inb = nb;
590 
591  Cube *cInCube = Process::SetInputCube(parameter);
592 
593  //get the output label
594  Pvl *cInPvl = InputCubes[0]->label();
595  if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) {
596  PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands");
597  QString sStr(cBandKey[0]);
598  if (toInt(sStr) < nb) {
599  QString m = "The parameter number of input bands exceeds the actual number of bands in the "
600  "input cube";
601  throw IException(IException::Programmer, m, _FILEINFO_);
602  }
603  }
604  return cInCube;
605  }
606 
607 
644  Cube *ProcessMosaic::SetInputCube(const QString &fname,
645  CubeAttributeInput &att,
646  const int ss, const int sl, const int sb,
647  const int ns, const int nl, const int nb) {
648 
649  // Make sure only one input is active at a time
650  if (InputCubes.size() > 0) {
651  QString m = "You must specify exactly one input cube";
652  throw IException(IException::Programmer, m, _FILEINFO_);
653  }
654 
655  m_iss = ss;
656  m_isl = sl;
657  m_isb = sb;
658  m_ins = ns;
659  m_inl = nl;
660  m_inb = nb;
661 
662  Cube *cInCube = Process::SetInputCube(fname, att);
663 
664  //check if the number of bands specified is not greater than the actual number of bands in the input
665  Pvl *cInPvl = InputCubes[0]->label();
666  if (cInPvl->findGroup("Dimensions", Pvl::Traverse).hasKeyword("Bands")) {
667  PvlKeyword &cBandKey = cInPvl->findGroup("Dimensions", Pvl::Traverse).findKeyword("Bands");
668  QString sStr(cBandKey[0]);
669  if (toInt(sStr) < nb) {
670  QString m = "The parameter number of input bands exceeds the actual number of bands in the input cube";
671  throw IException(IException::Programmer, m, _FILEINFO_);
672  }
673  }
674  return cInCube;
675  }
676 
677 
692  Cube *ProcessMosaic::SetOutputCube(const QString &psParameter) {
693  return SetOutputCube(psParameter, Application::GetUserInterface());
694  }
695 
696  Cube *ProcessMosaic::SetOutputCube(const QString &psParameter, UserInterface &ui) {
697  QString fname = ui.GetFileName(psParameter);
698 
699  // Make sure there is only one output cube
700  if (OutputCubes.size() > 0) {
701  QString m = "You must specify exactly one output cube";
702  throw IException(IException::Programmer, m, _FILEINFO_);
703  }
704 
705  // Attempt to open a cube ... get the filename from the user parameter
706  // (e.g., "TO") and the cube size from an input cube
707  Cube *cube = new Cube;
708  try {
709  cube->open(fname, "rw");
710  }
711  catch (IException &) {
712  delete cube;
713  throw;
714  }
715 
716  if (m_createOutputMosaic) {
717  Pvl *outLab = cube->label();
718  if (outLab->findObject("IsisCube").hasGroup("BandBin")) {
719  outLab->findObject("IsisCube").deleteGroup("BandBin");
720  }
721  }
722 
723  // Everything is fine so save the cube on the stack
724  AddOutputCube(cube);
725  return cube;
726  }
727 
728 
732  void ProcessMosaic::SetBandBinMatch(bool enforceBandBinMatch) {
733  m_enforceBandBinMatch = enforceBandBinMatch;
734  }
735 
736 
740  void ProcessMosaic::SetBandKeyword(QString bandPriorityKeyName, QString bandPriorityKeyValue) {
741  m_bandPriorityKeyName = bandPriorityKeyName;
742  m_bandPriorityKeyValue = bandPriorityKeyValue;
743  }
744 
745 
749  void ProcessMosaic::SetBandNumber(int bandPriorityBandNumber) {
750  m_bandPriorityBandNumber = bandPriorityBandNumber;
751  }
752 
753 
758  void ProcessMosaic::SetBandUseMaxValue(bool useMax) {
759  m_bandPriorityUseMaxValue = useMax;
760  }
761 
762 
771  void ProcessMosaic::SetCreateFlag(bool createOutputMosaic) {
772  m_createOutputMosaic = createOutputMosaic;
773  }
774 
775 
780  void ProcessMosaic::SetHighSaturationFlag(bool placeHighSatPixels) {
781  m_placeHighSatPixels = placeHighSatPixels;
782  }
783 
784 
785  void ProcessMosaic::SetImageOverlay(ImageOverlay placement) {
786  m_imageOverlay = placement;
787  }
788 
789 
794  void ProcessMosaic::SetLowSaturationFlag(bool placeLowSatPixels) {
795  m_placeLowSatPixels = placeLowSatPixels;
796  }
797 
802  void ProcessMosaic::SetMatchDEM(bool matchDEM) {
803  m_enforceMatchDEM = matchDEM;
804  }
805 
806 
811  void ProcessMosaic::SetNullFlag(bool placeNullPixels) {
812  m_placeNullPixels = placeNullPixels;
813  }
814 
815 
816  void ProcessMosaic::SetTrackFlag(bool trackingEnabled) {
817  m_trackingEnabled = trackingEnabled;
818  }
819 
820 
824  bool ProcessMosaic::GetHighSaturationFlag() const {
825  return m_placeHighSatPixels;
826  }
827 
828 
832  ProcessMosaic::ImageOverlay ProcessMosaic::GetImageOverlay() const {
833  return m_imageOverlay;
834  }
835 
836 
840  bool ProcessMosaic::GetLowSaturationFlag() const {
841  return m_placeLowSatPixels;
842  }
843 
844 
848  bool ProcessMosaic::GetNullFlag() const {
849  return m_placeNullPixels;
850  }
851 
852 
856  bool ProcessMosaic::GetTrackFlag() const {
857  return m_trackingEnabled;
858  }
859 
860 
864  int ProcessMosaic::GetInputStartLineInMosaic() const {
865  return m_osl;
866  }
867 
868 
872  int ProcessMosaic::GetInputStartSampleInMosaic() const {
873  return m_oss;
874  }
875 
876 
880  int ProcessMosaic::GetInputStartBandInMosaic() const {
881  return m_osb;
882  }
883 
884 
889  QString ProcessMosaic::OverlayToString(ImageOverlay imageOverlay) {
890  QString result;
891 
892  switch (imageOverlay) {
893  case PlaceImagesOnTop:
894  result = "OnTop";
895  break;
896 
897  case PlaceImagesBeneath:
898  result = "Beneath";
899  break;
900 
901  case UseBandPlacementCriteria:
902  result = "Band";
903  break;
904 
905  case AverageImageWithMosaic:
906  result = "Average";
907  break;
908 
909  case NumImageOverlayOptions:
910  break;
911  }
912 
913  if (result == "") {
914  throw IException(IException::Unknown,
915  "Cannot convert overlay [" + toString((int)imageOverlay) + "] to a string",
916  _FILEINFO_);
917  }
918 
919  return result;
920  }
921 
922 
927  ProcessMosaic::ImageOverlay ProcessMosaic::StringToOverlay(QString imageOverlayString) {
928  QString imageOverlayStringUpper = imageOverlayString.toUpper();
929  for (int i = 0; i < NumImageOverlayOptions; i++) {
930  if (OverlayToString((ImageOverlay)i).toUpper() == imageOverlayStringUpper)
931  return (ImageOverlay)i;
932  }
933 
934  throw IException(IException::Unknown,
935  "The text [" + imageOverlayString + "] does not correspond to any known "
936  "image overlay modes (mosaic priorities)",
937  _FILEINFO_);
938  }
939 
940 
948  void ProcessMosaic::MatchDEMShapeModel() {
949  Pvl* inLabel = InputCubes[0]->label();
950  Pvl* outLabel = OutputCubes[0]->label();
951 
952  if (outLabel->findObject("IsisCube").hasGroup("Mosaic")) {
953  PvlGroup outMosaicGrp = outLabel->findObject("IsisCube").findGroup("Mosaic");
954  if (outMosaicGrp.hasKeyword("ShapeModel")) {
955  if (inLabel->findObject("IsisCube").hasGroup("Kernels")) {
956  PvlGroup inMosaicGrp = inLabel->findObject("IsisCube").findGroup("Kernels");
957  if (outMosaicGrp.hasKeyword("ShapeModel") && inMosaicGrp.hasKeyword("ShapeModel")) {
958  PvlKeyword outShapeModelKey = outMosaicGrp.findKeyword("ShapeModel");
959  QString sShapeModel = inMosaicGrp.findKeyword("ShapeModel")[0];
960  int found = sShapeModel.lastIndexOf("/");
961  if (found != -1) {
962  sShapeModel.remove(0, found + 1);
963  }
964  if (sShapeModel == outShapeModelKey[0]) {
965  return;
966  }
967  }
968  }
969  QString sErrMsg = "Input and Mosaic DEM Shape Model do not match";
970  throw IException(IException::User, sErrMsg, _FILEINFO_);
971  }
972  }
973  else {
974  if (m_createOutputMosaic) {
975  if (inLabel->findObject("IsisCube").hasGroup("Kernels")) {
976  QString sShapeModel =
977  inLabel->findObject("IsisCube").findGroup("Kernels").findKeyword("ShapeModel")[0];
978  int found = sShapeModel.lastIndexOf("/");
979  if (found != -1){
980  sShapeModel.remove(0, found+1);
981  }
982  PvlObject & outIsisCubeObj = outLabel->findObject("IsisCube");
983  PvlGroup mosaicGrp("Mosaic");
984  PvlKeyword shapeModelKey("ShapeModel");
985  shapeModelKey += sShapeModel;
986  mosaicGrp += shapeModelKey;
987  outIsisCubeObj += mosaicGrp;
988  }
989  }
990  }
991  }
992 
993 
999  void ProcessMosaic::ResetCountBands()
1000  {
1001  int iBand = OutputCubes[0]->bandCount();
1002  int iLines = OutputCubes[0]->lineCount();
1003  int iSample = OutputCubes[0]->sampleCount();
1004 
1005  Portal countPortal(iSample, 1, OutputCubes[0]->pixelType());
1006  int iStartCountBand = iBand/2 + 1;
1007 
1008  for (int band=iStartCountBand; band<=iBand; band++) {
1009  for (int i = 1; i <= iLines; i++) {
1010  countPortal.SetPosition(1, i, band); //sample, line, band position
1011  OutputCubes[0]->read(countPortal);
1012  for (int iPixel = 0; iPixel < countPortal.size(); iPixel++) {
1013  countPortal[iPixel] = 0;
1014  }
1015  OutputCubes[0]->write(countPortal);
1016  }
1017  }
1018  }
1019 
1020 
1034  bool ProcessMosaic::ProcessAveragePriority(int piPixel, Portal& piPortal, Portal& poPortal,
1035  Portal& countPortal)
1036  {
1037  bool bChanged=false;
1038  if (IsValidPixel(piPortal[piPixel]) && IsValidPixel(poPortal[piPixel])) {
1039  int iCount = (int)countPortal[piPixel];
1040  double dNewDN = (poPortal[piPixel] * iCount + piPortal[piPixel]) / (iCount + 1);
1041  poPortal[piPixel] = dNewDN;
1042  countPortal[piPixel] =iCount +1;
1043  bChanged = true;
1044  }
1045  // Input-Valid, Mosaic-Special
1046  else if (IsValidPixel(piPortal[piPixel])) {
1047  poPortal[piPixel] = piPortal[piPixel];
1048  countPortal[piPixel] = 1;
1049  bChanged = true;
1050  }
1051  // Input-Special, Flags-True
1052  else if (IsSpecial(piPortal[piPixel])) {
1053  if ((m_placeHighSatPixels && IsHighPixel(piPortal[piPixel])) ||
1054  (m_placeLowSatPixels && IsLowPixel (piPortal[piPixel])) ||
1055  (m_placeNullPixels && IsNullPixel(piPortal[piPixel]))) {
1056  poPortal[piPixel] = piPortal[piPixel];
1057  countPortal[piPixel] = 0;
1058  bChanged = true;
1059  }
1060  }
1061  return bChanged;
1062  }
1063 
1064 
1076  void ProcessMosaic::MatchBandBinGroup(int origIsb, int &inb) {
1077  Pvl *inLab = InputCubes[0]->label();
1078  Pvl *outLab = OutputCubes[0]->label();
1079 
1080  PvlGroup &inBin = inLab->findGroup("BandBin", Pvl::Traverse);
1081  PvlGroup &outBin = outLab->findGroup("BandBin", Pvl::Traverse);
1082  if (inBin.keywords() != outBin.keywords()) {
1083  QString msg = "Pvl Group [BandBin] does not match between the input and output cubes";
1084  throw IException(IException::User, msg, _FILEINFO_);
1085  }
1086 
1087  //pvl - zero based
1088  int isb = (origIsb - 1);
1089  int osb = (m_osb - 1);
1090  int iOutBandsHalf = OutputCubes[0]->bandCount()/2;
1091 
1092  for (int i = 0; i < outBin.keywords(); i++) {
1093  PvlKeyword &outKey = outBin[i];
1094  QString sOutName = outKey.name();
1095  if (inBin.hasKeyword(sOutName)) {
1096  PvlKeyword &inKey = inBin[sOutName];
1097  for (int j = osb, k = isb; j < outKey.size() && k < inKey.size(); j++, k++) {
1098  if (outKey[j] == "NA") {
1099  outKey[j] = inKey[k];
1100  if (m_imageOverlay == AverageImageWithMosaic) {
1101  if (sOutName.contains("Filter") ||
1102  sOutName.contains("Name")) {
1103  outKey[j+iOutBandsHalf] = inKey[k] + "_Count";
1104  }
1105  else {
1106  outKey[j+iOutBandsHalf] = "Avg_Count";
1107  }
1108  }
1109  }
1110  else if (outKey[j] != inKey[k]) {
1111  QString msg = "The input cube [" + inLab->fileName() + "] and the base mosaic values "
1112  "of the Pvl Group [BandBin] for Keyword [" + outKey.name() + "] do not "
1113  "match. Base mosaic value at index [" + QString::number(j) + "] = " +
1114  outKey[j] + ". Input cube value at index [" + QString::number(k) + "] = "
1115  + inKey[k] + ". **Note: use mapmos/automos MatchBandBin = false to "
1116  "override this check**";
1117  //QString msg = "Pvl Group [BandBin] in Key[" + outKey.name() + "] In value" + inKey[k] +
1118  //"and Out value=" + outKey[j] + " do not match";
1119  throw IException(IException::User, msg, _FILEINFO_);
1120  }
1121  }
1122  }
1123  else {
1124  QString msg = "Pvl Group [BandBin] In Keyword[" + inBin[i].name() + "] and Out Keyword[" +
1125  outBin[i].name() + "] does not match";
1126  throw IException(IException::User, msg, _FILEINFO_);
1127  }
1128  }
1129 
1130  int inputRange = InputCubes[0]->bandCount() - isb;
1131  int outputRange = OutputCubes[0]->bandCount() - osb;
1132  inb = min(inputRange, outputRange);
1133  }
1134 
1135 
1147  void ProcessMosaic::AddBandBinGroup(int origIsb) {
1148  Pvl *inLab = InputCubes[0]->label();
1149  Pvl *outLab = OutputCubes[0]->label();
1150 
1151  int iOutBands = OutputCubes[0]->bandCount();
1152 
1153  // else if (m_imageOverlay == AverageImageWithMosaic) {
1154  if (m_imageOverlay == AverageImageWithMosaic) {
1155  iOutBands /= 2;
1156  }
1157 
1158  int isb = origIsb - 1; // array zero based
1159  int osb = m_osb - 1;
1160 
1161  PvlGroup &cInBin = inLab->findGroup("BandBin", Pvl::Traverse);
1162  PvlGroup cOutBin("BandBin");
1163 
1164  for (int i = 0; i < cInBin.keywords(); i++) {
1165  PvlKeyword &cInKey = cInBin[i];
1166  int iInKeySize = cInKey.size();
1167  PvlKeyword cOutKey(cInKey.name());
1168 
1169  for (int b = 0; b < osb; b++) {
1170  cOutKey += "NA";
1171  }
1172  for (int b = osb; b < iOutBands; b++) {
1173  if (isb < iInKeySize) {
1174  cOutKey += cInKey[isb++];
1175  }
1176  else {
1177  cOutKey += "NA";
1178  }
1179  }
1180 
1181  // Tag the Count Bands if priority is AverageImageWithMosaic.
1182  if (m_imageOverlay == AverageImageWithMosaic) {
1183 
1184  int iTotalOutBands = OutputCubes[0]->bandCount();
1185  isb = origIsb - 1; // reset the input starting band
1186  int iOutStartBand = iOutBands + osb;
1187  QString sKeyName = cInKey.name();
1188  bool bFilterKey = false;
1189  if (sKeyName.contains("Filter") ||
1190  sKeyName.contains("Original") ||
1191  sKeyName.contains("Name")) {
1192  bFilterKey = true;
1193  }
1194  for (int ob=iOutBands; ob<iTotalOutBands; ob++) {
1195  if (isb < iInKeySize && ob >= iOutStartBand) {
1196  if (bFilterKey) {
1197  cOutKey += cInKey[isb++] + "_Count";
1198  }
1199  else {
1200  cOutKey += 0;
1201  isb++;
1202  }
1203  }
1204  else {
1205  cOutKey += 0;
1206  }
1207  }
1208  }
1209 
1210  // Check for units and make sure output keyword units value is set to input
1211  // keyword units value
1212  if (cOutKey.unit() != cInKey.unit()) {
1213  cOutKey.setUnits((QString)(cInKey.unit()));
1214  }
1215 
1216  cOutBin += cOutKey;
1217  isb = origIsb - 1; // reinitialize the input starting band
1218  }
1219  outLab->findObject("IsisCube").addGroup(cOutBin);
1220  }
1221 
1222 
1232  void ProcessMosaic::AddDefaultBandBinGroup() {
1233  Pvl *outLab = OutputCubes[0]->label();
1234 
1235  PvlGroup cOutBin("BandBin");
1236 
1237  int iOutBands = OutputCubes[0]->bandCount();
1238  int iOutBandsTotal = iOutBands;
1239 
1240  if (m_trackingEnabled) {
1241  iOutBands--; // Leave tracking band
1242  }
1243  else if (m_imageOverlay == AverageImageWithMosaic) {
1244  iOutBands /= 2;
1245  }
1246 
1247  PvlKeyword cOutKey("FilterName");
1248 
1249  for (int i=0; i<iOutBands; i++) {
1250  cOutKey += "NA";
1251  }
1252 
1253  if (m_imageOverlay == AverageImageWithMosaic) {
1254  for (int i=iOutBands; i<iOutBandsTotal; i++) {
1255  cOutKey += "NA_Count";
1256  }
1257  }
1258 
1259  if (m_trackingEnabled) {
1260  cOutKey += "TRACKING";
1261  }
1262 
1263  cOutBin += cOutKey;
1264 
1265  outLab->findObject("IsisCube").addGroup(cOutBin);
1266  }
1267 
1268 
1272  int ProcessMosaic::GetBandIndex(bool inputFile) {
1273  bool bFound = false;
1274  int iBandIndex = 0;
1275 
1276  Pvl cPvlLabel;
1277 
1278  if (inputFile) {
1279  cPvlLabel = *(InputCubes[0]->label());
1280  if (m_bandPriorityBandNumber <= InputCubes[0]->bandCount() &&
1281  m_bandPriorityBandNumber > 0) {
1282  iBandIndex = m_bandPriorityBandNumber;
1283  bFound = true;
1284  }
1285  }
1286  else {
1287  cPvlLabel = *(OutputCubes[0]->label());
1288  if (m_bandPriorityBandNumber <= OutputCubes[0]->bandCount() &&
1289  m_bandPriorityBandNumber > 0) {
1290  iBandIndex = m_bandPriorityBandNumber;
1291  bFound = true;
1292  }
1293  }
1294 
1295  //key name
1296  if (!m_bandPriorityBandNumber) {
1297  PvlKeyword cKeyName;
1298  if (cPvlLabel.findGroup("BandBin", Pvl::Traverse).hasKeyword(m_bandPriorityKeyName)) {
1299  cKeyName = cPvlLabel.findGroup("BandBin", Pvl::Traverse).findKeyword(m_bandPriorityKeyName);
1300  }
1301  int iSize = cKeyName.size();
1302  for (int i = 0; i < iSize; i++) {
1303  if (m_bandPriorityKeyValue.toUpper() == cKeyName[i].toUpper()) {
1304  iBandIndex = i + 1; //1 based get key value index
1305  bFound = true;
1306  break;
1307  }
1308  }
1309  }
1310  if (!bFound) {
1311  QString msg = "Invalid Band / Key Name, Value ";
1312  throw IException(IException::User, msg, _FILEINFO_);
1313  }
1314  return iBandIndex;
1315  }
1316 
1317 
1335  void ProcessMosaic::BandComparison(int iss, int isl, int ins, int inl,
1336  int bandPriorityInputBandNumber, int bandPriorityOutputBandNumber, int index) {
1337  //
1338  // Create portal buffers for the input and output files
1339  Portal cIportal(ins, 1, InputCubes[0]->pixelType());
1340  Portal cOportal(ins, 1, OutputCubes[0]->pixelType());
1341  Portal trackingPortal(ins, 1, PixelType::UnsignedInteger);
1342 
1343  for (int iIL = isl, iOL = m_osl; iIL < isl + inl; iIL++, iOL++) {
1344  // Set the position of the portals in the input and output cubes
1345  cIportal.SetPosition(iss, iIL, bandPriorityInputBandNumber);
1346  InputCubes[0]->read(cIportal);
1347 
1348  cOportal.SetPosition(m_oss, iOL, bandPriorityOutputBandNumber);
1349  OutputCubes[0]->read(cOportal);
1350 
1351  trackingPortal.SetPosition(m_oss, iOL, 1);
1352  m_trackingCube->read(trackingPortal);
1353 
1354  // Move the input data to the output
1355  for (int iPixel = 0; iPixel < cOportal.size(); iPixel++) {
1356  if ((m_placeHighSatPixels && IsHighPixel(cIportal[iPixel])) ||
1357  (m_placeLowSatPixels && IsLowPixel(cIportal[iPixel])) ||
1358  (m_placeNullPixels && IsNullPixel(cIportal[iPixel]))) {
1359  trackingPortal[iPixel] = index;
1360  }
1361  else {
1362  if (IsValidPixel(cIportal[iPixel])) {
1363  if (IsSpecial(cOportal[iPixel]) ||
1364  (m_bandPriorityUseMaxValue == false && cIportal[iPixel] < cOportal[iPixel]) ||
1365  (m_bandPriorityUseMaxValue == true && cIportal[iPixel] > cOportal[iPixel])) {
1366  trackingPortal[iPixel] = index;
1367  }
1368  }
1369  }
1370  }
1371  m_trackingCube->write(trackingPortal);
1372  }
1373  }
1374 
1375 
1381 void ProcessMosaic::BandPriorityWithNoTracking(int iss, int isl, int isb, int ins, int inl,
1382  int inb, int bandPriorityInputBandNumber,
1383  int bandPriorityOutputBandNumber) {
1384  /*
1385  * specified band for comparison
1386  * Create portal buffers for the input and output files pointing to the
1387  */
1388  Portal iComparePortal( ins, 1, InputCubes[0]->pixelType() );
1389  Portal oComparePortal( ins, 1, OutputCubes[0]->pixelType() );
1390  Portal resultsPortal ( ins, 1, OutputCubes[0]->pixelType() );
1391 
1392  // Create portal buffers for the input and output files
1393  Portal iPortal( ins, 1, InputCubes[0]->pixelType() );
1394  Portal oPortal( ins, 1, OutputCubes[0]->pixelType() );
1395 
1396  for (int inLine = isl, outLine = m_osl; inLine < isl + inl; inLine++, outLine++) {
1397 // Set the position of the portals in the input and output cubes
1398  iComparePortal.SetPosition(iss, inLine, bandPriorityInputBandNumber);
1399  InputCubes[0]->read(iComparePortal);
1400 
1401  oComparePortal.SetPosition(m_oss, outLine, bandPriorityOutputBandNumber);
1402  OutputCubes[0]->read(oComparePortal);
1403 
1404  Portal iPortal( ins, 1, InputCubes[0]->pixelType() );
1405  Portal oPortal( ins, 1, OutputCubes[0]->pixelType() );
1406 
1407  bool inCopy = false;
1408 // Move the input data to the output
1409  for (int iPixel = 0; iPixel < ins; iPixel++) {
1410  resultsPortal[iPixel] = false;
1411  if (m_createOutputMosaic) {
1412  resultsPortal[iPixel] = true;
1413  inCopy = true;
1414  }
1415  else if ( IsValidPixel(iComparePortal[iPixel]) && IsValidPixel(oComparePortal[iPixel]) ) {
1416  if ( (m_bandPriorityUseMaxValue == false &&
1417  iComparePortal[iPixel] < oComparePortal[iPixel]) ||
1418  (m_bandPriorityUseMaxValue == true &&
1419  iComparePortal[iPixel] > oComparePortal[iPixel]) ) {
1420  resultsPortal[iPixel] = true;
1421  inCopy = true;
1422  }
1423  }
1424  else if (IsValidPixel(iComparePortal[iPixel]) && !IsValidPixel(oComparePortal[iPixel]) ) {
1425  resultsPortal[iPixel] = true;
1426  inCopy = true;
1427  }
1428  }
1429  if (inCopy) {
1430  for (int ib = isb, ob = m_osb; ib < (isb + inb) && ob <= m_onb; ib++, ob++) {
1431 // Set the position of the portals in the input and output cubes
1432  iPortal.SetPosition(iss, inLine, ib);
1433  InputCubes[0]->read(iPortal);
1434 
1435  oPortal.SetPosition(m_oss, outLine, ob);
1436  OutputCubes[0]->read(oPortal);
1437 
1438  for (int iPixel = 0; iPixel < ins; iPixel++) {
1439  if (resultsPortal[iPixel]) {
1440  if (m_createOutputMosaic) {
1441  oPortal[iPixel] = iPortal[iPixel];
1442  }
1443  else if ( IsValidPixel(iPortal[iPixel]) ||
1444  (m_placeHighSatPixels && IsHighPixel(iPortal[iPixel]) ) ||
1445  (m_placeLowSatPixels && IsLowPixel (iPortal[iPixel]) ) ||
1446  (m_placeNullPixels && IsNullPixel(iPortal[iPixel]) ) ) {
1447  oPortal[iPixel] = iPortal[iPixel];
1448  }
1449  }
1450  else if ( IsValidPixel(iPortal[iPixel]) && !IsValidPixel(oPortal[iPixel]) ) {
1451  oPortal[iPixel] = iPortal[iPixel];
1452  }
1453  }
1454  OutputCubes[0]->write(oPortal);
1455  }
1456  }
1457  }
1458  }
1459 
1460 
1473  int ProcessMosaic::GetOriginDefaultByPixelType() {
1474  int iDefault;
1475 
1476  switch (SizeOf(OutputCubes[0]->pixelType())) {
1477  case 1:
1478  iDefault = NULL1;
1479  break;
1480 
1481  case 2:
1482  iDefault = NULL2;
1483  break;
1484 
1485  case 4:
1486  iDefault = INULL4;
1487  break;
1488 
1489  default:
1490  QString msg = "ProcessMosaic::GetOriginDefaultByPixelType - Invalid Pixel Type";
1491  throw IException(IException::Programmer, msg, _FILEINFO_);
1492  }
1493 
1494  return iDefault;
1495  }
1496 
1497 
1507  bool ProcessMosaic::GetTrackStatus() {
1508  //get the output label
1509  Pvl *cPvlOut = OutputCubes[0]->label();
1510 
1511  bool bGroupExists = false;
1512  PvlObject cPvlObj;
1513 
1514  //Check if table already exists
1515  if (cPvlOut->hasGroup("Tracking")) {
1516  bGroupExists = true;
1517  }
1518 
1519  return bGroupExists;
1520  }
1521 
1522 }
Isis::SizeOf
int SizeOf(Isis::PixelType pixelType)
Returns the number of bytes of the specified PixelType.
Definition: PixelType.h:46
Isis::PvlKeyword::name
QString name() const
Returns the keyword name.
Definition: PvlKeyword.h:98
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::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::Portal
Buffer for containing a two dimensional section of an image.
Definition: Portal.h:36
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::PvlContainer::addKeyword
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Definition: PvlContainer.cpp:202
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::IsNullPixel
bool IsNullPixel(const double d)
Returns if the input pixel is null.
Definition: SpecialPixel.h:235
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::PvlObject::hasGroup
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::PvlKeyword::setUnits
void setUnits(QString units)
Sets the unit of measure for all current values if any exist.
Definition: PvlKeyword.cpp:166
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::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
Isis::IsHighPixel
bool IsHighPixel(const double d)
Returns if the input pixel is one of the high saturation types.
Definition: SpecialPixel.h:247
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::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
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::PvlContainer::fileName
QString fileName() const
Returns the filename used to initialise the Pvl object.
Definition: PvlContainer.h:232
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::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
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::FileName::removeExtension
FileName removeExtension() const
Removes all extensions in the file name.
Definition: FileName.cpp:246
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::PvlKeyword::size
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
Isis::CubeAttributeInput
Manipulate and parse attributes of input cube filenames.
Definition: CubeAttribute.h:381
Isis::PvlKeyword::unit
QString unit(const int index=0) const
Returns the units of measurement of the element of the array of values for the object at the specifie...
Definition: PvlKeyword.cpp:357
Isis::Buffer::size
int size() const
Returns the total number of pixels in the shape buffer.
Definition: Buffer.h:97
Isis::PvlContainer::keywords
int keywords() const
Returns the number of keywords contained in the PvlContainer.
Definition: PvlContainer.h:86
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::IsLowPixel
bool IsLowPixel(const double d)
Returns if the input pixel is one of the low saturation types.
Definition: SpecialPixel.h:259
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::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16