Isis 3.0 Programmer Reference
Back | Home
Isis::BundleSolutionInfo Class Reference

Container class for BundleAdjustment results. More...

#include <BundleSolutionInfo.h>

Inheritance diagram for Isis::BundleSolutionInfo:
Inheritance graph
Collaboration diagram for Isis::BundleSolutionInfo:
Collaboration graph

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...
 
BundleSolutionInfooperator= (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...
 
FileNamem_controlNetworkFileName
 The name of the control network. More...
 
BundleSettingsQsp m_settings
 The settings from the bundle adjust. More...
 
BundleResultsm_statisticsResults
 The results of the bundle adjust. More...
 
QList< ImageList * > * m_images
 The list of images that were adjusted. More...
 

Detailed Description

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.

Author
2014-07-08 Jeannie Backer
History:

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.

Constructor & Destructor Documentation

Isis::BundleSolutionInfo::BundleSolutionInfo ( BundleSettingsQsp  inputSettings,
FileName  controlNetworkFileName,
BundleResults  outputStatistics,
QObject parent = 0 
)

Constructor.

Creates a BundleSolutionInfo.

Parameters
inputSettingsThe settings saved in BundleSolutionInfo
controlNetworkFileNameThe file name and path of the control network
outputStatisticsThe results of the BundleAdjust
parentThe 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.

Parameters
projectThe current project
xmlReaderAn XML reader that's up to an <bundleSettings> tag.
parentThe Qt-relationship parent

Definition at line 67 of file BundleSolutionInfo.cpp.

References m_id.

Isis::BundleSolutionInfo::BundleSolutionInfo ( FileName  bundleSolutionInfoFile)

Constructor.

Creates a BundleSolutionInfo.

Parameters
bundleSolutionInfoFilename 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.

Parameters
srcBundleSolutionInfo 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.

Member Function Documentation

BundleResults Isis::BundleSolutionInfo::bundleResults ( )

Returns the bundle results.

Exceptions
IException::Unknown"Results for this bundle is NULL."
Returns
BundleResults The bundle results.

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.

Returns
BundleSettingsQsp 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.

Returns
QString 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.

Exceptions
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."
Parameters
outputFileNameThe 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.

Returns
QString A unique ID for 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.

Exceptions
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"
Parameters
bundleSolutionInfoFileThe 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.

Parameters
srcthe BundleSolutionInfo that we are comparing the current BundleSolutionInfo to.
Returns
BundleSolutionInfo Reference to the current BundleSolutionInfo

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.

Parameters
fpOutThe output stream that the header will be sent to.
Returns
bool If the header was successfully output to the output stream.
Exceptions
IException::Io"Failed to output residual percentiles for bundleout"
IException::Io"Failed to output residual box plot for bundleout"
Todo:
Determine how multiple sensor solve settings should be output.

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.

Returns
True upon success, False if something went wrong.
History:
2016-12-01 Ian Humphrey - Added s as second argument to sprintf() call to prevent -Wformat-security warning. Since image->fileName().toLatin1().data() returns a char* at runtime, the compiler does not know if it will contain format specifiers and produces the mentioned warning.

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.

Parameters
fpOutThe output file stream.
Returns
True if the write is successful, False otherwise.
History:
2016-12-08 Ian Humphrey - Removed conditions that handle TWIST headers differently than the other headers. The number of TWIST headers will be the same as each of the other angle headers. Fixes #4557.

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 ( )
bool Isis::BundleSolutionInfo::outputResiduals ( )

Outputs image coordinate residuals to a csv file.

Returns
bool If the residuals were successfully output.

Definition at line 1580 of file BundleSolutionInfo.cpp.

References Isis::BundleResults::bundleControlPoints(), m_settings, and m_statisticsResults.

PvlObject Isis::BundleSolutionInfo::pvlObject ( QString  resultsName = "BundleSolutionInfo",
QString  settingsName = "InputSettings",
QString  statisticsName = "StatisticsResults" 
)

Writes the results from BundleAdjust to a Pvl.

Parameters
resultsNameThe name of the results
settingsNameThe name of the settings
statisticsNameThe name of the statistics
Returns
PvlObject The PvlObject that we are writing to

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.

Parameters
streamThe stream we are reading from
Returns
QDataStream The stream we read 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.

Returns
QString 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)

Parameters
streamThe stream to which the BundleSolutionInfo will be saved
projectThe project to which this BundleSolutionInfo will be saved
newProjectRootThe 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.

Parameters
streamThe stream to which the BundleSolutionInfo will be saved
projectThe 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.

Parameters
statisticsResultsThe new BundleResults

Definition at line 179 of file BundleSolutionInfo.cpp.

References m_statisticsResults.

void Isis::BundleSolutionInfo::setRunTime ( QString  runTime)

Sets the run time.

Parameters
runTimeThe run time.

Definition at line 461 of file BundleSolutionInfo.cpp.

References m_runTime, and runTime().

Referenced by Isis::JigsawDialog::bundleFinished(), and Isis::BundleAdjust::bundleSolveInformation().

void Isis::BundleSolutionInfo::updateFileName ( Project project)
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.

Parameters
projectThe 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.

Parameters
streamThe stream we are writing to and returning
Returns
QDataStream The stream we wrote to

Definition at line 1669 of file BundleSolutionInfo.cpp.

References m_controlNetworkFileName, m_id, m_runTime, m_settings, and m_statisticsResults.

Referenced by Isis::operator<<().

Member Data Documentation

FileName* Isis::BundleSolutionInfo::m_controlNetworkFileName
private
QUuid* Isis::BundleSolutionInfo::m_id
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().

QList<ImageList *>* Isis::BundleSolutionInfo::m_images
private

The list of images that were adjusted.

Definition at line 197 of file BundleSolutionInfo.h.

Referenced by BundleSolutionInfo(), createH5File(), openH5File(), operator=(), save(), and ~BundleSolutionInfo().

QString Isis::BundleSolutionInfo::m_runTime
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().

BundleSettingsQsp Isis::BundleSolutionInfo::m_settings
private
BundleResults* Isis::BundleSolutionInfo::m_statisticsResults
private

The documentation for this class was generated from the following files:

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