Isis 3 Programmer Reference
OverlapStatistics.h
1#ifndef OverlapStatistics_h
2#define OverlapStatistics_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Cube.h"
10#include "FileName.h"
11#include "MultivariateStatistics.h"
12#include "Projection.h"
13
14namespace Isis {
15 class PvlObject;
16
62 public:
64 QString progressMsg = "Gathering Overlap Statistics",
65 double sampPercent = 100.0);
66 OverlapStatistics(const PvlObject &inStats);
67
76 bool HasOverlap(int band) const {
77 return (p_stats[band-1].ValidPixels() > 0);
78 };
79
80 bool HasOverlap() const;
81
88 return p_xFile;
89 };
90
97 return p_yFile;
98 };
99
112 return p_stats[band-1];
113 };
114
120 int Lines() const {
121 return p_lineRange;
122 };
123
129 int Samples() const {
130 return p_sampRange;
131 };
132
138 int Bands() const {
139 return p_bands;
140 };
141
147 double SampPercent() const {
148 return p_sampPercent;
149 };
150
156 int StartSampleX() const {
157 return p_minSampX;
158 };
159
165 int EndSampleX() const {
166 return p_maxSampX;
167 };
168
174 int StartLineX() const {
175 return p_minLineX;
176 };
177
183 int EndLineX() const {
184 return p_maxLineX;
185 };
186
192 int StartSampleY() const {
193 return p_minSampY;
194 };
195
201 int EndSampleY() const {
202 return p_maxSampY;
203 };
204
210 int StartLineY() const {
211 return p_minLineY;
212 };
213
219 int EndLineY() const {
220 return p_maxLineY;
221 };
222
229 void SetMincount(unsigned int mincnt) {
230 p_mincnt = mincnt;
231 };
232
233 int MinCount() const {
234 return p_mincnt;
235 }
236
244 bool IsValid(unsigned int band) const {
245 return GetMStats(band).ValidPixels() > p_mincnt;
246 };
247
291 PvlObject toPvl(QString name = "OverlapStatistics") const;
292
293
294 private:
295
296 void fromPvl(const PvlObject &inStats);
297 void init();
298
314
316 std::vector<Isis::MultivariateStatistics> p_stats;
317 };
318 std::ostream &operator<<(std::ostream &os, Isis::OverlapStatistics &stats);
319};
320
321#endif
IO Handler for Isis Cubes.
Definition Cube.h:168
File name manipulation and expansion.
Definition FileName.h:100
Container of multivariate statistics.
BigInt ValidPixels() const
Returns the number of valid pixels processed.
Calculates statistics in the area of overlap between two projected cubes.
int p_minLineX
Starting Line of overlap in X cube.
Isis::FileName FileNameY() const
Returns the filename of the second cube.
bool HasOverlap(int band) const
Checks the specified band for an overlap.
double SampPercent() const
Returns the percentage of cube lines sampled.
int p_minSampY
Starting Sample of overlap in Y cube.
int EndSampleX() const
Returns the ending sample position of the overlap in the first cube.
int Bands() const
Returns the number of bands both cubes have.
int StartSampleY() const
Returns the starting sample position of the overlap in the second cube.
bool HasOverlap() const
Checks all bands of the cubes for an overlap, and will only return false if none of the bands overlap...
void fromPvl(const PvlObject &inStats)
Unserialize overlap statistics from a Pvl.
int StartLineX() const
Returns the starting line position of the overlap in the first cube.
std::vector< Isis::MultivariateStatistics > p_stats
Multivariate Stats object for overlap data from both cubes.
int p_minSampX
Starting Sample of overlap in X cube.
Isis::MultivariateStatistics GetMStats(int band) const
Returns the MultivariateStatistics object containing all the data from both cubes in the overlapping ...
double p_sampPercent
Percentage of lines sampled.
int EndLineX() const
Returns the ending line position of the overlap in the first cube.
int p_sampRange
Sample range of overlap.
int p_mincnt
Minimum valid pixels to be valid overlap.
Isis::FileName FileNameX() const
Returns the filename of the first cube.
int p_maxSampY
Ending Sample of overlap in Y cube.
int p_maxLineX
Ending Line of overlap in X cube.
int Lines() const
Returns the number of lines in the overlapping area.
int StartLineY() const
Returns the starting line position of the overlap in the second cube.
void init()
Reset member variables to default values.
OverlapStatistics(Isis::Cube &x, Isis::Cube &y, QString progressMsg="Gathering Overlap Statistics", double sampPercent=100.0)
Constructs an OverlapStatistics object.
int p_maxSampX
Ending Sample of overlap in X cube.
int EndLineY() const
Returns the ending line position of the overlap in the second cube.
int p_lineRange
Line range of overlap.
int p_bands
Number of bands.
bool IsValid(unsigned int band) const
Returns whether the overlap meets the minimum valid pixel requirement.
Isis::FileName p_yFile
FileName of Y cube.
int Samples() const
Returns the number of samples in the overlapping area.
Isis::FileName p_xFile
FileName of X cube.
int EndSampleY() const
Returns the ending sample position of the overlap in the second cube.
PvlObject toPvl(QString name="OverlapStatistics") const
Creates a Pvl containing the following Overlap Statistics information File1 File2 Width Height Bands ...
void SetMincount(unsigned int mincnt)
Sets the minimum number of valid pixels for the overlap to be considered valid for PVL output.
int StartSampleX() const
Returns the starting sample position of the overlap in the first cube.
int p_minLineY
Starting Line of overlap in Y cube.
int p_maxLineY
Ending Line of overlap in Y cube.
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.