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)
 
   44   : m_mixtureModelStrategyParamsPtr(0)
 
   58   if(m_mixtureModelStrategyParamsPtr)
 
   60     delete m_mixtureModelStrategyParamsPtr;
 
   61     m_mixtureModelStrategyParamsPtr = 0;
 
   69   return m_mixtureModelStrategyParamsPtr;
 
   75   m_inputRasterBands.clear();
 
   76   m_inputSensorBands.clear();
 
   78   m_strategyName.clear();
 
   80   if(m_mixtureModelStrategyParamsPtr)
 
   82     delete m_mixtureModelStrategyParamsPtr;
 
   83     m_mixtureModelStrategyParamsPtr = 0;
 
  128   m_outputRasterPtr.reset();
 
  129   m_normalizeOutput = 
false;
 
  130   m_createErrorRaster = 
false;
 
  162   if(!m_instanceInitialized)
 
  169   std::vector<te::rst::BandProperty*> bandsProperties;
 
  170   std::map<std::string, std::vector<double> >::iterator it;
 
  171   for (it = m_inputParameters.m_components.begin(); it != m_inputParameters.m_components.end(); it++)
 
  174       m_inputParameters.m_inputRasterBands[0])->getProperty()));
 
  178     newbprop->
m_description = 
"Mixture model band for class " + it->first;
 
  180     bandsProperties.push_back(newbprop);
 
  185     for (it = m_inputParameters.m_components.begin(); it != m_inputParameters.m_components.end(); it++)
 
  188         m_inputParameters.m_inputRasterBands[0])->getProperty()));
 
  192       newbprop->
m_description = 
"Error raster for class " + it->first;
 
  194       bandsProperties.push_back(newbprop);
 
  203     "Output raster creation error");
 
  205   if (m_inputParameters.m_inputSensorBands.size() == 0)
 
  206     for (
unsigned b = 0; b < m_inputParameters.m_inputRasterBands.size(); b++)
 
  207       m_inputParameters.m_inputSensorBands.push_back(
"default_sensor");
 
  213                             "Unable to initialize the mixture model strategy");
 
  214   TERP_TRUE_OR_RETURN_FALSE(strategyPtr->execute(*m_inputParameters.m_inputRasterPtr, m_inputParameters.m_inputRasterBands,
 
  215                                                  m_inputParameters.m_inputSensorBands, m_inputParameters.m_components,
 
  217                             "Unable to execute the mixture model strategy");
 
  227   m_instanceInitialized = 
false;
 
  229   m_inputParameters.reset();
 
  248                             "Invalid raster bands number");
 
  253     TERP_LOGWARN(
"No information about sensors were provided, using defaults.");
 
  258                               "Invalid raster bands number");
 
  265                               "Invalid raster bands" );
 
  268   std::map<std::string, std::vector<double> >::const_iterator it;
 
  272                               "Endmember's number of channels is bigger from input raster bands number");
 
  276                             "Number of components must be equal to the number of selected bands");
 
  279   m_instanceInitialized = 
true;
 
  281   m_inputParameters = *inputParamsPtr;
 
  288   return m_instanceInitialized;
 
Raster decomposition using mixture model. 
 
const MixtureModel::OutputParameters & operator=(const MixtureModel::OutputParameters ¶ms)
 
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
 
std::map< std::string, std::vector< double > > m_components
A set of endmembers and its radiances. 
 
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
 
virtual AbstractParameters * clone() const =0
Create a clone copy of this instance. 
 
te::rst::Raster const * m_inputRasterPtr
Input raster. 
 
Raster strategy parameters base class. 
 
ColorInterp m_colorInterp
The color interpretation. 
 
Raster mixture model strategy base class. 
 
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution. 
 
Raster Processing functions. 
 
bool NormalizeRaster(te::rst::Raster &inraster, double nmin, double nmax)
Normalizes one raster in a given interval. 
 
bool m_createErrorRaster
A flag to indicate that output raster will include the error bands. 
 
StrategyParameters const * getMixtureModelStrategyParams() const 
Returns a pointer to the internal specific mixture model strategy parameters, or null if no parameter...
 
te::common::AbstractParameters * clone() const 
Create a clone copy of this instance. 
 
static Raster * make()
It creates and returns an empty raster with default raster driver. 
 
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory). 
 
std::vector< std::string > m_inputSensorBands
The names of the sensor/bands. 
 
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster. 
 
StrategyParameters * m_mixtureModelStrategyParamsPtr
Internal specific mixture model strategy parameters. 
 
static te::rp::MixtureModelStrategy * make(const std::string &factoryKey)
It creates an object with the appropriated factory. 
 
InputParameters()
Default constructor. 
 
#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...
 
bool m_instanceInitialized
Is this instance already initialized? 
 
int m_type
The data type of the elements in the band. 
 
bool m_normalizeOutput
A flag to indicate that output raster will be normalized, by default [0, 255]. 
 
Abstract parameters base interface. 
 
A rectified grid is the spatial support for raster data. 
 
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ). 
 
std::string m_strategyName
The mixture model strategy name see each te::rp::MixtureModelStrategyFactory inherited classes docume...
 
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the generated output raster, one band per component plus one error band per component (w...
 
#define TERP_LOGWARN(message)
Logs a warning message. 
 
void setMixtureModelStrategyParams(const StrategyParameters &p)
Set specific mixture model strategy parameters. 
 
bool isInitialized() const 
Returns true if the algorithm instance is initialized and ready for execution. 
 
std::string m_description
A description. 
 
Raster mixture model strategy factory base class. 
 
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state. 
 
const Algorithm & operator=(const Algorithm &)
 
MixtureModel output parameters. 
 
A raster band description. 
 
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max(). 
 
Raster Processing algorithm output parameters base interface. 
 
MixtureModel input parameters. 
 
OutputParameters()
Default constructor. 
 
const MixtureModel::InputParameters & operator=(const MixtureModel::InputParameters ¶ms)
 
Index into a lookup table. 
 
std::vector< unsigned int > m_inputRasterBands
Bands to be processed from the input raster. 
 
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters. 
 
te::common::AbstractParameters * clone() const 
Create a clone copy of this instance. 
 
te::common::AccessPolicy getAccessPolicy() const 
Returns the raster access policy. 
 
Raster Processing algorithm input parameters base interface.