27 #include "../common/STLUtils.h" 46 if(!connInfoStr.empty())
47 m_rasterSummaries.insert(std::map<std::string, RasterSummary*>::value_type(connInfoStr, summary));
54 std::map<std::string, RasterSummary*>::const_iterator it =
m_rasterSummaries.find(connInfoStr);
73 std::map<std::string, RasterSummary*>::const_iterator it =
m_rasterSummaries.find(connInfoStr);
103 0, 0, 0, 0, histoSize ) );
105 std::map<double, unsigned>::iterator it = bs.
m_histogramR->begin();
108 bs.
m_minVal =
new std::complex<double>(it->first, 0.0);
115 bs.
m_maxVal =
new std::complex<double>((--it)->first, 0.0);
123 0, 0, 0, 0, histoSize ) );
125 std::map<double, unsigned>::iterator it = bs.
m_histogramI->begin();
128 bs.
m_minVal =
new std::complex<double>(0.0, it->first);
135 bs.
m_maxVal =
new std::complex<double>(0.0, (--it)->first);
192 std::string connInfoStr;
194 std::map<std::string, std::string> connInfo = raster->
getInfo();
196 std::map<std::string, std::string>::iterator it = connInfo.begin();
198 while(it != connInfo.end())
200 connInfoStr += it->first;
202 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.
It gives access to values in one band (dimension) of a raster.
It describes one band (or dimension) of a raster.
std::complex< double > * m_minVal
The minimum occurring values (real and imaginary), default is std::numeric_limits<double>::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).
std::complex< double > * m_stdVal
The standard deviation of the occurring values (real and imaginary), default is 1.0.
const unsigned int getRealValuesRasterHistSize() const
Returns the current real values raster histogram size.
~RasterSummaryManager()
Destructor.
An abstract class for raster data strucutures.
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< std::string, std::string > getInfo() const =0
It returns additional information about the 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<double>::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.
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.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
Calculate the standard deviation value.
BandProperty * getProperty()
Returns the band property.
SummaryTypes
Types for the BandSummary.
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.
unsigned int m_realValuesRasterHistSize
Real values raster histogram size (default:255).
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
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. ...
int getType() const
It returns the data type of the elements in the band.
void setRealValuesRasterHistSize(const unsigned int newSize)
Set the real values raster histogram size.
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.