Commit 9fb7022d authored by Kaitlyn Lee's avatar Kaitlyn Lee
Browse files

Grab path from original cube to open tracking cube.

parent e2a35205
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
#include "TProjection.h"
#include "TrackingTable.h"

#include <iostream>
namespace Isis {

  // For mosaic tracking
@@ -571,16 +570,23 @@ namespace Isis {
        Cube *cCube = cvp->cube();
        int iTrackBand = -1;

        if(cCube->fileName().contains("_tracking")) {
        if(cCube->hasGroup("Tracking")) {
          PvlGroup trackingGroup = cCube->group("Tracking");
          //Because the tracking group does not have a path, get the path from the main cube
          FileName cCubeName(cCube->fileName());
          QString trackingCubeName = trackingGroup.findKeyword("Filename")[0];
          FileName trackingCubeFileName(cCubeName.path() + "/" + trackingCubeName);
          Cube trackingCube(trackingCubeFileName);

          // Read the cube DN value from TRACKING cube at location (piLine, piSample)
          Portal trackingPortal(cCube->sampleCount(), 1, cCube->pixelType());
          Portal trackingPortal(trackingCube.sampleCount(), 1, trackingCube.pixelType());
          trackingPortal.SetPosition(piSample, piLine, 1);
          cCube->read(trackingPortal);
          trackingCube.read(trackingPortal);

          unsigned int currentPixel = trackingPortal[0];
          if (currentPixel != NULLUI4) {  // If not from an image
          if (currentPixel != NULLUI4) {  // If from an image
            Table table(m_tableMosaicSrc);
            cCube->read(table);
            trackingCube.read(table);
            TrackingTable trackingTable(table);

            FileName trackingFileName = trackingTable.pixelToFileName(currentPixel);
+4 −1
Original line number Diff line number Diff line
@@ -83,7 +83,10 @@ namespace Isis {
   *                          to record the point into so that the first recorded point is drawn.
   *                          Fixes #5143.
   *  @history 2018-07-18 Kristin Berry and Kaitlyn Lee - Updated TrackMosaicOrigin to work with
   *                          TrackingTable and an external tracking cube.
   *                          an external tracking cube.
   *  @history 2018-07-31 Kaitlyn Lee - Updated TrackMosaicOrigin to use a TrackingTable object
   *                          to get the file name, serial number, and index of the image associated
   *                          with the current pixel.
   */
  class AdvancedTrackTool : public Tool {
      Q_OBJECT