Extraction of attributes from Raster, Bands, and Polygons. More...
#include <RasterAttributes.h>
Public Member Functions | |
bool | execute (AlgorithmOutputParameters &outputParams) _NOEXCEPT_OP(false) |
Executes the algorithm using the supplied parameters. More... | |
boost::numeric::ublas::matrix< std::complex< double > > | getComplexCovarianceMatrix (const std::vector< std::vector< std::complex< double > > > &vpixels, const std::vector< std::complex< double > > &vmeans) |
Returns the covariance matrix between vectors of pixel values. More... | |
te::stat::NumericStatisticalComplexSummary | getComplexStatistics (std::vector< std::complex< double > > &pixels) |
Returns several statistics from a set of pixels (real and imag). More... | |
std::vector< std::complex< double > > | getComplexValuesFromBand (const te::rst::Raster &raster, unsigned int band, const te::gm::Polygon &polygon) |
Returns the pixel values (real and imag) for the band, inside the polygon. More... | |
std::vector< std::vector< std::complex< double > > > | getComplexValuesFromRaster (const te::rst::Raster &raster, const te::gm::Polygon &polygon, std::vector< unsigned int > bands, unsigned int rowstep=1, unsigned int colstep=1) |
Returns the pixel values (real and imag) for all the bands in raster, inside the polygon. More... | |
boost::numeric::ublas::matrix< double > | getCovarianceMatrix (const std::vector< std::vector< double > > &vpixels, const std::vector< double > &vmeans) |
Returns the covariance matrix between vectors of pixel values. More... | |
const std::string & | getErrorMessage () const |
Return the current error message if there is any. More... | |
boost::numeric::ublas::matrix< double > | getGLCM (const te::rst::Raster &rin, unsigned int band, int dx, int dy, const te::gm::Polygon &polygon, double minPixel, double maxPixel, unsigned int gLevels=256) |
Computes the Gray-Level Co-occurrence Matrix (GLCM) from a raster band, inside the polygon. More... | |
boost::numeric::ublas::matrix< double > | getGLCM (const te::rst::Raster &rin, unsigned int band, int dx, int dy, double minPixel, double maxPixel, unsigned int gLevels=256) |
Computes the Gray-Level Co-occurrence Matrix (GLCM) from a raster band. More... | |
te::rp::Texture | getGLCMMetrics (boost::numeric::ublas::matrix< double > glcm, double noDataValue=0.0) |
Compute texture metrics from GLCM matrix. More... | |
te::stat::NumericStatisticalSummary | getStatistics (std::vector< double > &pixels) |
Returns several statistics from a set of pixels. More... | |
void | getStatisticsFromPolygon (const te::rst::Raster &raster, unsigned int band, const te::gm::Polygon &polygon, te::stat::NumericStatisticalSummary &summary, double noDataValue=0.0) |
Computes several statistics from a set of pixels inside a polygon. More... | |
std::vector< double > | getValuesFromBand (const te::rst::Raster &raster, unsigned int band, const te::gm::Polygon &polygon) |
Returns the pixel values for the band, inside the polygon. More... | |
void | getValuesFromBand (const te::rst::Raster &raster, unsigned int band, const te::gm::Polygon &polygon, std::map< double, int > &values) |
Returns the pixel values for the band, inside the polygon. More... | |
std::vector< std::vector< double > > | getValuesFromRaster (const te::rst::Raster &raster, const te::gm::Polygon &polygon, std::vector< unsigned int > bands, unsigned int rowstep=1, unsigned int colstep=1) |
Returns the pixel values for all the bands in raster, inside the polygon. More... | |
bool | initialize (const AlgorithmInputParameters &inputParams) _NOEXCEPT_OP(false) |
Initialize the algorithm instance making it ready for execution. More... | |
bool | isInitialized () const |
Returns true if the algorithm instance is initialized and ready for execution. More... | |
RasterAttributes (bool enableTaskProgress=true) | |
Public constructor. More... | |
void | reset () _NOEXCEPT_OP(false) |
Clear all internal allocated objects and reset the algorithm to its initial state. More... | |
~RasterAttributes () | |
Protected Member Functions | |
void | setErrorMessage (const std::string &newErrorMessage) |
Set the current error message. More... | |
Private Attributes | |
bool | m_enableTaskProgress |
std::string | m_errorMessage |
Current error message. More... | |
Extraction of attributes from Raster, Bands, and Polygons.
Definition at line 64 of file RasterAttributes.h.
te::rp::RasterAttributes::RasterAttributes | ( | bool | enableTaskProgress = true | ) |
Public constructor.
te::rp::RasterAttributes::~RasterAttributes | ( | ) |
|
virtual |
Executes the algorithm using the supplied parameters.
outputParams | Output parameters. |
Implements te::rp::Algorithm.
boost::numeric::ublas::matrix<std::complex <double> > te::rp::RasterAttributes::getComplexCovarianceMatrix | ( | const std::vector< std::vector< std::complex< double > > > & | vpixels, |
const std::vector< std::complex< double > > & | vmeans | ||
) |
Returns the covariance matrix between vectors of pixel values.
vpixels | The vector of pixel vectors, with vpixels[band][pixel]. |
vmeans | The vector of pixels means, one mean per vector of pixels. |
te::stat::NumericStatisticalComplexSummary te::rp::RasterAttributes::getComplexStatistics | ( | std::vector< std::complex< double > > & | pixels | ) |
Returns several statistics from a set of pixels (real and imag).
pixels | A vector of pixel values. |
std::vector<std::complex<double> > te::rp::RasterAttributes::getComplexValuesFromBand | ( | const te::rst::Raster & | raster, |
unsigned int | band, | ||
const te::gm::Polygon & | polygon | ||
) |
Returns the pixel values (real and imag) for the band, inside the polygon.
raster | The input raster. |
band | The position of the input band. |
polygon | The input polygon. |
std::vector<std::vector<std::complex<double> > > te::rp::RasterAttributes::getComplexValuesFromRaster | ( | const te::rst::Raster & | raster, |
const te::gm::Polygon & | polygon, | ||
std::vector< unsigned int > | bands, | ||
unsigned int | rowstep = 1 , |
||
unsigned int | colstep = 1 |
||
) |
Returns the pixel values (real and imag) for all the bands in raster, inside the polygon.
raster | The input band. |
polygon | The input polygon. |
bands | Bands to be processed from the input raster. |
boost::numeric::ublas::matrix<double> te::rp::RasterAttributes::getCovarianceMatrix | ( | const std::vector< std::vector< double > > & | vpixels, |
const std::vector< double > & | vmeans | ||
) |
Returns the covariance matrix between vectors of pixel values.
vpixels | The vector of pixel vectors, with vpixels[band][pixel]. |
vmeans | The vector of pixels means, one mean per vector of pixels. |
|
inherited |
Return the current error message if there is any.
boost::numeric::ublas::matrix<double> te::rp::RasterAttributes::getGLCM | ( | const te::rst::Raster & | rin, |
unsigned int | band, | ||
int | dx, | ||
int | dy, | ||
const te::gm::Polygon & | polygon, | ||
double | minPixel, | ||
double | maxPixel, | ||
unsigned int | gLevels = 256 |
||
) |
Computes the Gray-Level Co-occurrence Matrix (GLCM) from a raster band, inside the polygon.
rin | The input raster. |
band | The input band position. |
dx | The displacement in x direction, to be considered as neighborhood, can be a non zero value either + or -. |
dy | The displacement in y direction, to be considered as neighborhood, can be non zero value either + or -. |
polygon | The input polygon. |
minPixel | The minimum GL pixel value that occurs in the band (leave 0 for automatic detection). |
maxPixel | The maximum GL pixel value that occurs in the band (leave 0 for automatic detection). |
gLevels | The number of Gray Levels (GL) to normalize the GLCM. The GLs will be normalized to the interval [0,(gLevels - 1)]. It is important to emphasize that the matrix will have 'gLevels' lines and 'gLevels' columns. Default value is 256, normalizing the GLs to the interval [0, 255]. |
te::common::Exception | It will throw an exception for incorrect parameters or execution errors. |
boost::numeric::ublas::matrix<double> te::rp::RasterAttributes::getGLCM | ( | const te::rst::Raster & | rin, |
unsigned int | band, | ||
int | dx, | ||
int | dy, | ||
double | minPixel, | ||
double | maxPixel, | ||
unsigned int | gLevels = 256 |
||
) |
Computes the Gray-Level Co-occurrence Matrix (GLCM) from a raster band.
rin | The input raster. |
band | The input band position. |
dx | The displacement in x direction, to be considered as neighborhood, can be a non zero value either + or -. |
dy | The displacement in y direction, to be considered as neighborhood, can be non zero value either + or -. |
minPixel | The minimum GL pixel value that occurs in the band (leave 0 for automatic detection). |
maxPixel | The maximum GL pixel value that occurs in the band (leave 0 for automatic detection). |
gLevels | The number of Gray Levels (GL) to normalize the GLCM. The GLs will be normalized to the interval [0,(gLevels - 1)]. It is important to emphasize that the matrix will have 'gLevels' lines and 'gLevels' columns. Default value is 256, normalizing the GLs to the interval [0, 255]. |
te::common::Exception | It will throw an exception for incorrect parameters or execution errors. |
te::rp::Texture te::rp::RasterAttributes::getGLCMMetrics | ( | boost::numeric::ublas::matrix< double > | glcm, |
double | noDataValue = 0.0 |
||
) |
Compute texture metrics from GLCM matrix.
glcm | The input GLCM matrix. |
noDataValue | The value that will be used when the matrix received is empty, i. e., when the polygon does not intersects the raster. Default value is 0.0. |
te::stat::NumericStatisticalSummary te::rp::RasterAttributes::getStatistics | ( | std::vector< double > & | pixels | ) |
Returns several statistics from a set of pixels.
pixels | A vector of pixel values. |
void te::rp::RasterAttributes::getStatisticsFromPolygon | ( | const te::rst::Raster & | raster, |
unsigned int | band, | ||
const te::gm::Polygon & | polygon, | ||
te::stat::NumericStatisticalSummary & | summary, | ||
double | noDataValue = 0.0 |
||
) |
Computes several statistics from a set of pixels inside a polygon.
raster | The input raster. |
band | The number of the band to compute the statistics. |
polygon | The input polygon. |
summary | The statistical summary that will be filled by the method ( |
nodataValue | The value that will be used when the polygon does not intersects the raster. Default value is 0.0. |
std::vector<double> te::rp::RasterAttributes::getValuesFromBand | ( | const te::rst::Raster & | raster, |
unsigned int | band, | ||
const te::gm::Polygon & | polygon | ||
) |
Returns the pixel values for the band, inside the polygon.
raster | The input raster. |
band | The position of the input band. |
polygon | The input polygon. |
void te::rp::RasterAttributes::getValuesFromBand | ( | const te::rst::Raster & | raster, |
unsigned int | band, | ||
const te::gm::Polygon & | polygon, | ||
std::map< double, int > & | values | ||
) |
Returns the pixel values for the band, inside the polygon.
raster | The input raster. |
band | The position of the input band. |
polygon | The input polygon. |
values | A map with pixel values as key and the number of occurrence as value for the current band, inside the polygon. |
std::vector<std::vector<double> > te::rp::RasterAttributes::getValuesFromRaster | ( | const te::rst::Raster & | raster, |
const te::gm::Polygon & | polygon, | ||
std::vector< unsigned int > | bands, | ||
unsigned int | rowstep = 1 , |
||
unsigned int | colstep = 1 |
||
) |
Returns the pixel values for all the bands in raster, inside the polygon.
raster | The input band. |
polygon | The input polygon. |
bands | Bands to be processed from the input raster. |
|
virtual |
Initialize the algorithm instance making it ready for execution.
inputParams | Input parameters. |
Implements te::rp::Algorithm.
|
virtual |
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
|
virtual |
Clear all internal allocated objects and reset the algorithm to its initial state.
Reimplemented from te::rp::Algorithm.
|
protectedinherited |
Set the current error message.
newErrorMessage | New error message; |
|
private |
Definition at line 263 of file RasterAttributes.h.
|
privateinherited |
Current error message.
Definition at line 104 of file Algorithm.h.