Commit 20c95196 authored by Summer Stapleton's avatar Summer Stapleton
Browse files

Revert "Beginning of integration of TrackTable into ProcessMosaic"

This reverts commit b888aa8d.
parent 098d8ff6
Loading
Loading
Loading
Loading
+11 −34
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#include "SerialNumber.h"
#include "SpecialPixel.h"
#include "Table.h"
#include "TrackingTable.h"

using namespace std;

@@ -83,7 +82,6 @@ namespace Isis {

  //!  Destroys the Mosaic object. It will close all opened cubes.
  ProcessMosaic::~ProcessMosaic() {
    delete m_trackingCube;
  }


@@ -266,26 +264,8 @@ namespace Isis {
    // Image name into the table & Get the index for this input file
    int iIndex = GetIndexOffsetByPixelType();

    // Set the Mosaic Origin if Tracking is enabled
    // Set the Mosaic Origin is Tracking is enabled
    if (m_trackingEnabled) {
      // Initialize the output tracking cube
      QString trackingFile = FileName(OutputCubes[0]->fileName()).name();
      int found = trackingFile.lastIndexOf(".cub");
      if (found == -1) {
        trackingFile.remove(found).append("_tracking.cub");
        m_trackingCube = new Cube(trackingFile, "rw");
      }
      else {
        QString msg = "Output cube does not appear to be a valid cube file";
        throw IException(IException::Programmer, msg, _FILEINFO_);
      }
      
      // Add tracking group to mosaic cube
      Pvl *outLab = OutputCubes[0]->label();
      PvlGroup trackingGroup("Tracking");
      PvlKeyword trackingFileKeyword("FileName", trackingFile);
      trackingGroup.addKeyword(trackingFileKeyword);
      outLab->addGroup(trackingGroup);
      SetMosaicOrigin(iIndex);
    }
    else if (m_imageOverlay == AverageImageWithMosaic && m_createOutputMosaic) {
@@ -295,9 +275,9 @@ namespace Isis {
    m_onb = OutputCubes[0]->bandCount();

    if (m_trackingEnabled) {
      // //Get the last band set aside for "Origin" 1 based
      // iOriginBand = OutputCubes[0]->bandCount();
      // iChanged = 0;
      //Get the last band set aside for "Origin" 1 based
      iOriginBand = OutputCubes[0]->bandCount();
      iChanged = 0;

      // For mosaic creation, the input is copied onto mosaic by default
      if (m_imageOverlay == UseBandPlacementCriteria && !m_createOutputMosaic) {
@@ -323,7 +303,7 @@ namespace Isis {
      // Create portal buffers for the input and output files
      Portal iPortal(ins, 1, InputCubes[0]->pixelType());
      Portal oPortal(ins, 1, OutputCubes[0]->pixelType());
      Portal origPortal(ins, 1, m_trackingCube->pixelType());
      Portal origPortal(ins, 1, OutputCubes[0]->pixelType());

      for (int ib = isb, ob = m_osb; ib < (isb + inb) && ob <= m_onb; ib++, ob++) {
        for (int il = isl, ol = m_osl; il < isl + inl; il++, ol++) {
@@ -336,7 +316,7 @@ namespace Isis {

          if (m_trackingEnabled) {
            origPortal.SetPosition(m_oss, ol, iOriginBand);
            m_trackingCube->read(origPortal);
            OutputCubes[0]->read(origPortal);
          }
          else if (m_imageOverlay == AverageImageWithMosaic) {
            origPortal.SetPosition(m_oss, ol, (ob+m_onb));
@@ -690,11 +670,10 @@ namespace Isis {
      fieldLength = inputFileNameLength;
    }

    // Get output file names for mosaic file and tracking file
    // QString sOutputFile = FileName(OutputCubes[0]->fileName()).name();
    // Get output file name
    QString sOutputFile = FileName(OutputCubes[0]->fileName()).name();

    // Pvl *cPvlOut = OutputCubes[0]->label();
    Pvl *cPvlOut = m_trackingCube->label();
    Pvl *cPvlOut = OutputCubes[0]->label();

    // Create a table record with the new image file name and serial number info
    TableRecord cFileRecord;
@@ -839,11 +818,9 @@ namespace Isis {
    if (m_createOutputMosaic && m_trackingEnabled) {
      Table cFileTable(tableName, cFileRecord);
      cFileTable += cFileRecord;
      TrackingTable tTable(cFileTable);
      Table table = tTable.toTable();
      m_trackingCube->write(table);
      OutputCubes[0]->write(cFileTable);
      //reset the origin band based on pixel type
      // ResetOriginBand();
      ResetOriginBand();
    }
  }

+0 −2
Original line number Diff line number Diff line
@@ -327,8 +327,6 @@ namespace Isis {
      // Match DEM between Input & Mosaic if MatchDEM Flag is enabled
      void MatchDEMShapeModel();

      Isis::Cube *m_trackingCube;      //!< The separate tracking information cube

      bool m_trackingEnabled;         //!<
      bool m_createOutputMosaic;      //!<
      int  m_bandPriorityBandNumber;  //!<