Isis Developer Reference
OverlapStatistics.h
Go to the documentation of this file.
1#ifndef OverlapStatistics_h
2#define OverlapStatistics_h
8/* SPDX-License-Identifier: CC0-1.0 */
9#include "Cube.h"
10#include "FileName.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
299 int p_bands;
300 double p_sampPercent;
301 Isis::FileName p_xFile;
302 Isis::FileName p_yFile;
303 int p_sampRange;
304 int p_lineRange;
305 int p_minSampX;
306 int p_maxSampX;
307 int p_minSampY;
308 int p_maxSampY;
309 int p_minLineX;
310 int p_maxLineX;
311 int p_minLineY;
312 int p_maxLineY;
313 int p_mincnt;
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.
Definition MultivariateStatistics.h:54
BigInt ValidPixels() const
Returns the number of valid pixels processed.
Definition MultivariateStatistics.cpp:201
Calculates statistics in the area of overlap between two projected cubes.
Definition OverlapStatistics.h:61
Isis::FileName FileNameY() const
Returns the filename of the second cube.
Definition OverlapStatistics.h:96
bool HasOverlap(int band) const
Checks the specified band for an overlap.
Definition OverlapStatistics.h:76
double SampPercent() const
Returns the percentage of cube lines sampled.
Definition OverlapStatistics.h:147
int EndSampleX() const
Returns the ending sample position of the overlap in the first cube.
Definition OverlapStatistics.h:165
int Bands() const
Returns the number of bands both cubes have.
Definition OverlapStatistics.h:138
int StartSampleY() const
Returns the starting sample position of the overlap in the second cube.
Definition OverlapStatistics.h:192
bool HasOverlap() const
Checks all bands of the cubes for an overlap, and will only return false if none of the bands overlap...
Definition OverlapStatistics.cpp:175
int StartLineX() const
Returns the starting line position of the overlap in the first cube.
Definition OverlapStatistics.h:174
Isis::MultivariateStatistics GetMStats(int band) const
Returns the MultivariateStatistics object containing all the data from both cubes in the overlapping ...
Definition OverlapStatistics.h:111
int EndLineX() const
Returns the ending line position of the overlap in the first cube.
Definition OverlapStatistics.h:183
Isis::FileName FileNameX() const
Returns the filename of the first cube.
Definition OverlapStatistics.h:87
int Lines() const
Returns the number of lines in the overlapping area.
Definition OverlapStatistics.h:120
int StartLineY() const
Returns the starting line position of the overlap in the second cube.
Definition OverlapStatistics.h:210
OverlapStatistics(Isis::Cube &x, Isis::Cube &y, QString progressMsg="Gathering Overlap Statistics", double sampPercent=100.0)
Constructs an OverlapStatistics object.
Definition OverlapStatistics.cpp:51
int EndLineY() const
Returns the ending line position of the overlap in the second cube.
Definition OverlapStatistics.h:219
bool IsValid(unsigned int band) const
Returns whether the overlap meets the minimum valid pixel requirement.
Definition OverlapStatistics.h:244
int MinCount() const
Definition OverlapStatistics.h:233
int Samples() const
Returns the number of samples in the overlapping area.
Definition OverlapStatistics.h:129
int EndSampleY() const
Returns the ending sample position of the overlap in the second cube.
Definition OverlapStatistics.h:201
PvlObject toPvl(QString name="OverlapStatistics") const
Creates a Pvl containing the following Overlap Statistics information File1 File2 Width Height Bands ...
Definition OverlapStatistics.cpp:192
void SetMincount(unsigned int mincnt)
Sets the minimum number of valid pixels for the overlap to be considered valid for PVL output.
Definition OverlapStatistics.h:229
int StartSampleX() const
Returns the starting sample position of the overlap in the first cube.
Definition OverlapStatistics.h:156
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.
Definition Hillshade.cpp:313