Commit a5b5df1f authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Add csv files to the project tree under bundle results.

parent 0dca9a43
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2545,18 +2545,18 @@ namespace Isis {
  * @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;
      ImageList *imgList = new ImageList;
      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";
@@ -2567,6 +2567,7 @@ namespace Isis {
      QString msg = "No images used in bundle adjust\n";
      throw IException(IException::Programmer, msg, _FILEINFO_);
    }

    return m_imageLists;
  }

+1 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ namespace Isis {
   *                           there is no longer a -Wformat-security warning.
   *   @history 2017-05-01 Makayla Shepherd - Added imageLists() to track and return the images
   *                           bundled. Fixes #4818.
   *   @history 2017-05-09 Tracie Sucharski - Fixed an empty pointer in ::imgeLists method. 
   */
  class BundleAdjust : public QObject {
      Q_OBJECT
+10 −12
Original line number Diff line number Diff line
@@ -24,11 +24,6 @@

namespace Isis {

  // initialize default filenames for csv output.
  const char BundleSolutionInfo::m_csvImagesFilename[] = "bundleout_images.csv";
  const char BundleSolutionInfo::m_csvPointsFilename[] = "bundleout_points.csv";
  const char BundleSolutionInfo::m_csvResidualsFilename[] = "residuals.csv";

  /**
   * Constructor. Creates a BundleSolutionInfo.
   *
@@ -90,7 +85,10 @@ namespace Isis {
        m_controlNetworkFileName(new FileName(src.m_controlNetworkFileName->expanded())),
        m_settings(new BundleSettings(*src.m_settings)),
        m_statisticsResults(new BundleResults(*src.m_statisticsResults)),
        m_images(new QList<ImageList *>(*src.m_images)) {
        m_images(new QList<ImageList *>(*src.m_images)),
        m_csvSavedImagesFilename(src.m_csvSavedImagesFilename),
        m_csvSavedPointsFilename(src.m_csvSavedPointsFilename),
        m_csvSavedResidualsFilename(src.m_csvSavedResidualsFilename) {
  }


@@ -143,15 +141,15 @@ namespace Isis {
    return *this;
  }

  QString BundleSolutionInfo::getSavedImagesFilename() {
  QString BundleSolutionInfo::savedImagesFilename() {
    return m_csvSavedImagesFilename;
  }

  QString BundleSolutionInfo::getSavedPointsFilename() {
  QString BundleSolutionInfo::savedPointsFilename() {
    return m_csvSavedPointsFilename;
  }

  QString BundleSolutionInfo::getSavedResidualsFilename() {
  QString BundleSolutionInfo::savedResidualsFilename() {
    return m_csvSavedResidualsFilename;
  }

@@ -955,7 +953,7 @@ namespace Isis {
    QList<Statistics> rmsImageLineResiduals = m_statisticsResults->rmsImageLineResiduals();
    QList<Statistics> rmsImageResiduals = m_statisticsResults->rmsImageResiduals();

    QString ofname = m_csvImagesFilename;
    QString ofname = "bundleout_images.csv";
    ofname = m_settings->outputFilePrefix() + ofname;
    m_csvSavedImagesFilename = ofname;

@@ -1217,7 +1215,7 @@ namespace Isis {
  bool BundleSolutionInfo::outputPointsCSV() {
    char buf[1056];

    QString ofname = m_csvPointsFilename;
    QString ofname = "bundleout_points.csv";
    ofname = m_settings->outputFilePrefix() + ofname;
    m_csvSavedPointsFilename = ofname;

@@ -1332,7 +1330,7 @@ namespace Isis {
  bool BundleSolutionInfo::outputResiduals() {
    char buf[1056];

    QString ofname = m_csvResidualsFilename;
    QString ofname = "residuals.csv";
    ofname = m_settings->outputFilePrefix() + ofname;
    m_csvSavedResidualsFilename = ofname;

+3 −9
Original line number Diff line number Diff line
@@ -120,9 +120,9 @@ namespace Isis {
      ~BundleSolutionInfo();
      BundleSolutionInfo &operator=(const BundleSolutionInfo &src);

      QString getSavedImagesFilename();
      QString getSavedPointsFilename();
      QString getSavedResidualsFilename();
      QString savedImagesFilename();
      QString savedPointsFilename();
      QString savedResidualsFilename();

      void setOutputStatistics(BundleResults statisticsResults);
      void setRunTime(QString runTime);
@@ -190,12 +190,6 @@ namespace Isis {
      BundleResults      *m_statisticsResults; //!< The results of the bundle adjust
      QList<ImageList *> *m_images; //!< The list of images that were adjusted

      // Hard code these for now but we may allow setting them in future updates.
      // These are default names for the file.  The path comes from BundleSettings.
      static const char m_csvImagesFilename[];
      static const char m_csvPointsFilename[];
      static const char m_csvResidualsFilename[];

      // In theory the path in the BundlesSettings can change while running.  So we save the
      // filenames actually used when the most recent save of the file was done.
      QString m_csvSavedImagesFilename;
+6 −0
Original line number Diff line number Diff line
@@ -335,6 +335,11 @@ namespace Isis {
    m_accept->setEnabled(false);
    m_reject->setEnabled(false);

    //  Write csv files
    m_bundleSolutionInfo->outputResiduals();
    m_bundleSolutionInfo->outputImagesCSV();
    m_bundleSolutionInfo->outputPointsCSV();

    m_project->addBundleSolutionInfo( new BundleSolutionInfo(*m_bundleSolutionInfo) );

    // create output control net
@@ -342,6 +347,7 @@ namespace Isis {
    FileName jiggedControlName(m_project->bundleSolutionInfoRoot() + "/" +
                               m_bundleSolutionInfo->runTime() + "/" +
                               FileName(m_bundleSolutionInfo->controlNetworkFileName()).name());
    
    m_bundleSolutionInfo->bundleResults().outputControlNet()->Write(jiggedControlName.toString());

    // Iterate through all of the image lists (the "imports" in the project).
Loading