Isis 3 Programmer Reference
|
Calculates statistics in the area of overlap between two projected cubes. More...
#include <OverlapStatistics.h>
Public Member Functions | |
OverlapStatistics (Isis::Cube &x, Isis::Cube &y, QString progressMsg="Gathering Overlap Statistics", double sampPercent=100.0) | |
Constructs an OverlapStatistics object. More... | |
OverlapStatistics (const PvlObject &inStats) | |
Constructs an OverlapStatistics from a PvlObject. More... | |
bool | HasOverlap (int band) const |
Checks the specified band for an overlap. More... | |
bool | HasOverlap () const |
Checks all bands of the cubes for an overlap, and will only return false if none of the bands overlap. More... | |
Isis::FileName | FileNameX () const |
Returns the filename of the first cube. More... | |
Isis::FileName | FileNameY () const |
Returns the filename of the second cube. More... | |
Isis::MultivariateStatistics | GetMStats (int band) const |
Returns the MultivariateStatistics object containing all the data from both cubes in the overlapping area. More... | |
int | Lines () const |
Returns the number of lines in the overlapping area. More... | |
int | Samples () const |
Returns the number of samples in the overlapping area. More... | |
int | Bands () const |
Returns the number of bands both cubes have. More... | |
double | SampPercent () const |
Returns the percentage of cube lines sampled. More... | |
int | StartSampleX () const |
Returns the starting sample position of the overlap in the first cube. More... | |
int | EndSampleX () const |
Returns the ending sample position of the overlap in the first cube. More... | |
int | StartLineX () const |
Returns the starting line position of the overlap in the first cube. More... | |
int | EndLineX () const |
Returns the ending line position of the overlap in the first cube. More... | |
int | StartSampleY () const |
Returns the starting sample position of the overlap in the second cube. More... | |
int | EndSampleY () const |
Returns the ending sample position of the overlap in the second cube. More... | |
int | StartLineY () const |
Returns the starting line position of the overlap in the second cube. More... | |
int | EndLineY () const |
Returns the ending line position of the overlap in the second cube. More... | |
void | SetMincount (unsigned int mincnt) |
Sets the minimum number of valid pixels for the overlap to be considered valid for PVL output. More... | |
int | MinCount () const |
bool | IsValid (unsigned int band) const |
Returns whether the overlap meets the minimum valid pixel requirement. More... | |
PvlObject | toPvl (QString name="OverlapStatistics") const |
Creates a Pvl containing the following Overlap Statistics information File1 File2 Width Height Bands SamplingPercent MinCount MutlivariateStatisticsN (N = current band) Covariance Correlation SumXY ValidPixels InvalidPixels TotalPixels LinearRegression ValidOverlap XStatistics #FileX Statistics information YStatistics #FileY Statistics information File1 StartSample EndSample StartLine EndLine Average StandardDeviation Variance File2 StartSample EndSample StartLine EndLine Average StandardDeviation Variance. More... | |
Private Member Functions | |
void | fromPvl (const PvlObject &inStats) |
Unserialize overlap statistics from a Pvl. More... | |
void | init () |
Reset member variables to default values. More... | |
Private Attributes | |
int | p_bands |
Number of bands. More... | |
double | p_sampPercent |
Percentage of lines sampled. More... | |
Isis::FileName | p_xFile |
FileName of X cube. More... | |
Isis::FileName | p_yFile |
FileName of Y cube. More... | |
int | p_sampRange |
Sample range of overlap. More... | |
int | p_lineRange |
Line range of overlap. More... | |
int | p_minSampX |
Starting Sample of overlap in X cube. More... | |
int | p_maxSampX |
Ending Sample of overlap in X cube. More... | |
int | p_minSampY |
Starting Sample of overlap in Y cube. More... | |
int | p_maxSampY |
Ending Sample of overlap in Y cube. More... | |
int | p_minLineX |
Starting Line of overlap in X cube. More... | |
int | p_maxLineX |
Ending Line of overlap in X cube. More... | |
int | p_minLineY |
Starting Line of overlap in Y cube. More... | |
int | p_maxLineY |
Ending Line of overlap in Y cube. More... | |
int | p_mincnt |
Minimum valid pixels to be valid overlap. More... | |
std::vector< Isis::MultivariateStatistics > | p_stats |
Multivariate Stats object for overlap data from both cubes. More... | |
Calculates statistics in the area of overlap between two projected cubes.
This class finds the overlap between two cubes. It allows the user to check whether or not two cubes overlap, and also creates a MultivariateStatistics object containing the data from each cube in the overlapping area. The cubes entered into the constructor for this class must both be projections, and must have the same projection parameters.
If you would like to see OverlapStatistics being used in implementation, see equalizer.cpp
2005-11-18 Elizabeth Miller - added 1e-9 to the min and max values when computing the ranges to fix rounding issue
2006-01-12 Elizabeth Miller - removed unwanted print statements
2006-03-31 Elizabeth Miller - added unitTest
2006-04-03 Elizabeth Miller - added .001 to the min and max values when computing the ranges to re-fix rounding issue
2007-08-27 Steven Koechle - removed space from standard deviation keyword
2008-06-18 Steven Koechle - fixed Documentation Errors
2009-03-12 Travis Addair - added tracking for percent processed
2009-06-24 Travis Addair - optimized statistic gathering, changed PVL print-out for readability, and added functionality to allow the user to specify a "sampling percent" when gathering statistics to save processing time
2012-04-16 Jeannie Backer - Added forward declaration for PvlObject and ordered #includes in the implementation file. Added documentation.
2016-07-15 Ian Humphrey - Modified toPvl() method to get the internal multivariate statistics. Added init() method to initialize primitive members during construction. Added new constructor that creates an OverlapStatistics object from a PvlObject. Added private fromPvl() method to implement these details. Updated unitTest to test these changes. References #2282.
Definition at line 77 of file OverlapStatistics.h.
Isis::OverlapStatistics::OverlapStatistics | ( | Isis::Cube & | x, |
Isis::Cube & | y, | ||
QString | progressMsg = "Gathering Overlap Statistics" , |
||
double | sampPercent = 100.0 |
||
) |
Constructs an OverlapStatistics object.
Compares the two input cubes and finds where they overlap.
x | The first input cube |
y | The second input cube |
progressMsg | (Default value of "Gathering Overlap Statistics") Text for indicating progress during statistic gathering |
sampPercent | (Default value of 100.0) Sampling percent, or the percentage of lines to consider during the statistic gathering procedure |
Isis::IException::User | - All images must have the same number of bands |
Definition at line 67 of file OverlapStatistics.cpp.
References _FILEINFO_, Isis::Progress::AddSteps(), Isis::Cube::bandCount(), Isis::Progress::CheckStatus(), Isis::Cube::fileName(), Isis::Cube::lineCount(), Isis::Cube::pixelType(), Isis::Cube::projection(), Isis::Cube::read(), Isis::Cube::sampleCount(), Isis::Brick::SetBasePosition(), Isis::Progress::SetMaximumSteps(), Isis::Progress::SetText(), Isis::Projection::ToProjectionX(), Isis::Projection::ToProjectionY(), Isis::Projection::ToWorldX(), and Isis::Projection::ToWorldY().
Isis::OverlapStatistics::OverlapStatistics | ( | const PvlObject & | inStats | ) |
Constructs an OverlapStatistics from a PvlObject.
inStats | The serialized OverlapStatistics PvlObject |
Definition at line 48 of file OverlapStatistics.cpp.
|
inline |
Returns the number of bands both cubes have.
Definition at line 154 of file OverlapStatistics.h.
References p_bands.
Referenced by Isis::Equalization::fromPvl().
|
inline |
Returns the ending line position of the overlap in the first cube.
Definition at line 199 of file OverlapStatistics.h.
References p_maxLineX.
|
inline |
Returns the ending line position of the overlap in the second cube.
Definition at line 235 of file OverlapStatistics.h.
References p_maxLineY.
|
inline |
Returns the ending sample position of the overlap in the first cube.
Definition at line 181 of file OverlapStatistics.h.
References p_maxSampX.
|
inline |
Returns the ending sample position of the overlap in the second cube.
Definition at line 217 of file OverlapStatistics.h.
References p_maxSampY.
|
inline |
Returns the filename of the first cube.
Definition at line 103 of file OverlapStatistics.h.
References p_xFile.
Referenced by Isis::Equalization::fromPvl().
|
inline |
Returns the filename of the second cube.
Definition at line 112 of file OverlapStatistics.h.
References p_yFile.
Referenced by Isis::Equalization::fromPvl().
|
private |
Unserialize overlap statistics from a Pvl.
const | PvlObject & - The pvl object to initialize the overlap statistics with |
Definition at line 311 of file OverlapStatistics.cpp.
References Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), and Isis::toString().
|
inline |
Returns the MultivariateStatistics object containing all the data from both cubes in the overlapping area.
band | The band number the MultivariateStatistics object needs to contain data from |
Definition at line 127 of file OverlapStatistics.h.
References p_stats.
Referenced by Isis::Equalization::calculateOverlapStatistics(), Isis::Equalization::fromPvl(), and IsValid().
|
inline |
Checks the specified band for an overlap.
band | The band number of the cubes to be checked for an overlap |
Definition at line 92 of file OverlapStatistics.h.
References p_stats.
Referenced by Isis::Equalization::calculateOverlapStatistics().
bool Isis::OverlapStatistics::HasOverlap | ( | ) | const |
Checks all bands of the cubes for an overlap, and will only return false if none of the bands overlap.
Definition at line 191 of file OverlapStatistics.cpp.
|
private |
Reset member variables to default values.
Definition at line 348 of file OverlapStatistics.cpp.
|
inline |
Returns whether the overlap meets the minimum valid pixel requirement.
band | The band to check |
Definition at line 260 of file OverlapStatistics.h.
References GetMStats(), p_mincnt, and Isis::MultivariateStatistics::ValidPixels().
|
inline |
Returns the number of lines in the overlapping area.
Definition at line 136 of file OverlapStatistics.h.
References p_lineRange.
|
inline |
Returns the number of samples in the overlapping area.
Definition at line 145 of file OverlapStatistics.h.
References p_sampRange.
|
inline |
Returns the percentage of cube lines sampled.
Definition at line 163 of file OverlapStatistics.h.
References p_sampPercent.
|
inline |
Sets the minimum number of valid pixels for the overlap to be considered valid for PVL output.
mincnt | The minimum valid pixel value to set |
Definition at line 245 of file OverlapStatistics.h.
References p_mincnt.
Referenced by Isis::Equalization::calculateOverlapStatistics().
|
inline |
Returns the starting line position of the overlap in the first cube.
Definition at line 190 of file OverlapStatistics.h.
References p_minLineX.
|
inline |
Returns the starting line position of the overlap in the second cube.
Definition at line 226 of file OverlapStatistics.h.
References p_minLineY.
|
inline |
Returns the starting sample position of the overlap in the first cube.
Definition at line 172 of file OverlapStatistics.h.
References p_minSampX.
|
inline |
Returns the starting sample position of the overlap in the second cube.
Definition at line 208 of file OverlapStatistics.h.
References p_minSampY.
PvlObject Isis::OverlapStatistics::toPvl | ( | QString | name = "OverlapStatistics" | ) | const |
Creates a Pvl containing the following Overlap Statistics information File1 File2 Width Height Bands SamplingPercent MinCount MutlivariateStatisticsN (N = current band) Covariance Correlation SumXY ValidPixels InvalidPixels TotalPixels LinearRegression ValidOverlap XStatistics #FileX Statistics information YStatistics #FileY Statistics information File1 StartSample EndSample StartLine EndLine Average StandardDeviation Variance File2 StartSample EndSample StartLine EndLine Average StandardDeviation Variance.
Serialize overlap statistics as a PvlObject.
QString | name (Default value of "OverlapStatistics") Name of the PvlObject created |
Isis::IException::User | - Trivial overlap between [File1] and [File2] |
Definition at line 208 of file OverlapStatistics.cpp.
References _FILEINFO_, Isis::PvlObject::addGroup(), Isis::PvlObject::addObject(), Isis::PvlContainer::name(), Isis::PvlKeyword::setValue(), and Isis::toString().
Referenced by Isis::operator<<().
|
private |
|
private |
|
private |
Ending Line of overlap in X cube.
Definition at line 326 of file OverlapStatistics.h.
Referenced by EndLineX().
|
private |
Ending Line of overlap in Y cube.
Definition at line 328 of file OverlapStatistics.h.
Referenced by EndLineY().
|
private |
Ending Sample of overlap in X cube.
Definition at line 322 of file OverlapStatistics.h.
Referenced by EndSampleX().
|
private |
Ending Sample of overlap in Y cube.
Definition at line 324 of file OverlapStatistics.h.
Referenced by EndSampleY().
|
private |
Minimum valid pixels to be valid overlap.
Definition at line 329 of file OverlapStatistics.h.
Referenced by IsValid(), and SetMincount().
|
private |
Starting Line of overlap in X cube.
Definition at line 325 of file OverlapStatistics.h.
Referenced by StartLineX().
|
private |
Starting Line of overlap in Y cube.
Definition at line 327 of file OverlapStatistics.h.
Referenced by StartLineY().
|
private |
Starting Sample of overlap in X cube.
Definition at line 321 of file OverlapStatistics.h.
Referenced by StartSampleX().
|
private |
Starting Sample of overlap in Y cube.
Definition at line 323 of file OverlapStatistics.h.
Referenced by StartSampleY().
|
private |
Percentage of lines sampled.
Definition at line 316 of file OverlapStatistics.h.
Referenced by SampPercent().
|
private |
Sample range of overlap.
Definition at line 319 of file OverlapStatistics.h.
Referenced by Samples().
|
private |
Multivariate Stats object for overlap data from both cubes.
Definition at line 332 of file OverlapStatistics.h.
Referenced by GetMStats(), and HasOverlap().
|
private |
|
private |