27 #include "../raster/Band.h" 28 #include "../raster/BandProperty.h" 29 #include "../raster/Grid.h" 30 #include "../raster/Raster.h" 31 #include "../raster/RasterFactory.h" 38 : m_mixtureModelStrategyParamsPtr(0)
134 m_rInfoError.clear();
135 m_outputRasterPtr.reset();
136 m_errorRasterPtr.reset();
137 m_normalizeOutput =
false;
140 m_createErrorRaster =
false;
157 m_min = params.
m_min;
158 m_max = params.
m_max;
186 std::vector<te::rst::Raster*> outputRaster;
188 std::vector<te::rst::BandProperty*> bandsProperties;
189 std::map<std::string, std::vector<double> >::iterator it;
204 newbprop->
m_description =
"Mixture model band for class " + it->first;
206 bandsProperties.push_back(newbprop);
214 "Output raster creation error");
218 std::vector<te::rst::BandProperty*> bandsPropertiesError;
230 newbprop->
m_description =
"Error raster for class " + it->first;
232 bandsPropertiesError.push_back(newbprop);
239 "Error raster creation error");
251 "Unable to initialize the mixture model strategy");
256 "Unable to execute the mixture model strategy");
258 strategyPtr->getMinMax(outputParamsPtr->
m_min, outputParamsPtr->
m_max);
287 "Invalid raster bands number");
292 TERP_LOGWARN(
"No information about sensors were provided, using defaults.");
297 "Invalid raster bands number");
304 "Invalid raster bands" );
307 std::map<std::string, std::vector<double> >::const_iterator it;
311 "Endmember's number of channels is bigger from input raster bands number");
315 "Number of components must be equal to the number of selected bands");
336 "Unable to initialize the mixture model strategy");
338 "Unable to generate transform matrix ");
339 strategyPtr->getTransformMatrix(transfMatrix);
void reset()
Reset all variables.
std::vector< double > m_min
Minimun value calculeted in output raster.
Raster decomposition using mixture model.
Index into a lookup table.
std::map< std::string, std::string > m_rInfoError
The necessary information to create the error raster (as described in te::raster::RasterFactory).
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
A raster band description.
Base exception class for plugin module.
#define TERP_LOGWARN(message)
Logs a warning message.
std::unique_ptr< te::rst::Raster > m_errorRasterPtr
A pointer to the generated output error raster, one band per component plus one error band per compon...
Raster Processing algorithm output parameters base interface.
bool m_instanceInitialized
Is this instance already initialized?
int m_type
The data type of the elements in the band ( See te::dt namespace basic data types for reference )...
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
Raster mixture model strategy factory base class.
double m_normalMax
Upper limit to normalized.
double m_normalMin
Lower limit to normalized.
#define TERP_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged and a return of context wi...
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
std::map< std::string, std::string > m_rInfo
The necessary information to create the output raster (as described in te::raster::RasterFactory).
std::vector< double > m_max
Maximum value calculeted in output raster.
MixtureModel::InputParameters m_inputParameters
Mixture model execution parameters.
bool m_normalizeOutput
A flag to indicate that output raster will be normalized , default [0, 1].
std::vector< double > m_minerror
Minimun value calculeted in output raster.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
BandProperty * getProperty()
Returns the band property.
Raster strategy parameters base class.
bool generateTransformMatrix(boost::numeric::ublas::matrix< double > &matrix)
Generates a Transform Matrix.
std::vector< double > m_maxerror
Maximum value calculeted in output raster.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
Grid * getGrid()
It returns the raster grid.
static te::rp::MixtureModelStrategy * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
Abstract parameters base interface.
MixtureModel output parameters.
te::common::AbstractParameters * clone() const
Copy paramters.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the mixing model using the parameters defined in inputParams and outputParams.
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the generated output raster, one band per component plus one error band per component (w...
bool isInitialized() const
Model already initialized?
static Raster * make()
It creates and returns an empty raster with default raster driver.
const MixtureModel::OutputParameters & operator=(const MixtureModel::OutputParameters ¶ms)
assigment operator
Raster mixture model strategy base class.
Raster Processing functions.
int getType() const
It returns the data type of the elements in the band.
std::string m_description
A description.
bool m_createErrorRaster
A flag to indicate that output raster will include the error bands.
bool initialize(const AlgorithmInputParameters &inputParams)
Initializes model with paramters defined in inputParams.
A rectified grid is the spatial support for raster data.
ColorInterp m_colorInterp
The color interpretation.
void reset()
Resets all variables.
virtual AbstractParameters * clone() const =0
Create a clone copy of this instance.
OutputParameters()
Default constructor.