MixtureModelPCAStrategy.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/rp/MixtureModelPCAStrategy.h
22 
23  \brief PCA (Principal Component Analysis) strategy for mixture model.
24  */
25 
26 #ifndef __TERRALIB_RP_INTERNAL_MIXTUREMODELPCASTRATEGY_H
27 #define __TERRALIB_RP_INTERNAL_MIXTUREMODELPCASTRATEGY_H
28 
29 // TerraLib
30 #include "MixtureModelStrategy.h"
33 #include "Config.h"
34 
35 // STL
36 #include <map>
37 
38 // Boost
39 #include <boost/numeric/ublas/matrix.hpp>
40 
41 namespace te
42 {
43  namespace rp
44  {
45  /*!
46  \class MixtureModelPCAStrategy
47 
48  \ingroup rp_class
49  */
51  {
52  public:
53 
54  /*!
55  \class Parameters
56 
57  \brief MixtureModel Parameters
58  */
60  {
61  public:
62 
64 
66 
67  //overload
68  const Parameters& operator=(const Parameters& params);
69 
70  //overload
71  void reset() ;
72 
73  //overload
75 
76  //overload
77  bool serialize ( AlgorithmParametersSerializer& serializer ) const;
78  };
79 
80  public:
81 
83 
85 
86  //overload
87  bool initialize(StrategyParameters const* const strategyParams) ;
88 
89  //overload
90  bool execute(const te::rst::Raster& inputRaster, const std::vector<unsigned int>& inputRasterBands,
91  const std::vector<std::string>& inputSensorBands, const std::map<std::string, std::vector<double> >& components,
92  std::vector<te::rst::Raster*>& outputRaster, const bool normalize, const bool enableProgressInterface) ;
93 
94  //overload
95  bool getTransformMatrix( boost::numeric::ublas::matrix<double>& matrix ) const;
96 
97  //overload
98  bool setTransformMatrix(boost::numeric::ublas::matrix<double>& matrix);
99 
100  //overload
101  bool generateTransformMatrix(const std::vector<unsigned int>& inputRasterBands, const std::vector<std::string>& inputSensorBands,
102  const std::map<std::string, std::vector<double> >& components);
103 
104  //overload
105  bool getMinMax(std::vector<double>&, std::vector<double>&) const;
106  bool getMinMaxError(std::vector<double>&, std::vector<double>&) const;
107 
108  protected:
109 
110  bool m_isInitialized; //!< True if this instance is initialized.
111  MixtureModelPCAStrategy::Parameters m_parameters; //!< Internal execution parameters.
112  boost::numeric::ublas::matrix<double> m_transfMatrix; //! Transformation matrix;
113  std::vector<double> m_min; //!< Minimun value
114  std::vector<double> m_max; //!< Maximum value
115  std::vector<double> m_minerror; //!< Minimun error value
116  std::vector<double> m_maxerror; //!< Maximum error value
117  };
118 
119  /*!
120  \class MixtureModelPCAStrategyFactory
121 
122  \brief Raster PCA mixture model strategy factory.
123 
124  \note Factory key: RegionGrowing
125  */
127  {
128  public:
129 
131 
133 
134  //overload
136  };
137 
138  } // end namespace rp
139 } // end namespace te
140 
141 #endif // __TERRALIB_RP_INTERNAL_MIXTUREMODELPCASTRATEGY_H
Raster mixture model strategy factory base class.
Raster mixture model strategy base class.
Abstract parameters base interface.
A class to standardize algorithm parameters serialization.
Raster PCA mixture model strategy factory.
te::rp::MixtureModelStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects.
const Parameters & operator=(const Parameters &params)
te::common::AbstractParameters * clone() const
Create a clone copy of this instance.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
bool serialize(AlgorithmParametersSerializer &serializer) const
Returns a parameter serialization object.
bool setTransformMatrix(boost::numeric::ublas::matrix< double > &matrix)
Sets the used transformation matrix.
bool getMinMaxError(std::vector< double > &, std::vector< double > &) const
bool m_isInitialized
True if this instance is initialized.
MixtureModelPCAStrategy::Parameters m_parameters
Internal execution parameters.
std::vector< double > m_maxerror
Maximum error value.
bool execute(const te::rst::Raster &inputRaster, const std::vector< unsigned int > &inputRasterBands, const std::vector< std::string > &inputSensorBands, const std::map< std::string, std::vector< double > > &components, std::vector< te::rst::Raster * > &outputRaster, const bool normalize, const bool enableProgressInterface)
Executes the segmentation strategy.
std::vector< double > m_min
Transformation matrix;.
bool initialize(StrategyParameters const *const strategyParams)
Initialize the segmentation strategy.
boost::numeric::ublas::matrix< double > m_transfMatrix
bool getMinMax(std::vector< double > &, std::vector< double > &) const
bool generateTransformMatrix(const std::vector< unsigned int > &inputRasterBands, const std::vector< std::string > &inputSensorBands, const std::map< std::string, std::vector< double > > &components)
Generates the used transformation matrix (when applicable).
std::vector< double > m_minerror
Minimun error value.
std::vector< double > m_max
Maximum value.
bool getTransformMatrix(boost::numeric::ublas::matrix< double > &matrix) const
Returns the used transformation matrix (when applicable).
Raster Mixture model strategy factory base class.
Mixture model strategy parameters base class.
Raster mixture model strategy base class.
Raster strategy parameters base class.
An abstract class for raster data strucutures.
Definition: Raster.h:72
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Proxy configuration file for TerraView (see terraview_config.h).