Container class for BundleAdjustment results. More...
#include <BundleSolutionInfo.h>
Classes | |
class | XmlHandler |
This class is used to read an images.xml file into an image list. More... | |
Public Slots | |
void | updateFileName (Project *) |
Change the on-disk file name for the control network used to be where the control network ought to be in the given project. More... | |
Public Member Functions | |
BundleSolutionInfo (BundleSettingsQsp inputSettings, FileName controlNetworkFileName, BundleResults outputStatistics, QObject *parent=0) | |
Constructor. More... | |
BundleSolutionInfo (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=0) | |
Constructor. More... | |
BundleSolutionInfo (FileName bundleSolutionInfoFile) | |
Constructor. More... | |
BundleSolutionInfo (const BundleSolutionInfo &src) | |
Constructor. More... | |
~BundleSolutionInfo () | |
Destructor. More... | |
BundleSolutionInfo & | operator= (const BundleSolutionInfo &src) |
Creates an equal operator for BundleSolutionInfos. More... | |
void | setOutputStatistics (BundleResults statisticsResults) |
Sets the stat results. More... | |
void | setRunTime (QString runTime) |
Sets the run time. More... | |
QString | id () const |
Get a unique, identifying string associated with this BundleSolutionInfo object. More... | |
QString | controlNetworkFileName () const |
Returns the name of the control network. More... | |
BundleSettingsQsp | bundleSettings () |
Returns the bundle settings. More... | |
BundleResults | bundleResults () |
Returns the bundle results. More... | |
QString | runTime () const |
Returns the run time. More... | |
bool | outputImagesCSVHeader (std::ofstream &fpOut) |
Outputs the header for the bundleout_images.csv file. More... | |
bool | outputHeader (std::ofstream &fpOut) |
Output header for bundle results file. More... | |
bool | outputText () |
Outputs a text file with the results of the BundleAdjust. More... | |
bool | outputImagesCSV () |
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observation. More... | |
bool | outputPointsCSV () |
Outputs point data to a csv file. More... | |
bool | outputResiduals () |
Outputs image coordinate residuals to a csv file. More... | |
PvlObject | pvlObject (QString resultsName="BundleSolutionInfo", QString settingsName="InputSettings", QString statisticsName="StatisticsResults") |
Writes the results from BundleAdjust to a Pvl. More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Saves the BundleSolutionInfo to the project. More... | |
void | save (QXmlStreamWriter &stream, const Project *project) const |
Saves the BundleSolutionInfo to the project. More... | |
QDataStream & | write (QDataStream &stream) const |
Writes the data to the stream. More... | |
QDataStream & | read (QDataStream &stream) |
Reads the data from the stream. More... | |
void | writeH5File (FileName outputFileName) const |
void | readH5File (FileName outputFileName) const |
void | createH5File (FileName outputFileName) const |
Creates a new file using H5F_ACC_EXCL. More... | |
void | openH5File (FileName outputFileName) |
Reads the settings and results from another BundleSolutionInfo. More... | |
Private Attributes | |
QUuid * | m_id |
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when saving to disk). More... | |
QString | m_runTime |
The run time of the bundle adjust. More... | |
FileName * | m_controlNetworkFileName |
The name of the control network. More... | |
BundleSettingsQsp | m_settings |
The settings from the bundle adjust. More... | |
BundleResults * | m_statisticsResults |
The results of the bundle adjust. More... | |
QList< ImageList * > * | m_images |
The list of images that were adjusted. More... | |
Container class for BundleAdjustment results.
This class includes the settings used to run the bundle adjustment, the resulting statistics values, and the name of the control network used.
2014-07-08 Jeannie Backer - Original version.
2014-07-23 Jeannie Backer - Added implementation for the QDataStream << and >> operators and the read/write methods.
2014-12-04 Jeannie Backer - Renamed from BundleResults to BundleSolutionInfo.
2015-09-03 Jeannie Backer - Added preliminary hdf5 read/write capabilities.
2015-10-14 Jeffrey Covington - Declared BundleSolutionInfo * as a Qt metatype for use with QVariant.
2016-06-13 Makayla Shepherd - Added updateFileName() and updated documentation. Fixes #2298.
2016-08-15 Jesse Mapel - added output, outputHeader, outputText, outputPointsCSV, and outputResiduals from BundleAdjust. Fixes #4159.
2016-08-18 Jeannie Backer - Removed all references to deprecated BundleSettings::solveMethod. References #4162.
2016-08-23 Jesse Mapel - Removed output() method. Individual output file methods must be called. Fixes #4279.
2016-09-02 Jesse Mapel - Added camera point and position input parameters to output files when using only one set of solve settings. Fixes #4316.
2016-10-06 Tyler Wilson - Added methods outputImagesCSV() and outputImagesCSVHeader which enables jigsaw users to output the bundleout_images.csv file. Fixes #4314.
2016-10-17 Jesse Mapel - Removed multiple solve settings output in accordance with USEPVL being removed from jigsaw. References #4316.
2016-10-28 Tyler Wilson - Modified outputText() to check and output if the solution is solving for the radius. References #4317.
2016-11-14 Ken Edmundson Modified the following... -Changed column headers in images.csv to match row headers in bundleout.txt (instead of at2, bt, c to indicate coefficients, now using t2, t1, t0, etc) -Added output of CKDEGREE, CKSOLVEDEGREE, SPKDEGREE, SPKSOLVEDEGREE to bundleout.txt header when CAMSOLVE=ALL and/or SPSOLVE=ALL -Fixed typo under SPACECRAFT OPTIONS; what should have said "SPSOLVE: All POLYNOMIAL COEFFICIENTS" was "CAMSOLVE: All POLYNOMIAL COEFFICIENTS" -modified output of image EO in bundleout.txt for images solved with observation mode; previously one entry per observation was written, now all images in the observation are written separately.
2016-12-01 Ian Humphrey - Modified an sprintf() call in outputImagesCSV() to prevent a -Wformat-security warning from occurring.
2016-12-08 Ian Humphrey - Modified outputImagesCSVHeader() to treat TWIST the same as the other angles when determining how many headers to create. Fixes #4557.
Definition at line 98 of file BundleSolutionInfo.h.
Isis::BundleSolutionInfo::BundleSolutionInfo | ( | BundleSettingsQsp | inputSettings, |
FileName | controlNetworkFileName, | ||
BundleResults | outputStatistics, | ||
QObject * | parent = 0 |
||
) |
Constructor.
Creates a BundleSolutionInfo.
inputSettings | The settings saved in BundleSolutionInfo |
controlNetworkFileName | The file name and path of the control network |
outputStatistics | The results of the BundleAdjust |
parent | The Qt-relationship parent |
Definition at line 38 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_images, m_runTime, m_settings, and m_statisticsResults.
Isis::BundleSolutionInfo::BundleSolutionInfo | ( | Project * | project, |
XmlStackedHandlerReader * | xmlReader, | ||
QObject * | parent = 0 |
||
) |
Constructor.
Creates a BundleSolutionInfo.
project | The current project |
xmlReader | An XML reader that's up to an <bundleSettings> tag. |
parent | The Qt-relationship parent |
Definition at line 67 of file BundleSolutionInfo.cpp.
References m_id.
Isis::BundleSolutionInfo::BundleSolutionInfo | ( | FileName | bundleSolutionInfoFile | ) |
Constructor.
Creates a BundleSolutionInfo.
bundleSolutionInfo | Filename of another BundleSolutionInfo and reads the settings and BundleResults from that. |
Definition at line 84 of file BundleSolutionInfo.cpp.
References m_id, m_images, m_settings, m_statisticsResults, and openH5File().
Isis::BundleSolutionInfo::BundleSolutionInfo | ( | const BundleSolutionInfo & | src | ) |
Constructor.
Creates a BundleSolutionInfo.
src | BundleSolutionInfo where the settings and BundleResults are read from. |
Definition at line 104 of file BundleSolutionInfo.cpp.
Isis::BundleSolutionInfo::~BundleSolutionInfo | ( | ) |
Destructor.
Definition at line 124 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_images, and m_statisticsResults.
BundleResults Isis::BundleSolutionInfo::bundleResults | ( | ) |
Returns the bundle results.
IException::Unknown | "Results for this bundle is NULL." |
Definition at line 512 of file BundleSolutionInfo.cpp.
References _FILEINFO_, m_statisticsResults, and Isis::IException::Unknown.
Referenced by Isis::JigsawDialog::bundleFinished(), Isis::ProjectItem::ProjectItem(), and pvlObject().
BundleSettingsQsp Isis::BundleSolutionInfo::bundleSettings | ( | ) |
Returns the bundle settings.
Definition at line 500 of file BundleSolutionInfo.cpp.
References m_settings.
Referenced by Isis::Project::addBundleSolutionInfo(), Isis::ProjectItem::ProjectItem(), and pvlObject().
QString Isis::BundleSolutionInfo::controlNetworkFileName | ( | ) | const |
Returns the name of the control network.
Definition at line 490 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName.
Referenced by Isis::ProjectItem::ProjectItem(), pvlObject(), and read().
void Isis::BundleSolutionInfo::createH5File | ( | FileName | outputFileName | ) | const |
Creates a new file using H5F_ACC_EXCL.
IException::Io | "A file already exists with the given name [" |
IException::Unknown | "H5 exception handler has detected an error when invoking the function" |
IException::Unknown | "Unable to save bundle solution information to an HDF5 file." |
outputFileName | The name of the file we are creating. |
Definition at line 1900 of file BundleSolutionInfo.cpp.
References _FILEINFO_, Isis::IException::Io, m_controlNetworkFileName, m_images, m_runTime, m_settings, m_statisticsResults, and Isis::IException::Unknown.
Referenced by Isis::Project::addBundleSolutionInfo().
QString Isis::BundleSolutionInfo::id | ( | ) | const |
Get a unique, identifying string associated with this BundleSolutionInfo object.
Definition at line 451 of file BundleSolutionInfo.cpp.
References m_id.
Referenced by read().
void Isis::BundleSolutionInfo::openH5File | ( | FileName | bundleSolutionInfoFile | ) |
Reads the settings and results from another BundleSolutionInfo.
IException::Io | "No file with the given name was found." |
IException::Io | "The given file is unsupported for constructing BundleSolutionInfo objects. Supported file types include [hdf]." |
IException::Unknown | "H5 exception handler has detected an error when invoking the function" |
IException::Unknown | "Unable to read bundle solution information from the given HDF5 file" |
bundleSolutionInfoFile | The name of the BundleSolutionInfo we are reading from |
Definition at line 1764 of file BundleSolutionInfo.cpp.
References _FILEINFO_, Isis::ImageList::append(), Isis::IException::Io, m_controlNetworkFileName, m_images, m_runTime, m_settings, m_statisticsResults, Isis::BundleResults::openH5Group(), and Isis::IException::Unknown.
Referenced by BundleSolutionInfo().
BundleSolutionInfo & Isis::BundleSolutionInfo::operator= | ( | const BundleSolutionInfo & | src | ) |
Creates an equal operator for BundleSolutionInfos.
src | the BundleSolutionInfo that we are comparing the current BundleSolutionInfo to. |
Definition at line 146 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_images, m_runTime, m_settings, and m_statisticsResults.
bool Isis::BundleSolutionInfo::outputHeader | ( | std::ofstream & | fpOut | ) |
Output header for bundle results file.
fpOut | The output stream that the header will be sent to. |
IException::Io | "Failed to output residual percentiles for bundleout" |
IException::Io | "Failed to output residual box plot for bundleout" |
Definition at line 691 of file BundleSolutionInfo.cpp.
References _FILEINFO_, Isis::BundleObservationSolveSettings::aprioriPointingSigmas(), Isis::BundleObservationSolveSettings::aprioriPositionSigmas(), Isis::BundleObservationSolveSettings::ckDegree(), Isis::BundleObservationSolveSettings::ckSolveDegree(), Isis::iTime::CurrentLocalTime(), Isis::BundleResults::elapsedTime(), Isis::BundleResults::elapsedTimeErrorProp(), Isis::IException::Io, Isis::BundleResults::iterations(), m_controlNetworkFileName, m_settings, m_statisticsResults, Isis::StatCumProbDistDynCalc::max(), Isis::BundleResults::maximumLikelihoodModelQuantile(), Isis::BundleResults::maximumLikelihoodModelWFunc(), Isis::StatCumProbDistDynCalc::min(), Isis::MaximumLikelihoodWFunctions::modelToString(), Isis::Null, Isis::BundleObservationSolveSettings::numberCameraAngleCoefficientsSolved(), Isis::BundleObservationSolveSettings::numberCameraPositionCoefficientsSolved(), Isis::BundleResults::numberConstrainedImageParameters(), Isis::BundleResults::numberConstrainedPointParameters(), Isis::BundleResults::numberConstrainedTargetParameters(), Isis::BundleResults::numberObservations(), Isis::BundleResults::numberRejectedObservations(), Isis::BundleResults::numberUnknownParameters(), Isis::BundleResults::observations(), Isis::BundleResults::outputControlNet(), Isis::BundleResults::residualsCumulativeProbabilityDistribution(), Isis::BundleResults::sigma0(), Isis::BundleObservationSolveSettings::solvePolyOverPointing(), Isis::BundleObservationSolveSettings::solvePositionOverHermite(), Isis::BundleObservationSolveSettings::solveTwist(), Isis::BundleObservationSolveSettings::spkDegree(), Isis::BundleObservationSolveSettings::spkSolveDegree(), Isis::MaximumLikelihoodWFunctions::tweakingConstant(), Isis::StatCumProbDistDynCalc::value(), and Isis::MaximumLikelihoodWFunctions::weightedResidualCutoff().
Referenced by outputText().
bool Isis::BundleSolutionInfo::outputImagesCSV | ( | ) |
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observation.
Definition at line 1199 of file BundleSolutionInfo.cpp.
References Isis::BundleResults::converged(), m_settings, m_statisticsResults, Isis::BundleResults::observations(), outputImagesCSVHeader(), Isis::BundleResults::rmsImageLineResiduals(), Isis::BundleResults::rmsImageResiduals(), Isis::BundleResults::rmsImageSampleResiduals(), and Isis::toString().
bool Isis::BundleSolutionInfo::outputImagesCSVHeader | ( | std::ofstream & | fpOut | ) |
Outputs the header for the bundleout_images.csv file.
fpOut | The output file stream. |
Definition at line 538 of file BundleSolutionInfo.cpp.
References m_settings, Isis::BundleObservationSolveSettings::numberCameraAngleCoefficientsSolved(), Isis::BundleObservationSolveSettings::numberCameraPositionCoefficientsSolved(), and Isis::toString().
Referenced by outputImagesCSV().
bool Isis::BundleSolutionInfo::outputPointsCSV | ( | ) |
Outputs point data to a csv file.
Definition at line 1466 of file BundleSolutionInfo.cpp.
References Isis::BundleResults::bundleControlPoints(), Isis::ControlPoint::Constrained, Isis::DEG2RAD(), Isis::ControlPoint::Fixed, Isis::ControlPoint::Free, m_settings, m_statisticsResults, and Isis::BundleResults::radiansToMeters().
bool Isis::BundleSolutionInfo::outputResiduals | ( | ) |
Outputs image coordinate residuals to a csv file.
Definition at line 1580 of file BundleSolutionInfo.cpp.
References Isis::BundleResults::bundleControlPoints(), m_settings, and m_statisticsResults.
bool Isis::BundleSolutionInfo::outputText | ( | ) |
Outputs a text file with the results of the BundleAdjust.
Definition at line 1287 of file BundleSolutionInfo.cpp.
References Isis::BundleResults::bundleControlPoints(), Isis::BundleResults::converged(), m_settings, m_statisticsResults, Isis::BundleResults::maxSigmaLatitudeDistance(), Isis::BundleResults::maxSigmaLatitudePointId(), Isis::BundleResults::maxSigmaLongitudeDistance(), Isis::BundleResults::maxSigmaLongitudePointId(), Isis::BundleResults::maxSigmaRadiusDistance(), Isis::BundleResults::maxSigmaRadiusPointId(), Isis::Distance::meters(), Isis::BundleResults::minSigmaLatitudeDistance(), Isis::BundleResults::minSigmaLatitudePointId(), Isis::BundleResults::minSigmaLongitudeDistance(), Isis::BundleResults::minSigmaLongitudePointId(), Isis::BundleResults::minSigmaRadiusDistance(), Isis::BundleResults::minSigmaRadiusPointId(), Isis::BundleResults::observations(), outputHeader(), Isis::BundleResults::radiansToMeters(), Isis::BundleResults::setCorrMatImgsAndParams(), Isis::BundleResults::sigmaLatitudeStatisticsRms(), Isis::BundleResults::sigmaLongitudeStatisticsRms(), and Isis::BundleResults::sigmaRadiusStatisticsRms().
PvlObject Isis::BundleSolutionInfo::pvlObject | ( | QString | resultsName = "BundleSolutionInfo" , |
QString | settingsName = "InputSettings" , |
||
QString | statisticsName = "StatisticsResults" |
||
) |
Writes the results from BundleAdjust to a Pvl.
resultsName | The name of the results |
settingsName | The name of the settings |
statisticsName | The name of the statistics |
Definition at line 194 of file BundleSolutionInfo.cpp.
References bundleResults(), bundleSettings(), controlNetworkFileName(), m_controlNetworkFileName, Isis::BundleResults::pvlObject(), and runTime().
QDataStream & Isis::BundleSolutionInfo::read | ( | QDataStream & | stream | ) |
Reads the data from the stream.
stream | The stream we are reading from |
Definition at line 1688 of file BundleSolutionInfo.cpp.
References controlNetworkFileName(), id(), m_controlNetworkFileName, m_id, m_runTime, m_settings, and m_statisticsResults.
Referenced by Isis::operator>>().
QString Isis::BundleSolutionInfo::runTime | ( | ) | const |
Returns the run time.
Definition at line 480 of file BundleSolutionInfo.cpp.
References m_runTime.
Referenced by Isis::Project::addBundleSolutionInfo(), pvlObject(), save(), Isis::ProjectItem::setBundleSolutionInfo(), and setRunTime().
void Isis::BundleSolutionInfo::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot | ||
) | const |
Saves the BundleSolutionInfo to the project.
Output format:
<image id="..." filename="..."> ... </image>
(fileName attribute is just the base name)
stream | The stream to which the BundleSolutionInfo will be saved |
project | The project to which this BundleSolutionInfo will be saved |
newProjectRoot | The location of the project root directory. This is not used. |
Definition at line 226 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_images, m_settings, m_statisticsResults, runTime(), and Isis::BundleResults::save().
void Isis::BundleSolutionInfo::save | ( | QXmlStreamWriter & | stream, |
const Project * | project | ||
) | const |
Saves the BundleSolutionInfo to the project.
stream | The stream to which the BundleSolutionInfo will be saved |
project | The project to which this BundleSolutionInfo will be saved |
Definition at line 263 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_images, m_settings, m_statisticsResults, runTime(), and Isis::BundleResults::save().
void Isis::BundleSolutionInfo::setOutputStatistics | ( | BundleResults | statisticsResults | ) |
Sets the stat results.
statisticsResults | The new BundleResults |
Definition at line 179 of file BundleSolutionInfo.cpp.
References m_statisticsResults.
void Isis::BundleSolutionInfo::setRunTime | ( | QString | runTime | ) |
Sets the run time.
runTime | The run time. |
Definition at line 461 of file BundleSolutionInfo.cpp.
References m_runTime, and runTime().
Referenced by Isis::JigsawDialog::bundleFinished(), and Isis::BundleAdjust::bundleSolveInformation().
|
slot |
Change the on-disk file name for the control network used to be where the control network ought to be in the given project.
This method is modelled after the updateFileName() methods in Image and Control. Those methods close something (cubes for Image and a control net for control) but there is not a close method in BundleSolutionInfo.
project | The project that this BundleSolutionInfo is stored in |
Definition at line 302 of file BundleSolutionInfo.cpp.
References Isis::Project::cnetRoot(), and m_controlNetworkFileName.
QDataStream & Isis::BundleSolutionInfo::write | ( | QDataStream & | stream | ) | const |
Writes the data to the stream.
stream | The stream we are writing to and returning |
Definition at line 1669 of file BundleSolutionInfo.cpp.
References m_controlNetworkFileName, m_id, m_runTime, m_settings, and m_statisticsResults.
Referenced by Isis::operator<<().
|
private |
The name of the control network.
Definition at line 194 of file BundleSolutionInfo.h.
Referenced by BundleSolutionInfo(), controlNetworkFileName(), createH5File(), openH5File(), operator=(), outputHeader(), pvlObject(), read(), save(), updateFileName(), write(), and ~BundleSolutionInfo().
|
private |
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when saving to disk).
Definition at line 192 of file BundleSolutionInfo.h.
Referenced by BundleSolutionInfo(), id(), operator=(), read(), save(), write(), and ~BundleSolutionInfo().
The list of images that were adjusted.
Definition at line 197 of file BundleSolutionInfo.h.
Referenced by BundleSolutionInfo(), createH5File(), openH5File(), operator=(), save(), and ~BundleSolutionInfo().
|
private |
The run time of the bundle adjust.
Definition at line 193 of file BundleSolutionInfo.h.
Referenced by BundleSolutionInfo(), createH5File(), openH5File(), operator=(), read(), runTime(), setRunTime(), and write().
|
private |
The settings from the bundle adjust.
Definition at line 195 of file BundleSolutionInfo.h.
Referenced by bundleSettings(), BundleSolutionInfo(), createH5File(), openH5File(), operator=(), outputHeader(), outputImagesCSV(), outputImagesCSVHeader(), outputPointsCSV(), outputResiduals(), outputText(), read(), save(), and write().
|
private |
The results of the bundle adjust.
Definition at line 196 of file BundleSolutionInfo.h.
Referenced by bundleResults(), BundleSolutionInfo(), createH5File(), openH5File(), operator=(), outputHeader(), outputImagesCSV(), outputPointsCSV(), outputResiduals(), outputText(), read(), save(), setOutputStatistics(), write(), and ~BundleSolutionInfo().
U.S. Department of the Interior | U.S. Geological Survey ISIS | Privacy & Disclaimers | Astrogeology Research Program To contact us, please post comments and questions on the ISIS Support Center File Modified: 07/12/2023 23:35:33 |