USGS

Isis 3.0 Developer's Reference (API)

Home

OverlapStatistics.h

Go to the documentation of this file.
00001 #ifndef OverlapStatistics_h
00002 #define OverlapStatistics_h
00003 
00025 #include "Cube.h"
00026 #include "FileName.h"
00027 #include "Projection.h"
00028 #include "MultivariateStatistics.h"
00029 
00030 namespace Isis {
00031   class PvlObject;
00070   class OverlapStatistics {
00071     public:
00072       OverlapStatistics(Isis::Cube &x, Isis::Cube &y,
00073                         QString progressMsg = "Gathering Overlap Statistics",
00074                         double sampPercent = 100.0);
00075 
00084       bool HasOverlap(int band) const {
00085         return (p_stats[band-1].ValidPixels() > 0);
00086       };
00087 
00088       bool HasOverlap() const;
00089 
00095       Isis::FileName FileNameX() const {
00096         return p_xFile;
00097       };
00098 
00104       Isis::FileName FileNameY() const {
00105         return p_yFile;
00106       };
00107 
00119       Isis::MultivariateStatistics GetMStats(int band) const {
00120         return p_stats[band-1];
00121       };
00122 
00128       int Lines() const {
00129         return p_lineRange;
00130       };
00131 
00137       int Samples() const {
00138         return p_sampRange;
00139       };
00140 
00146       int Bands() const {
00147         return p_bands;
00148       };
00149 
00155       double SampPercent() const {
00156         return p_sampPercent;
00157       };
00158 
00164       int StartSampleX() const {
00165         return p_minSampX;
00166       };
00167 
00173       int EndSampleX() const {
00174         return p_maxSampX;
00175       };
00176 
00182       int StartLineX() const {
00183         return p_minLineX;
00184       };
00185 
00191       int EndLineX() const {
00192         return p_maxLineX;
00193       };
00194 
00200       int StartSampleY() const {
00201         return p_minSampY;
00202       };
00203 
00209       int EndSampleY() const {
00210         return p_maxSampY;
00211       };
00212 
00218       int StartLineY() const {
00219         return p_minLineY;
00220       };
00221 
00227       int EndLineY() const {
00228         return p_maxLineY;
00229       };
00230 
00237       void SetMincount(unsigned int mincnt) {
00238         p_mincnt = mincnt;
00239       };
00240 
00248       bool IsValid(unsigned int band) const {
00249         return GetMStats(band).ValidPixels() > p_mincnt;
00250       };
00251 
00285       PvlObject toPvl() const;
00286 
00287 
00288     private:
00289       int p_bands;               
00290       double p_sampPercent;      
00291       Isis::FileName p_xFile;    
00292       Isis::FileName p_yFile;    
00293       int p_sampRange;           
00294       int p_lineRange;           
00295       int p_minSampX;            
00296       int p_maxSampX;            
00297       int p_minSampY;            
00298       int p_maxSampY;            
00299       int p_minLineX;            
00300       int p_maxLineX;            
00301       int p_minLineY;            
00302       int p_maxLineY;            
00303       int p_mincnt;              
00304 
00306       std::vector<Isis::MultivariateStatistics> p_stats;
00307   };
00308   std::ostream &operator<<(std::ostream &os, Isis::OverlapStatistics &stats);
00309 };
00310 
00311 #endif