Isis Developer Reference
OverlapStatistics.h
Go to the documentation of this file.
1 #ifndef OverlapStatistics_h
2 #define OverlapStatistics_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include "Cube.h"
10 #include "FileName.h"
11 #include "MultivariateStatistics.h"
12 #include "Projection.h"
13 
14 namespace 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
Isis::Brick::SetBasePosition
void SetBasePosition(const int start_sample, const int start_line, const int start_band)
This method is used to set the base position of the shape buffer.
Definition: Brick.h:120
Isis::OverlapStatistics::EndSampleY
int EndSampleY() const
Returns the ending sample position of the overlap in the second cube.
Definition: OverlapStatistics.h:201
Isis::OverlapStatistics::StartSampleX
int StartSampleX() const
Returns the starting sample position of the overlap in the first cube.
Definition: OverlapStatistics.h:156
FileName.h
ProjectionFactory.h
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Cube.h
Isis::operator<<
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Definition: Hillshade.cpp:314
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::Progress::CheckStatus
void CheckStatus()
Checks and updates the status.
Definition: Progress.cpp:105
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::Average
Functor for reduce using average functionality.
Definition: Reduce.h:107
Isis::OverlapStatistics::Samples
int Samples() const
Returns the number of samples in the overlapping area.
Definition: OverlapStatistics.h:129
Isis::OverlapStatistics::HasOverlap
bool HasOverlap(int band) const
Checks the specified band for an overlap.
Definition: OverlapStatistics.h:76
Isis::OverlapStatistics::SampPercent
double SampPercent() const
Returns the percentage of cube lines sampled.
Definition: OverlapStatistics.h:147
Isis::Cube::read
void read(Blob &blob, const std::vector< PvlKeyword > keywords=std::vector< PvlKeyword >()) const
This method will read data from the specified Blob object.
Definition: Cube.cpp:807
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::MultivariateStatistics::ValidPixels
BigInt ValidPixels() const
Returns the number of valid pixels processed.
Definition: MultivariateStatistics.cpp:201
Isis::Progress::SetMaximumSteps
void SetMaximumSteps(const int steps)
This sets the maximum number of steps in the process.
Definition: Progress.cpp:85
Isis::Buffer::DoubleBuffer
double * DoubleBuffer() const
Returns the value of the shape buffer.
Definition: Buffer.h:138
PvlGroup.h
Isis::Progress::AddSteps
void AddSteps(const int steps)
If the initial step size was a guess, it can be modified using this method.
Definition: Progress.cpp:199
Isis::OverlapStatistics::Bands
int Bands() const
Returns the number of bands both cubes have.
Definition: OverlapStatistics.h:138
Isis::Projection::ToProjectionY
double ToProjectionY(const double worldY) const
This method converts a world y value to a projection y value.
Definition: Projection.cpp:650
Isis::PvlObject::addObject
void addObject(const PvlObject &object)
Add a PvlObject.
Definition: PvlObject.h:307
Isis::OverlapStatistics::HasOverlap
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
Isis::Brick
Buffer for containing a three dimensional section of an image.
Definition: Brick.h:45
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::OverlapStatistics::StartLineX
int StartLineX() const
Returns the starting line position of the overlap in the first cube.
Definition: OverlapStatistics.h:174
Isis::OverlapStatistics::toPvl
PvlObject toPvl(QString name="OverlapStatistics") const
Creates a Pvl containing the following Overlap Statistics information File1 File2 Width Height Bands ...
Definition: OverlapStatistics.cpp:192
Isis::OverlapStatistics::EndSampleX
int EndSampleX() const
Returns the ending sample position of the overlap in the first cube.
Definition: OverlapStatistics.h:165
Isis::OverlapStatistics::EndLineY
int EndLineY() const
Returns the ending line position of the overlap in the second cube.
Definition: OverlapStatistics.h:219
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::OverlapStatistics::FileNameY
Isis::FileName FileNameY() const
Returns the filename of the second cube.
Definition: OverlapStatistics.h:96
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::MultivariateStatistics
Container of multivariate statistics.
Definition: MultivariateStatistics.h:54
Isis::OverlapStatistics::Lines
int Lines() const
Returns the number of lines in the overlapping area.
Definition: OverlapStatistics.h:120
Isis::Progress::SetText
void SetText(const QString &text)
Changes the value of the text string reported just before 0% processed.
Definition: Progress.cpp:61
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::Projection::ToWorldY
double ToWorldY(const double projectionY) const
This method converts a projection y value to a world y value.
Definition: Projection.cpp:594
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::OverlapStatistics::StartLineY
int StartLineY() const
Returns the starting line position of the overlap in the second cube.
Definition: OverlapStatistics.h:210
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Cube::bandCount
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition: Cube.cpp:1410
Isis::OverlapStatistics::IsValid
bool IsValid(unsigned int band) const
Returns whether the overlap meets the minimum valid pixel requirement.
Definition: OverlapStatistics.h:244
Isis::Progress
Program progress reporter.
Definition: Progress.h:42
Isis::PvlKeyword::setValue
void setValue(QString value, QString unit="")
Sets new values.
Definition: PvlKeyword.cpp:155
MultivariateStatistics.h
Isis::OverlapStatistics::OverlapStatistics
OverlapStatistics(Isis::Cube &x, Isis::Cube &y, QString progressMsg="Gathering Overlap Statistics", double sampPercent=100.0)
Constructs an OverlapStatistics object.
Definition: OverlapStatistics.cpp:51
Isis::PvlObject::addGroup
void addGroup(const Isis::PvlGroup &group)
Add a group to the object.
Definition: PvlObject.h:186
Brick.h
IException.h
Isis::OverlapStatistics::SetMincount
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
Isis::operator<<
std::ostream & operator<<(std::ostream &os, Isis::OverlapStatistics &stats)
Creates a pvl of various useful data obtained by the overlap statistics class.
Definition: OverlapStatistics.cpp:357
std
Namespace for the standard library.
Isis::Cube::pixelType
PixelType pixelType() const
Definition: Cube.cpp:1758
Isis::Projection::ToWorldX
double ToWorldX(const double projectionX) const
This method converts a projection x value to a world x value.
Definition: Projection.cpp:566
Isis::Projection::ToProjectionX
double ToProjectionX(const double worldX) const
This method converts a world x value to a projection x value.
Definition: Projection.cpp:622
Isis::OverlapStatistics
Calculates statistics in the area of overlap between two projected cubes.
Definition: OverlapStatistics.h:61
PvlKeyword.h
Isis::OverlapStatistics::EndLineX
int EndLineX() const
Returns the ending line position of the overlap in the first cube.
Definition: OverlapStatistics.h:183
PvlObject.h
Projection.h
Isis::OverlapStatistics::StartSampleY
int StartSampleY() const
Returns the starting sample position of the overlap in the second cube.
Definition: OverlapStatistics.h:192
Isis::OverlapStatistics::FileNameX
Isis::FileName FileNameX() const
Returns the filename of the first cube.
Definition: OverlapStatistics.h:87
OverlapStatistics.h
Isis::Projection
Base class for Map Projections.
Definition: Projection.h:155
Progress.h
Isis::Cube::projection
Projection * projection()
Definition: Cube.cpp:1794
Isis::OverlapStatistics::GetMStats
Isis::MultivariateStatistics GetMStats(int band) const
Returns the MultivariateStatistics object containing all the data from both cubes in the overlapping ...
Definition: OverlapStatistics.h:111
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::OverlapStatistics::MinCount
int MinCount() const
Definition: OverlapStatistics.h:233