Commit b95b713b authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

Updated the project tree to include the images in the bundle. Still need to...

Updated the project tree to include the images in the bundle. Still need to update the cube labels and make history comments. Fixes #4818.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce_FY17-Sprint1@7627 41f8697f-d340-4b68-9986-7bafba869bb8
parent 5663d287
Loading
Loading
Loading
Loading
+38 −1
Original line number Diff line number Diff line
@@ -254,10 +254,13 @@ namespace Isis {
    m_controlNet = ControlNetQsp( new ControlNet(control.fileName(), &progress) );
    m_bundleResults.setOutputControlNet(m_controlNet);

    m_imageLists = imgLists;

    // this is too slow and we need to get rid of the serial number list anyway
    // should be unnecessary as Image class has serial number
    // could hang on to image list until creating BundleObservations?
    m_serialNumberList = new SerialNumberList;

    foreach (ImageList *imgList, imgLists) {
      foreach (Image *image, *imgList) {
        m_serialNumberList->add(image->fileName());
@@ -930,7 +933,7 @@ namespace Isis {
   * @return @b BundleSolutionInfo A container with solve information from the adjustment.
   */
  BundleSolutionInfo BundleAdjust::bundleSolveInformation() {
    BundleSolutionInfo results(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults);
    BundleSolutionInfo results(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults, imageLists());
    results.setRunTime("");
    return results;
  }
@@ -2534,6 +2537,40 @@ namespace Isis {
  }


  /**
  * This method returns the image list used in the bundle adjust. If a QList<ImageList *> was passed
  * into the constructor then it uses that list, otherwise it constructs the QList using the
  * m_serialNumberList
  *
  * @return QList<ImageList *> The ImageLists used for the bundle adjust
  */
  QList<ImageList *> BundleAdjust::imageLists() {
    if (m_imageLists.count() > 0) {
      return m_imageLists;
    }
    else if (m_serialNumberList->size() > 0) {
      ImageList *imgList;
      try {
        for (int i = 0; i < m_serialNumberList->size(); i++) {
          Image *image = new Image(m_serialNumberList->fileName(i));
          imgList->append(image);
        }
        m_imageLists.append(imgList);
        return m_imageLists;
      }
      catch (IException &e) {
        QString msg = "Invalid image in serial number list\n";
        throw IException(IException::Programmer, msg, _FILEINFO_);
      }
    }
    else {
      QString msg = "No images used in bundle adjust\n";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }
    return m_imageLists;
  }


  /**
   * Error propagation for solution.
   *
+23 −20
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ namespace Isis {
      ~BundleAdjust();
      BundleSolutionInfo    solveCholeskyBR();

      QList<ImageList *> imageLists();

    public slots:
      bool solveCholesky();
      void abortBundle();
@@ -429,6 +431,8 @@ namespace Isis {
                                                                   meters conversion factor.*/
      double m_metersToRadians;                              /**!< The body specific meters to
                                                                   radians conversion factor.*/
      QList<ImageList *> m_imageLists;                        /**!< The lists of images used in the
                                                                   bundle.*/

      // ==========================================================================================
      // === BEYOND THIS PLACE (THERE BE DRAGONS) all refers to the folded bundle solution.     ===
@@ -471,4 +475,3 @@ namespace Isis {
}

#endif
+10 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ namespace Isis {
  BundleSolutionInfo::BundleSolutionInfo(BundleSettingsQsp inputSettings,
                                         FileName controlNetworkFileName,
                                         BundleResults outputStatistics,
                                         QList<ImageList *> imgList,
                                         QObject *parent) : QObject(parent) {
    m_id = NULL;
    m_id = new QUuid(QUuid::createUuid());
@@ -49,7 +50,7 @@ namespace Isis {
    m_statisticsResults = new BundleResults(outputStatistics);

    m_images = NULL;
    m_images = new QList<ImageList *>;
    m_images = new QList<ImageList *>(imgList);
  }


@@ -474,7 +475,14 @@ namespace Isis {
    }
  }


/**
* Returns the images used in the bundle
*
* @return m_imageList The image list used in the bundle
*/
  QList<ImageList *> BundleSolutionInfo::imageList() {
    return *m_images;
  }


  /**
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ namespace Isis {
      BundleSolutionInfo(BundleSettingsQsp inputSettings,
                    FileName controlNetworkFileName,
                    BundleResults outputStatistics,
                    QList<ImageList *> imgList,
                    QObject *parent = 0);
      BundleSolutionInfo(Project *project,
                    XmlStackedHandlerReader *xmlReader,
@@ -117,6 +118,7 @@ namespace Isis {
      QString controlNetworkFileName() const;
      BundleSettingsQsp bundleSettings();
      BundleResults bundleResults();
      QList<ImageList *> imageList();
      QString runTime() const;


+15 −0
Original line number Diff line number Diff line
@@ -290,6 +290,21 @@ namespace Isis {
                               FileName(m_bundleSolutionInfo->controlNetworkFileName()).name());
    m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(jiggedControlName.toString());


    QList<ImageList *> imageLists = m_bundleSolutionInfo->imageList();
    foreach (ImageList *imageList, imageLists) {
      foreach (Image *image, *imageList) {
        FileName imageName(image->fileName());
        FileName imagesBundledFile(m_project->bundleSolutionInfoRoot() + "/" +
                                   m_bundleSolutionInfo->runTime() + "/" + imageName.name());
        imagesBundledFile = imagesBundledFile.setExtension("ecub");

        Cube *originalCube = new Cube(image->fileName(), "r");
        Cube *ecub = originalCube->copy(imagesBundledFile, CubeAttributeOutput("+External"));
      }
    }


    // Make sure that when we add our results, we let the use last settings box be checkable.
    m_ui->useLastSettings->setEnabled(true);

Loading