27 #include "../common/STLUtils.h"
45 if(!connInfoStr.empty())
46 m_rasterSummaries.insert(std::map<std::string, RasterSummary*>::value_type(connInfoStr, summary));
53 std::map<std::string, RasterSummary*>::const_iterator it = m_rasterSummaries.find(connInfoStr);
55 if (it == m_rasterSummaries.end())
65 m_rasterSummaries.erase(connInfoStr);
72 std::map<std::string, RasterSummary*>::const_iterator it = m_rasterSummaries.find(connInfoStr);
76 if(it == m_rasterSummaries.end())
96 std::map<double, unsigned>::iterator it = bs.
m_histogramR->begin();
99 bs.
m_minVal =
new std::complex<double>(it->first, 0.0);
106 bs.
m_maxVal =
new std::complex<double>((--it)->first, 0.0);
115 std::map<double, unsigned>::iterator it = bs.
m_histogramI->begin();
118 bs.
m_minVal =
new std::complex<double>(0.0, it->first);
125 bs.
m_maxVal =
new std::complex<double>(0.0, (--it)->first);
150 m_rasterSummaries.clear();
159 std::string connInfoStr =
"";
161 std::map<std::string, std::string> connInfo = raster->
getInfo();
163 std::map<std::string, std::string>::iterator it = connInfo.begin();
165 while(it != connInfo.end())
167 connInfoStr += it->first;
169 connInfoStr += it->second;
Calculate the histogram for the imaginary part.
std::map< double, unsigned int > * m_histogramR
The histogram (a map of occurring values and frequency) of the real part of a band.
virtual std::map< std::string, std::string > getInfo() const =0
It returns additional information about the raster.
std::complex< double > * m_minVal
The minimum occurring values (real and imaginary), default is std::numeric_limits::min().
std::map< std::string, RasterSummary * > m_rasterSummaries
A map of rasters conn info and their respective summaries.
A singleton for keeping raster summaries (most statistics).
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
std::complex< double > * m_stdVal
The standard deviation of the occurring values (real and imaginary), default is 1.0.
~RasterSummaryManager()
Destructor.
virtual std::map< double, unsigned > getHistogramR(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
It computes and returns the histogram occurring values (real part) in a window of the band...
std::map< double, unsigned int > * m_histogramI
The histogram (a map of occurring values and frequency) of the imaginary part of a band...
void add(const Raster *raster, RasterSummary *summary)
Adds a new entry in the summary manager.
std::string getConnInfoStr(const te::rst::Raster *raster)
virtual std::map< double, unsigned > getHistogramI(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0, unsigned int b=0) const
It computes and returns the histogram occurring values (imaginary part) in a window of the band...
std::complex< double > * m_maxVal
The maximum occurring values (real and imaginary), default is std::numeric_limits::max().
virtual std::complex< double > getMaxValue(bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the maximum occurring value in a window of the band.
const RasterSummary * find(const Raster *raster) const
It searches for a raster summary.
An abstract class for raster data strucutures.
virtual std::complex< double > getStdValue(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the standard deviation of the occurring values in a window of the band...
An abstract class for raster data strucutures.
Calculate the standard deviation value.
SummaryTypes
Types for the BandSummary.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
RasterSummary is just a typedef of a boost::ptr_vector.
A summary of a raster band (most statistics).
boost::ptr_vector< BandSummary > RasterSummary
RasterSummary is just a typedef of a boost::ptr_vector.
It gives access to values in one band (dimension) of a raster.
const RasterSummary * get(const Raster *raster, const SummaryTypes st, bool readall=false)
It searches for a raster summary. If not found it creates the summary and returns it...
virtual std::complex< double > getMinValue(bool readall=false, unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the minimum occurring value in a window of the band.
virtual std::complex< double > getMeanValue(unsigned int rs=0, unsigned int cs=0, unsigned int rf=0, unsigned int cf=0) const
It computes and returns the mean of the occurring values in a window of the band. ...
RasterSummaryManager()
Constructor.
void remove(const Raster *raster)
Removes the summary from the specified raster.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
Calculate the mean value.
std::complex< double > * m_meanVal
The mean of the occurring values (real and imaginary), default is 0.0.
Calculate the histogram for the real part.