Raster classifier strategy base class. More...
#include <ClassifierStrategy.h>
Public Member Functions | |
| void | enableMultiThread (const bool &enable) |
| Enable / disable the use of multiple threads. | |
| void | enableOutputPalette (const bool enabled) |
| Enable (true) or disable (false) the creation of a paletted output raster. | |
| void | enableProgressInterface (const bool &enable) |
| Enable / disable the progress interface. | |
| void | enableRasterCache (const bool &enable) |
| Enable / disable the use of raster data cache. | |
| virtual bool | execute () _NOEXCEPT_OP(false)=0 |
| Executes the classification strategy. | |
| const std::string & | getErrorMessage () const |
| Return the current error message if there is any. | |
| void | getMetaData (std::map< std::string, std::string > &metadata) const |
| Returns strategy-dependent metadata. | |
| virtual ClassifierStrategyOutParameters const * | getOutputParameters () const |
| Returns a pointer to the strategy output execution parameters or a null pointer if there are none. | |
| virtual bool | initialize (ClassifierStrategyParameters const *const strategyParams) _NOEXCEPT_OP(false)=0 |
| Initialize the classification strategy. | |
| std::unique_ptr< te::rst::Raster > | releaseOutputRaster () |
| Returns a pointer to the output raster or a void pointer if there is none. | |
| void | setInputPolygons (const std::vector< te::gm::Polygon * > &polygonsPtrs) |
| Set the input polygons. | |
| void | setInputRaster (const te::rst::Raster &raster) |
| Set the input raster. | |
| void | setInputRasterBands (const std::vector< unsigned int > &rasterBands) |
| Set the input raste bandsr. | |
| void | setUserOutputPalette (std::vector< te::rst::BandProperty::ColorEntry > &userPalette) |
| Set the output user palette. | |
| virtual | ~ClassifierStrategy () |
| Virtual destructor. | |
Protected Member Functions | |
| ClassifierStrategy () | |
| Default constructor. | |
| bool | createOutputRaster (const std::vector< int > &bandsDataTypes, const std::vector< double > &noDataValues) |
| Create the output raster using the EXPANSIBLE driver. | |
| virtual void | reset () |
| Reset to an initial state. | |
| void | setErrorMessage (const std::string &newErrorMessage) |
| Set the current error message. | |
| bool | setOutputRasterPalette (const unsigned int size) |
| Create and set the output raster palette folowing the current internal settings. | |
Protected Attributes | |
| bool | m_createRasterPalette |
| Enable (true) or disable (false) the creation of a paletted output raster. | |
| bool | m_enableMultiThread |
| Enable or disable the use multipe threads. | |
| bool | m_enableRasterCache |
| Enable or disable the use a raster data cache. | |
| std::vector< te::gm::Polygon * > const * | m_inputPolygonsPtr |
| Input polygons. | |
| std::vector< unsigned int > | m_inputRasterBands |
| Input raster bands. | |
| te::rst::Raster const * | m_inputRasterPtr |
| A pointer to the input raster. | |
| std::map< std::string, std::string > | m_metaData |
| Strategy-dependent metadata. | |
| std::unique_ptr< te::rst::Raster > | m_outputRasterPtr |
| A pointer to the output raster. | |
| bool | m_progressInterfaceEnabled |
| Progress interface status. | |
| std::vector< te::rst::BandProperty::ColorEntry > | m_userOutputPalette |
| User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette. | |
Private Member Functions | |
| ClassifierStrategy (const ClassifierStrategy &rhs) | |
| Copy constructor. | |
| const ClassifierStrategy & | operator= (const ClassifierStrategy &rhs) |
| Assignment operator. | |
Private Attributes | |
| std::string | m_errorMessage |
| Current error message. | |
Raster classifier strategy base class.
Definition at line 49 of file ClassifierStrategy.h.
|
virtual |
Virtual destructor.
|
protected |
Default constructor.
References ClassifierStrategy().
Referenced by ClassifierStrategy(), ClassifierStrategy(), and operator=().
|
private |
|
protected |
Create the output raster using the EXPANSIBLE driver.
| bandsDataTypes | Bands data types. |
| noDataValues | A vector of no-data values for each band. |
References createOutputRaster().
Referenced by createOutputRaster().
| void te::rp::ClassifierStrategy::enableMultiThread | ( | const bool & | enable | ) |
Enable / disable the use of multiple threads.
| enable | Enable (true) or disable (false) the use of multiple threads. |
References enableMultiThread().
Referenced by enableMultiThread().
| void te::rp::ClassifierStrategy::enableOutputPalette | ( | const bool | enabled | ) |
Enable (true) or disable (false) the creation of a paletted output raster.
| enabled | Enable (true) or disable (false) the creation of a paletted output raster. |
References enableOutputPalette().
Referenced by enableOutputPalette().
| void te::rp::ClassifierStrategy::enableProgressInterface | ( | const bool & | enable | ) |
Enable / disable the progress interface.
| enable | Enable (true) or disable (false) the progress interface. |
References enableProgressInterface().
Referenced by enableProgressInterface().
| void te::rp::ClassifierStrategy::enableRasterCache | ( | const bool & | enable | ) |
Enable / disable the use of raster data cache.
| enable | Enable (true) or disable (false) the use of raster cache. |
References enableRasterCache().
Referenced by enableRasterCache().
|
pure virtual |
Executes the classification strategy.
Implemented in te::rp::ClassifierDummyStrategy, te::rp::ClassifierEDStrategy, te::rp::ClassifierEMStrategy, te::rp::ClassifierISODataStrategy, te::rp::ClassifierISOSegStrategy, te::rp::ClassifierKMeansStrategy, te::rp::ClassifierMAPStrategy, te::rp::ClassifierMaxLikelihoodStrategy, and te::rp::ClassifierSAMStrategy.
References _NOEXCEPT_OP.
| const std::string & te::rp::ClassifierStrategy::getErrorMessage | ( | ) | const |
Return the current error message if there is any.
References getErrorMessage().
Referenced by getErrorMessage().
| void te::rp::ClassifierStrategy::getMetaData | ( | std::map< std::string, std::string > & | metadata | ) | const |
Returns strategy-dependent metadata.
| metadata | Strategy-dependent metadata. |
References getMetaData().
Referenced by getMetaData().
|
virtual |
Returns a pointer to the strategy output execution parameters or a null pointer if there are none.
Reimplemented in te::rp::ClassifierMAPStrategy.
References getOutputParameters().
Referenced by getOutputParameters().
|
pure virtual |
Initialize the classification strategy.
| strategyParams | A pointer to the user given specific classification strategy parameters ou NULL if no parameters are present. |
Implemented in te::rp::ClassifierDummyStrategy, te::rp::ClassifierEDStrategy, te::rp::ClassifierEMStrategy, te::rp::ClassifierISODataStrategy, te::rp::ClassifierISOSegStrategy, te::rp::ClassifierKMeansStrategy, te::rp::ClassifierMAPStrategy, te::rp::ClassifierMaxLikelihoodStrategy, and te::rp::ClassifierSAMStrategy.
|
private |
Assignment operator.
| rhs | The right-hand-side copy that would be used to copy from. |
References ClassifierStrategy().
| std::unique_ptr< te::rst::Raster > te::rp::ClassifierStrategy::releaseOutputRaster | ( | ) |
Returns a pointer to the output raster or a void pointer if there is none.
References releaseOutputRaster().
Referenced by releaseOutputRaster().
|
protectedvirtual |
|
protected |
Set the current error message.
| newErrorMessage | New error message; |
References setErrorMessage().
Referenced by setErrorMessage().
| void te::rp::ClassifierStrategy::setInputPolygons | ( | const std::vector< te::gm::Polygon * > & | polygonsPtrs | ) |
Set the input polygons.
| polygonsPtrs | Input polygons pointers. |
References setInputPolygons().
Referenced by setInputPolygons().
| void te::rp::ClassifierStrategy::setInputRaster | ( | const te::rst::Raster & | raster | ) |
Set the input raster.
| raster | Input raster. |
References setInputRaster().
Referenced by setInputRaster().
| void te::rp::ClassifierStrategy::setInputRasterBands | ( | const std::vector< unsigned int > & | rasterBands | ) |
Set the input raste bandsr.
| rasterBands | Input raster bands. |
References setInputRasterBands().
Referenced by setInputRasterBands().
|
protected |
Create and set the output raster palette folowing the current internal settings.
| size | Palette size. |
References setOutputRasterPalette().
Referenced by setOutputRasterPalette().
| void te::rp::ClassifierStrategy::setUserOutputPalette | ( | std::vector< te::rst::BandProperty::ColorEntry > & | userPalette | ) |
Set the output user palette.
| userPalette | User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette. |
References setUserOutputPalette().
Referenced by setUserOutputPalette().
|
protected |
Enable (true) or disable (false) the creation of a paletted output raster.
Definition at line 172 of file ClassifierStrategy.h.
|
protected |
Enable or disable the use multipe threads.
Definition at line 167 of file ClassifierStrategy.h.
|
protected |
Enable or disable the use a raster data cache.
Definition at line 162 of file ClassifierStrategy.h.
|
private |
Current error message.
Definition at line 236 of file ClassifierStrategy.h.
|
protected |
Input polygons.
Definition at line 187 of file ClassifierStrategy.h.
|
protected |
Input raster bands.
Definition at line 182 of file ClassifierStrategy.h.
|
protected |
A pointer to the input raster.
Definition at line 152 of file ClassifierStrategy.h.
|
protected |
Strategy-dependent metadata.
Definition at line 192 of file ClassifierStrategy.h.
|
protected |
A pointer to the output raster.
Definition at line 177 of file ClassifierStrategy.h.
|
protected |
Progress interface status.
Definition at line 157 of file ClassifierStrategy.h.
|
protected |
User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette.
Definition at line 197 of file ClassifierStrategy.h.