Isis 3 Programmer Reference
|
This is a container for the correlation matrix that comes from a bundle adjust. More...
#include <CorrelationMatrix.h>
Public Member Functions | |
CorrelationMatrix () | |
Default Constructor. More... | |
CorrelationMatrix (PvlObject storedMatrixData) | |
This constructor will create a CorrelationMatrix object given a pvl. More... | |
CorrelationMatrix (const CorrelationMatrix &other) | |
Copy Constructor. More... | |
~CorrelationMatrix () | |
Destructor. More... | |
CorrelationMatrix & | operator= (const CorrelationMatrix &other) |
Equal Operator. More... | |
void | computeCorrelationMatrix () |
Read covariance matrix and compute correlation values This method reads the covariance matrix in from a file, one SparseBlockColumnMatrix at a time. More... | |
void | retrieveVisibleElements (int x, int y) |
Extract requested area from correlation matrix This method will open the correlation matrix file and read in the blocks that apply to the requested area. More... | |
bool | isValid () |
This is the public accessor for the list of elements that should be displayed in the current view. More... | |
bool | hasCovMat () |
Check if the correlation matrix has a covariance matrix This is used to make sure the covariance matrix exists. More... | |
void | setCorrelationFileName (FileName correlationFileName) |
Set the qmap of images and parameters. More... | |
void | setCovarianceFileName (FileName covarianceFileName) |
Set the qmap of images and parameters. More... | |
void | setImagesAndParameters (QMap< QString, QStringList > imagesAndParameters) |
Set the qmap of images and parameters. More... | |
SparseBlockColumnMatrix | correlationMatrixFromFile (QDataStream inStream) |
FileName | correlationFileName () |
Public access for the correlation matrix file name. More... | |
FileName | covarianceFileName () |
Public access for the covariance matrix file name. More... | |
QMap< QString, QStringList > * | imagesAndParameters () |
Public access for the qmap of images and parameters. More... | |
void | retrieveWholeMatrix () |
This method will read the matrix in from the file and hold on to the whole thing. More... | |
void | retrieveThreeVisibleBlocks () |
Display only part of a matrix This method will be used when the matrix is too big to display the whole thing. More... | |
QList< SparseBlockColumnMatrix > * | visibleBlocks () |
Get the visible part of the matrix. More... | |
PvlObject | pvlObject () |
This method creates a Pvl group with the information necessary to recreate this correlation matrix. More... | |
Private Attributes | |
QMap< QString, QStringList > * | m_imagesAndParameters |
This map holds the images used to create this matrix and their associated parameters. More... | |
FileName * | m_covarianceFileName |
FileName of the covariance matrix calculated when the bundle was run. More... | |
FileName * | m_correlationFileName |
FileName of the correlation matrix. More... | |
QList< double > * | m_diagonals |
List of the parameter values. More... | |
QList< SparseBlockColumnMatrix > * | m_visibleBlocks |
This will be the three blocks (or whole matrix depending on size) that apply to the given area. More... | |
This is a container for the correlation matrix that comes from a bundle adjust.
The bundle adjust will output the covariance matrix to a file. This class will read that file in and compute the correlation matrix. The entire correlation matrix will be written to a file and values will be read/displayed on an as-needed basis.
2014-05-02 Kimberly Oyama - Original version.
2014-07-23 Jeannie Backer - Added QDataStream >> and << operators and read/write methods. Created unitTest. Added new operators to assignments in copy constructor and operator= methods.
2015-10-14 Jeffrey Covington - Declared CorrelationMatrix as a Qt metatype for use with QVariant.
2016-06-06 Tyler Wilson - Fixed a problem with a PvlKeywordIterator not being incremented in the constructor which accepts a PvlObject. There was also an issue with a QMap data structure not being initialized, resulting in a segmentation fault. Also added testing for exceptions being thrown in this constructor, as well as the function computeCorrelationMatrix. Fixes #3997,3999.
2016-07-11 Jesse Mapel - Updated method names to meet coding standards. Fixes #4112.
2016-08-10 Jeannie Backer - Replaced boost matrix with Isis::LinearAlgebra::Matrix. References #4163.
Definition at line 72 of file CorrelationMatrix.h.
Isis::CorrelationMatrix::CorrelationMatrix | ( | ) |
Default Constructor.
Definition at line 21 of file CorrelationMatrix.cpp.
References m_correlationFileName, m_covarianceFileName, m_diagonals, m_imagesAndParameters, and m_visibleBlocks.
Isis::CorrelationMatrix::CorrelationMatrix | ( | PvlObject | storedMatrixData | ) |
This constructor will create a CorrelationMatrix object given a pvl.
Object = CorrelationMatrix
CovarianceFileName = fileName.dat CorrelationFileName = fileName.dat
Group = ImagesAndParameters Image1 = "Parameter1", "Parameter2", "..." Image2 = "Parameter1", "Parameter2", "..." Image3 = "Parameter1", "Parameter2", "..." End_Group
End_Object
storedMatrixData | A PvlObject containing data about the covariance/correlation matrix. |
IException::User | "This Pvl Object does not have the correct correlation information. The Object you are looking for is called CorrelationMatrixData" |
IException::User | "Could not find the Covariance Matrix .dat file name." |
IException::User | "Could not find the Correlation Matrix .dat file name." |
IException::User | "Could not get Images and Parameters from ImagesAndParameters group." |
Definition at line 59 of file CorrelationMatrix.cpp.
References _FILEINFO_, Isis::PvlObject::findGroup(), Isis::PvlObject::findKeyword(), m_correlationFileName, m_covarianceFileName, m_diagonals, m_imagesAndParameters, m_visibleBlocks, Isis::PvlContainer::name(), and Isis::IException::User.
Isis::CorrelationMatrix::CorrelationMatrix | ( | const CorrelationMatrix & | other | ) |
Copy Constructor.
other | The CorrelationMatrix to copy. |
Definition at line 117 of file CorrelationMatrix.cpp.
References m_correlationFileName, m_covarianceFileName, m_diagonals, m_imagesAndParameters, and m_visibleBlocks.
Isis::CorrelationMatrix::~CorrelationMatrix | ( | ) |
Destructor.
Definition at line 129 of file CorrelationMatrix.cpp.
References m_correlationFileName, m_covarianceFileName, m_diagonals, m_imagesAndParameters, and m_visibleBlocks.
void Isis::CorrelationMatrix::computeCorrelationMatrix | ( | ) |
Read covariance matrix and compute correlation values This method reads the covariance matrix in from a file, one SparseBlockColumnMatrix at a time.
It then stores the diagonal values from that column and computes the correlation values. The resulting SparseBlockMatrix is written to a new file, one SparseBlockColumnMatrix at a time.
IException::Progammer | "Cannot compute correlation matrix without a specified file name. Use setCorrelationFileName(FileName) before calling computeCorrelationMatrix()." |
Definition at line 195 of file CorrelationMatrix.cpp.
References _FILEINFO_, Isis::FileName::expanded(), isValid(), m_correlationFileName, m_covarianceFileName, m_diagonals, m_visibleBlocks, and Isis::IException::Programmer.
Referenced by Isis::MatrixViewWorkOrder::execute(), and Isis::MatrixViewWorkOrder::setupExecution().
FileName Isis::CorrelationMatrix::correlationFileName | ( | ) |
Public access for the correlation matrix file name.
Definition at line 388 of file CorrelationMatrix.cpp.
References m_correlationFileName.
Referenced by setCorrelationFileName().
FileName Isis::CorrelationMatrix::covarianceFileName | ( | ) |
Public access for the covariance matrix file name.
Definition at line 398 of file CorrelationMatrix.cpp.
References m_covarianceFileName.
Referenced by setCovarianceFileName().
bool Isis::CorrelationMatrix::hasCovMat | ( | ) |
Check if the correlation matrix has a covariance matrix This is used to make sure the covariance matrix exists.
If it doesn't this class is not valid. If this file exists, we can compute the correlation matrix.
Definition at line 327 of file CorrelationMatrix.cpp.
References m_covarianceFileName, and Isis::FileName::name().
QMap< QString, QStringList > * Isis::CorrelationMatrix::imagesAndParameters | ( | ) |
Public access for the qmap of images and parameters.
Definition at line 409 of file CorrelationMatrix.cpp.
References m_imagesAndParameters.
Referenced by Isis::MatrixSceneWidget::drawElements(), Isis::MatrixSceneWidget::drawGrid(), Isis::MatrixOptions::matrixImgsAndParams(), and setImagesAndParameters().
bool Isis::CorrelationMatrix::isValid | ( | ) |
This is the public accessor for the list of elements that should be displayed in the current view.
Definition at line 313 of file CorrelationMatrix.cpp.
References m_correlationFileName, m_covarianceFileName, and Isis::FileName::name().
Referenced by computeCorrelationMatrix(), Isis::MatrixViewWorkOrder::isExecutable(), and setCovarianceFileName().
CorrelationMatrix & Isis::CorrelationMatrix::operator= | ( | const CorrelationMatrix & | other | ) |
Equal Operator.
Should this call the copy constructor???
other | The matrix to assign to this matrix. |
Definition at line 155 of file CorrelationMatrix.cpp.
References m_correlationFileName, m_covarianceFileName, m_diagonals, m_imagesAndParameters, and m_visibleBlocks.
PvlObject Isis::CorrelationMatrix::pvlObject | ( | ) |
This method creates a Pvl group with the information necessary to recreate this correlation matrix.
Object = CorrelationMatrixData CovarianceMatrixFileName = /location/covarianceTmpFileName.dat CorrelationMatrixFileName = /location/correlationTmpFileName.dat
Group = ImagesAndParameters Image1Name = "Param1, Param2, ..., ParamN" ... ImageNName = "..." End_Group End_Object
Definition at line 468 of file CorrelationMatrix.cpp.
References Isis::FileName::expanded(), m_correlationFileName, m_covarianceFileName, and m_imagesAndParameters.
void Isis::CorrelationMatrix::retrieveThreeVisibleBlocks | ( | ) |
Display only part of a matrix This method will be used when the matrix is too big to display the whole thing.
It will read in the block we want to see and the two blocks for the diagonals that belong to the right images.
Definition at line 438 of file CorrelationMatrix.cpp.
void Isis::CorrelationMatrix::retrieveVisibleElements | ( | int | x, |
int | y | ||
) |
Extract requested area from correlation matrix This method will open the correlation matrix file and read in the blocks that apply to the requested area.
It will populate m_visibleElements.
x | first coordinate of the location in the matrix that the user wants to see. |
y | second coordinate of the location in the matrix that the user wants to see. |
Definition at line 281 of file CorrelationMatrix.cpp.
void Isis::CorrelationMatrix::retrieveWholeMatrix | ( | ) |
This method will read the matrix in from the file and hold on to the whole thing.
This will only be used when the matrix is small enough that this will be useful.
Definition at line 419 of file CorrelationMatrix.cpp.
void Isis::CorrelationMatrix::setCorrelationFileName | ( | FileName | correlationFileName | ) |
Set the qmap of images and parameters.
correlationFileName | The FileName of the stored correlation matrix data. |
Definition at line 337 of file CorrelationMatrix.cpp.
References correlationFileName(), and m_correlationFileName.
Referenced by setCovarianceFileName().
void Isis::CorrelationMatrix::setCovarianceFileName | ( | FileName | covarianceFileName | ) |
Set the qmap of images and parameters.
covarianceFileName | The FileName of the stored covariance matrix data. |
Definition at line 351 of file CorrelationMatrix.cpp.
References covarianceFileName(), Isis::FileName::expanded(), isValid(), m_covarianceFileName, and setCorrelationFileName().
Referenced by Isis::BundleResults::setCorrMatCovFileName().
void Isis::CorrelationMatrix::setImagesAndParameters | ( | QMap< QString, QStringList > | imagesAndParameters | ) |
Set the qmap of images and parameters.
imagesAndParameters | a QMap structure indexed by image keys, with an arbitrary set of parameters for each image. |
Definition at line 373 of file CorrelationMatrix.cpp.
References imagesAndParameters(), and m_imagesAndParameters.
Referenced by Isis::BundleResults::setCorrMatImgsAndParams().
QList< SparseBlockColumnMatrix > * Isis::CorrelationMatrix::visibleBlocks | ( | ) |
Get the visible part of the matrix.
Definition at line 446 of file CorrelationMatrix.cpp.
References m_visibleBlocks.
Referenced by Isis::MatrixSceneWidget::drawElements().
|
private |
FileName of the correlation matrix.
Definition at line 118 of file CorrelationMatrix.h.
Referenced by computeCorrelationMatrix(), correlationFileName(), CorrelationMatrix(), isValid(), operator=(), pvlObject(), setCorrelationFileName(), and ~CorrelationMatrix().
|
private |
FileName of the covariance matrix calculated when the bundle was run.
Definition at line 115 of file CorrelationMatrix.h.
Referenced by computeCorrelationMatrix(), CorrelationMatrix(), covarianceFileName(), hasCovMat(), isValid(), operator=(), pvlObject(), setCovarianceFileName(), and ~CorrelationMatrix().
|
private |
List of the parameter values.
Stored so we don't need to store all the SBCMs when calculating the correlation values.
Definition at line 124 of file CorrelationMatrix.h.
Referenced by computeCorrelationMatrix(), CorrelationMatrix(), operator=(), and ~CorrelationMatrix().
|
private |
This map holds the images used to create this matrix and their associated parameters.
Definition at line 112 of file CorrelationMatrix.h.
Referenced by CorrelationMatrix(), imagesAndParameters(), operator=(), pvlObject(), setImagesAndParameters(), and ~CorrelationMatrix().
|
private |
This will be the three blocks (or whole matrix depending on size) that apply to the given area.
Definition at line 130 of file CorrelationMatrix.h.
Referenced by computeCorrelationMatrix(), CorrelationMatrix(), operator=(), visibleBlocks(), and ~CorrelationMatrix().