Loading isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ namespace Isis { * * @TODO make solveCholesky return a BundleSolutionInfo object and delete this placeholder ??? */ BundleSolutionInfo BundleAdjust::solveCholeskyBR() { BundleSolutionInfo* BundleAdjust::solveCholeskyBR() { solveCholesky(); return bundleSolveInformation(); } Loading Loading @@ -976,8 +976,7 @@ namespace Isis { m_bundleResults.setObservations(m_bundleObservations); m_bundleResults.setBundleControlPoints(m_bundleControlPoints); BundleSolutionInfo *results = new BundleSolutionInfo(bundleSolveInformation()); emit resultsReady(results); emit resultsReady(bundleSolveInformation()); emit statusUpdate("\nBundle Complete"); Loading @@ -999,12 +998,18 @@ namespace Isis { /** * Create a BundleSolutionInfo containing the settings and results from the bundle adjustment. * * @return @b BundleSolutionInfo A container with solve information from the adjustment. * @return @b BundleSolutionInfo A container with solve information from the adjustment. NOTE: * Caller takes ownership and is responsible for memory management of returned * BundleSolutionInfo raw pointer. * */ BundleSolutionInfo BundleAdjust::bundleSolveInformation() { BundleSolutionInfo results(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults, imageLists()); results.setRunTime(""); return results; BundleSolutionInfo *BundleAdjust::bundleSolveInformation() { BundleSolutionInfo *bundleSolutionInfo = new BundleSolutionInfo(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults, imageLists()); bundleSolutionInfo->setRunTime(""); return bundleSolutionInfo; } Loading isis/src/control/objs/BundleAdjust/BundleAdjust.h +9 −2 Original line number Diff line number Diff line Loading @@ -285,6 +285,13 @@ namespace Isis { * @history 2017-08-09 Summer Stapleton - Added a try/catch around the m_controlNet assignment * in each of the constructors to verify valid control net input. * Fixes #5068. * @history 2018-05-22 Ken Edmundson - Modified methods bundleSolveInformation() and * solveCholeskyBR() to return raw pointers to a BundleSolutionInfo object. * Also modified resultsReady signal to take a raw pointer to a * BundleSolutionInfo object. This was done to avoid using a copy * constructor in the BundleSolutionInfo class because it is derived * from QObject. Note that we ultimately want to return a QSharedPointer * instead of a raw pointer. */ class BundleAdjust : public QObject { Q_OBJECT Loading Loading @@ -314,7 +321,7 @@ namespace Isis { QList<ImageList *> imgList, bool printSummary); ~BundleAdjust(); BundleSolutionInfo solveCholeskyBR(); BundleSolutionInfo* solveCholeskyBR(); QList<ImageList *> imageLists(); Loading Loading @@ -350,7 +357,7 @@ namespace Isis { bool validateNetwork(); bool solveSystem(); void iterationSummary(); BundleSolutionInfo bundleSolveInformation(); BundleSolutionInfo* bundleSolveInformation(); bool computeBundleStatistics(); void applyParameterCorrections(); bool errorPropagation(); Loading isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp +11 −75 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ namespace Isis { /** * Constructor. Creates a BundleSolutionInfo. * Constructor. Creates a BundleSolutionInfo from disk. * * @param project The current project * @param xmlReader An XML reader that's up to an <bundleSettings/> tag. Loading @@ -77,29 +77,6 @@ namespace Isis { } /** * Constructor. Creates a BundleSolutionInfo. * * @param src BundleSolutionInfo where the settings and BundleResults are read from. */ BundleSolutionInfo::BundleSolutionInfo(const BundleSolutionInfo &src) : m_id(new QUuid(QUuid::createUuid())), m_name(src.m_name), m_runTime(src.m_runTime), m_inputControlNetFileName(new FileName(src.m_inputControlNetFileName->expanded())), m_settings(new BundleSettings(*src.m_settings)), m_statisticsResults(new BundleResults(*src.m_statisticsResults)), m_images(new QList<ImageList *>(*src.m_images)), m_adjustedImages(new QList<ImageList *>(*src.m_adjustedImages)), m_txtBundleOutputFilename(src.m_txtBundleOutputFilename), m_csvSavedImagesFilename(src.m_csvSavedImagesFilename), m_csvSavedPointsFilename(src.m_csvSavedPointsFilename), m_csvSavedResidualsFilename(src.m_csvSavedResidualsFilename) { m_outputControl = new Control(src.m_outputControl->fileName()); } /** * Destructor */ Loading Loading @@ -129,50 +106,6 @@ namespace Isis { } /** * Creates an equal operator for BundleSolutionInfos. * * @param src the BundleSolutionInfo that we are comparing the current BundleSolutionInfo to. * * @return @b BundleSolutionInfo Reference to the current BundleSolutionInfo */ BundleSolutionInfo &BundleSolutionInfo::operator=(const BundleSolutionInfo &src) { if (&src != this) { delete m_id; m_id = new QUuid(QUuid::createUuid()); m_runTime = src.m_runTime; if (src.m_name == "" || src.m_name == src.m_runTime) { m_name = m_runTime; } else { m_name = src.m_name; } delete m_inputControlNetFileName; m_inputControlNetFileName = new FileName(src.m_inputControlNetFileName->expanded()); delete m_outputControl; m_outputControl = new Control(src.m_outputControl->fileName()); m_settings = src.m_settings; delete m_statisticsResults; m_statisticsResults = new BundleResults(*src.m_statisticsResults); delete m_images; m_images = new QList<ImageList *>(*src.m_images); delete m_adjustedImages; m_adjustedImages = new QList<ImageList *>(*src.m_adjustedImages); } return *this; } /** * Returns bundleout text filename. * Loading Loading @@ -1577,6 +1510,8 @@ namespace Isis { // TODO: comment below not clear, why is this done? // This is done for unitTest which has no Project // SHOULD WE BE CREATING A SERIALIZED PROJECT AS INPUT TO THIS UNIT TEST? QString relativePath; QString relativeBundlePath; FileName bundleSolutionInfoRoot; Loading Loading @@ -1633,7 +1568,14 @@ namespace Isis { } } // Create relative path for bundleSolutionInfo // Create relativePath relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativePath.startsWith("/")) { relativePath.remove(0,1); } // Create relativeBundlePath for bundleSolutionInfo relativeBundlePath = newPath.remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativeBundlePath.startsWith("/")) { Loading @@ -1651,12 +1593,6 @@ namespace Isis { stream.writeTextElement("name", m_name); stream.writeTextElement("runTime", runTime()); QString relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativePath.startsWith("/")) { relativePath.remove(0,1); } stream.writeTextElement("inputFileName", relativePath); stream.writeTextElement("bundleOutTXT", Loading isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h +16 −3 Original line number Diff line number Diff line Loading @@ -136,6 +136,11 @@ namespace Isis { * bundlesolutioninfo's output control is serialized properly. * @history 2018-03-26 Ken Edmundson - modified save method to properly save output control * network file. * @history 2018-05-22 Ken Edmundson - changed default and copy constructors and assignment * operator to private to prevent developer from calling them. Done * because BundleSolutionInfo is derived from QObject (see comment * below). Removed copy constructor and assignment operator from cpp * file. */ class BundleSolutionInfo : public QObject { Q_OBJECT Loading @@ -148,9 +153,7 @@ namespace Isis { BundleSolutionInfo(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); //TODO does xml stuff need project??? BundleSolutionInfo(const BundleSolutionInfo &src); ~BundleSolutionInfo(); BundleSolutionInfo &operator=(const BundleSolutionInfo &src); QString savedBundleOutputFilename(); QString savedImagesFilename(); Loading Loading @@ -219,7 +222,18 @@ namespace Isis { }; private: // NOTE: BundleSolutionInfo is derived from QObject as it has one slot (perhaps more signals // and slots in the future? As a child of QObject it should have no copy constructor or // assignment operator. See for example... // // http://doc.qt.io/qt-5/qobject.html#no-copy-constructor // // These methods are declared as private to prevent the developer from calling default // operators. These will generate a compiler error if the developer attempts to use // them. BundleSolutionInfo(); BundleSolutionInfo(const BundleSolutionInfo &src); BundleSolutionInfo &operator=(const BundleSolutionInfo &src); //! A unique ID for this BundleSolutionInfo object (useful for others to reference this //! object when saving to disk). Loading @@ -242,7 +256,6 @@ namespace Isis { }; // end BundleSolutionInfo class void setStringAttribute(int locationId, QString locationName, QString attributeName, QString attributeValue); QString getStringAttribute(int locationId, QString locationName, QString attributeName); Loading isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.truth +13 −279 Original line number Diff line number Diff line Unit test for BundleSolutionInfo... Serializing results from the settings/cnet/statistics constructor... Created new BundleSettings... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -99,7 +101,8 @@ Serializing test XML object to file... <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -191,280 +194,8 @@ Testing XML: Object deserialized as (should match object above): <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing copy constructor... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing assignment operator to set this equal to itself... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing assignment operator to create a new results object... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -555,7 +286,8 @@ Testing mutator methods... <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -657,7 +389,8 @@ Serializing test XML object to file... <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT>bundleout.txt</bundleOutTXT> <imagesCSV>bundleout_images.csv</imagesCSV> <pointsCSV>bundleout_points.csv</pointsCSV> <residualsCSV>residuals.csv</residualsCSV> Loading Loading @@ -760,7 +493,8 @@ Testing XML: Object deserialized as (should match object above): <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT>bundleout.txt</bundleOutTXT> <imagesCSV>bundleout_images.csv</imagesCSV> <pointsCSV>bundleout_points.csv</pointsCSV> <residualsCSV>residuals.csv</residualsCSV> Loading Loading
isis/src/control/objs/BundleAdjust/BundleAdjust.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ namespace Isis { * * @TODO make solveCholesky return a BundleSolutionInfo object and delete this placeholder ??? */ BundleSolutionInfo BundleAdjust::solveCholeskyBR() { BundleSolutionInfo* BundleAdjust::solveCholeskyBR() { solveCholesky(); return bundleSolveInformation(); } Loading Loading @@ -976,8 +976,7 @@ namespace Isis { m_bundleResults.setObservations(m_bundleObservations); m_bundleResults.setBundleControlPoints(m_bundleControlPoints); BundleSolutionInfo *results = new BundleSolutionInfo(bundleSolveInformation()); emit resultsReady(results); emit resultsReady(bundleSolveInformation()); emit statusUpdate("\nBundle Complete"); Loading @@ -999,12 +998,18 @@ namespace Isis { /** * Create a BundleSolutionInfo containing the settings and results from the bundle adjustment. * * @return @b BundleSolutionInfo A container with solve information from the adjustment. * @return @b BundleSolutionInfo A container with solve information from the adjustment. NOTE: * Caller takes ownership and is responsible for memory management of returned * BundleSolutionInfo raw pointer. * */ BundleSolutionInfo BundleAdjust::bundleSolveInformation() { BundleSolutionInfo results(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults, imageLists()); results.setRunTime(""); return results; BundleSolutionInfo *BundleAdjust::bundleSolveInformation() { BundleSolutionInfo *bundleSolutionInfo = new BundleSolutionInfo(m_bundleSettings, FileName(m_cnetFileName), m_bundleResults, imageLists()); bundleSolutionInfo->setRunTime(""); return bundleSolutionInfo; } Loading
isis/src/control/objs/BundleAdjust/BundleAdjust.h +9 −2 Original line number Diff line number Diff line Loading @@ -285,6 +285,13 @@ namespace Isis { * @history 2017-08-09 Summer Stapleton - Added a try/catch around the m_controlNet assignment * in each of the constructors to verify valid control net input. * Fixes #5068. * @history 2018-05-22 Ken Edmundson - Modified methods bundleSolveInformation() and * solveCholeskyBR() to return raw pointers to a BundleSolutionInfo object. * Also modified resultsReady signal to take a raw pointer to a * BundleSolutionInfo object. This was done to avoid using a copy * constructor in the BundleSolutionInfo class because it is derived * from QObject. Note that we ultimately want to return a QSharedPointer * instead of a raw pointer. */ class BundleAdjust : public QObject { Q_OBJECT Loading Loading @@ -314,7 +321,7 @@ namespace Isis { QList<ImageList *> imgList, bool printSummary); ~BundleAdjust(); BundleSolutionInfo solveCholeskyBR(); BundleSolutionInfo* solveCholeskyBR(); QList<ImageList *> imageLists(); Loading Loading @@ -350,7 +357,7 @@ namespace Isis { bool validateNetwork(); bool solveSystem(); void iterationSummary(); BundleSolutionInfo bundleSolveInformation(); BundleSolutionInfo* bundleSolveInformation(); bool computeBundleStatistics(); void applyParameterCorrections(); bool errorPropagation(); Loading
isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.cpp +11 −75 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ namespace Isis { /** * Constructor. Creates a BundleSolutionInfo. * Constructor. Creates a BundleSolutionInfo from disk. * * @param project The current project * @param xmlReader An XML reader that's up to an <bundleSettings/> tag. Loading @@ -77,29 +77,6 @@ namespace Isis { } /** * Constructor. Creates a BundleSolutionInfo. * * @param src BundleSolutionInfo where the settings and BundleResults are read from. */ BundleSolutionInfo::BundleSolutionInfo(const BundleSolutionInfo &src) : m_id(new QUuid(QUuid::createUuid())), m_name(src.m_name), m_runTime(src.m_runTime), m_inputControlNetFileName(new FileName(src.m_inputControlNetFileName->expanded())), m_settings(new BundleSettings(*src.m_settings)), m_statisticsResults(new BundleResults(*src.m_statisticsResults)), m_images(new QList<ImageList *>(*src.m_images)), m_adjustedImages(new QList<ImageList *>(*src.m_adjustedImages)), m_txtBundleOutputFilename(src.m_txtBundleOutputFilename), m_csvSavedImagesFilename(src.m_csvSavedImagesFilename), m_csvSavedPointsFilename(src.m_csvSavedPointsFilename), m_csvSavedResidualsFilename(src.m_csvSavedResidualsFilename) { m_outputControl = new Control(src.m_outputControl->fileName()); } /** * Destructor */ Loading Loading @@ -129,50 +106,6 @@ namespace Isis { } /** * Creates an equal operator for BundleSolutionInfos. * * @param src the BundleSolutionInfo that we are comparing the current BundleSolutionInfo to. * * @return @b BundleSolutionInfo Reference to the current BundleSolutionInfo */ BundleSolutionInfo &BundleSolutionInfo::operator=(const BundleSolutionInfo &src) { if (&src != this) { delete m_id; m_id = new QUuid(QUuid::createUuid()); m_runTime = src.m_runTime; if (src.m_name == "" || src.m_name == src.m_runTime) { m_name = m_runTime; } else { m_name = src.m_name; } delete m_inputControlNetFileName; m_inputControlNetFileName = new FileName(src.m_inputControlNetFileName->expanded()); delete m_outputControl; m_outputControl = new Control(src.m_outputControl->fileName()); m_settings = src.m_settings; delete m_statisticsResults; m_statisticsResults = new BundleResults(*src.m_statisticsResults); delete m_images; m_images = new QList<ImageList *>(*src.m_images); delete m_adjustedImages; m_adjustedImages = new QList<ImageList *>(*src.m_adjustedImages); } return *this; } /** * Returns bundleout text filename. * Loading Loading @@ -1577,6 +1510,8 @@ namespace Isis { // TODO: comment below not clear, why is this done? // This is done for unitTest which has no Project // SHOULD WE BE CREATING A SERIALIZED PROJECT AS INPUT TO THIS UNIT TEST? QString relativePath; QString relativeBundlePath; FileName bundleSolutionInfoRoot; Loading Loading @@ -1633,7 +1568,14 @@ namespace Isis { } } // Create relative path for bundleSolutionInfo // Create relativePath relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativePath.startsWith("/")) { relativePath.remove(0,1); } // Create relativeBundlePath for bundleSolutionInfo relativeBundlePath = newPath.remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativeBundlePath.startsWith("/")) { Loading @@ -1651,12 +1593,6 @@ namespace Isis { stream.writeTextElement("name", m_name); stream.writeTextElement("runTime", runTime()); QString relativePath = m_inputControlNetFileName->expanded().remove(project->newProjectRoot()); // Get rid of any preceding "/" , but add on ending "/" if (relativePath.startsWith("/")) { relativePath.remove(0,1); } stream.writeTextElement("inputFileName", relativePath); stream.writeTextElement("bundleOutTXT", Loading
isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.h +16 −3 Original line number Diff line number Diff line Loading @@ -136,6 +136,11 @@ namespace Isis { * bundlesolutioninfo's output control is serialized properly. * @history 2018-03-26 Ken Edmundson - modified save method to properly save output control * network file. * @history 2018-05-22 Ken Edmundson - changed default and copy constructors and assignment * operator to private to prevent developer from calling them. Done * because BundleSolutionInfo is derived from QObject (see comment * below). Removed copy constructor and assignment operator from cpp * file. */ class BundleSolutionInfo : public QObject { Q_OBJECT Loading @@ -148,9 +153,7 @@ namespace Isis { BundleSolutionInfo(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0); //TODO does xml stuff need project??? BundleSolutionInfo(const BundleSolutionInfo &src); ~BundleSolutionInfo(); BundleSolutionInfo &operator=(const BundleSolutionInfo &src); QString savedBundleOutputFilename(); QString savedImagesFilename(); Loading Loading @@ -219,7 +222,18 @@ namespace Isis { }; private: // NOTE: BundleSolutionInfo is derived from QObject as it has one slot (perhaps more signals // and slots in the future? As a child of QObject it should have no copy constructor or // assignment operator. See for example... // // http://doc.qt.io/qt-5/qobject.html#no-copy-constructor // // These methods are declared as private to prevent the developer from calling default // operators. These will generate a compiler error if the developer attempts to use // them. BundleSolutionInfo(); BundleSolutionInfo(const BundleSolutionInfo &src); BundleSolutionInfo &operator=(const BundleSolutionInfo &src); //! A unique ID for this BundleSolutionInfo object (useful for others to reference this //! object when saving to disk). Loading @@ -242,7 +256,6 @@ namespace Isis { }; // end BundleSolutionInfo class void setStringAttribute(int locationId, QString locationName, QString attributeName, QString attributeValue); QString getStringAttribute(int locationId, QString locationName, QString attributeName); Loading
isis/src/control/objs/BundleSolutionInfo/BundleSolutionInfo.truth +13 −279 Original line number Diff line number Diff line Unit test for BundleSolutionInfo... Serializing results from the settings/cnet/statistics constructor... Created new BundleSettings... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -99,7 +101,8 @@ Serializing test XML object to file... <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -191,280 +194,8 @@ Testing XML: Object deserialized as (should match object above): <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing copy constructor... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing assignment operator to set this equal to itself... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> </generalAttributes> <bundleSettings> <globalSettings> <validateNetwork>Yes</validateNetwork> <solveOptions solveObservationMode="No" solveRadius="No" updateCubeLabel="No" errorPropagation="No" createInverseMatrix="No"/> <aprioriSigmas latitude="N/A" longitude="N/A" radius="N/A"/> <outlierRejectionOptions rejection="No" multiplier="N/A"/> <convergenceCriteriaOptions convergenceCriteria="Sigma0" threshold="1.0e-10" maximumIterations="50"/> <maximumLikelihoodEstimation/> <outputFileOptions fileNamePrefix=""/> </globalSettings> <observationSolveSettingsList> <bundleObservationSolveSettings> <instrumentId></instrumentId> <instrumentPointingOptions solveOption="AnglesOnly" numberCoefSolved="1" degree="2" solveDegree="2" solveTwist="Yes" solveOverExisting="No" interpolationType="3"> <aprioriPointingSigmas> <sigma>N/A</sigma> </aprioriPointingSigmas> </instrumentPointingOptions> <instrumentPositionOptions solveOption="None" numberCoefSolved="0" degree="2" solveDegree="2" solveOverHermiteSpline="No" interpolationType="3"> <aprioriPositionSigmas/> </instrumentPositionOptions> </bundleObservationSolveSettings> </observationSolveSettingsList> </bundleSettings> <bundleResults> <correlationMatrix correlationFileName="" covarianceFileName=""> <imagesAndParameters/> </correlationMatrix> <generalStatisticsValues> <numberFixedPoints>0</numberFixedPoints> <numberIgnoredPoints>0</numberIgnoredPoints> <numberHeldImages>0</numberHeldImages> <rejectionLimit>0.0</rejectionLimit> <numberRejectedObservations>0</numberRejectedObservations> <numberObservations>0</numberObservations> <numberImageParameters>0</numberImageParameters> <numberConstrainedPointParameters>0</numberConstrainedPointParameters> <numberConstrainedImageParameters>0</numberConstrainedImageParameters> <numberConstrainedTargetParameters>0</numberConstrainedTargetParameters> <numberUnknownParameters>0</numberUnknownParameters> <degreesOfFreedom>-1</degreesOfFreedom> <sigma0>0.0</sigma0> <converged>No</converged> </generalStatisticsValues> <rms> <residuals x="0.0" y="0.0" xy="0.0"/> <sigmas lat="0.0" lon="0.0" rad="0.0"/> <imageResidualsLists> <residualsList listSize="0"/> <sampleList listSize="0"/> <lineList listSize="0"/> </imageResidualsLists> <imageSigmasLists> <xSigmas listSize="0"/> <ySigmas listSize="0"/> <zSigmas listSize="0"/> <raSigmas listSize="0"/> <decSigmas listSize="0"/> <twistSigmas listSize="0"/> </imageSigmasLists> </rms> <elapsedTime time="0.0" errorProp="0.0"/> <minMaxSigmas> <minLat value="1000000000000.0" pointId=""/> <maxLat value="0.0" pointId=""/> <minLon value="1000000000000.0" pointId=""/> <maxLon value="0.0" pointId=""/> <minRad value="1000000000000.0" pointId=""/> <maxRad value="0.0" pointId=""/> </minMaxSigmas> <maximumLikelihoodEstimation numberModels="0" maximumLikelihoodIndex="0" maximumLikelihoodMedianR2Residuals="0.0"> <cumulativeProbabilityCalculator/> <residualsCumulativeProbabilityCalculator/> </maximumLikelihoodEstimation> </bundleResults> </bundleSolutionInfo> Testing assignment operator to create a new results object... <bundleSolutionInfo> <generalAttributes> <name></name> <runTime></runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -555,7 +286,8 @@ Testing mutator methods... <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT></bundleOutTXT> <imagesCSV></imagesCSV> <pointsCSV></pointsCSV> <residualsCSV></residualsCSV> Loading Loading @@ -657,7 +389,8 @@ Serializing test XML object to file... <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT>bundleout.txt</bundleOutTXT> <imagesCSV>bundleout_images.csv</imagesCSV> <pointsCSV>bundleout_points.csv</pointsCSV> <residualsCSV>residuals.csv</residualsCSV> Loading Loading @@ -760,7 +493,8 @@ Testing XML: Object deserialized as (should match object above): <name>xxx</name> <runTime>xxx</runTime> <fileName>cnetfile.net</fileName> <inputFileName></inputFileName> <bundleOutTXT>bundleout.txt</bundleOutTXT> <imagesCSV>bundleout_images.csv</imagesCSV> <pointsCSV>bundleout_points.csv</pointsCSV> <residualsCSV>residuals.csv</residualsCSV> Loading