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() throw( te::rp::Exception );
72 
73  //overload
74  te::common::AbstractParameters* clone() const;
75  };
76 
77  public:
78 
80 
82 
83  //overload
84  bool initialize(StrategyParameters const* const strategyParams) throw(te::rp::Exception);
85 
86  //overload
87  bool execute(const te::rst::Raster& inputRaster, const std::vector<unsigned int>& inputRasterBands,
88  const std::vector<std::string>& inputSensorBands, const std::map<std::string, std::vector<double> >& components,
89  std::vector<te::rst::Raster*>& outputRaster, const bool normalize, const bool enableProgressInterface) throw(te::rp::Exception);
90 
91  //overload
92  bool getTransformMatrix( boost::numeric::ublas::matrix<double>& matrix ) const;
93 
94  //overload
95  bool setTransformMatrix(boost::numeric::ublas::matrix<double>& matrix);
96 
97  //overload
98  bool generateTransformMatrix(const std::vector<unsigned int>& inputRasterBands, const std::vector<std::string>& inputSensorBands,
99  const std::map<std::string, std::vector<double> >& components);
100 
101  //overload
102  bool getMinMax(std::vector<double>&, std::vector<double>&) const;
103  bool getMinMaxError(std::vector<double>&, std::vector<double>&) const;
104 
105  protected:
106 
107  bool m_isInitialized; //!< True if this instance is initialized.
108  MixtureModelPCAStrategy::Parameters m_parameters; //!< Internal execution parameters.
109  boost::numeric::ublas::matrix<double> m_transfMatrix; //! Transformation matrix;
110  std::vector<double> m_min; //!< Minimun value
111  std::vector<double> m_max; //!< Maximum value
112  std::vector<double> m_minerror; //!< Minimun error value
113  std::vector<double> m_maxerror; //!< Maximum error value
114  };
115 
116  /*!
117  \class MixtureModelPCAStrategyFactory
118 
119  \brief Raster PCA mixture model strategy factory.
120 
121  \note Factory key: RegionGrowing
122  */
124  {
125  public:
126 
128 
130 
131  //overload
133  };
134 
135  } // end namespace rp
136 } // end namespace te
137 
138 #endif // __TERRALIB_RP_INTERNAL_MIXTUREMODELPCASTRATEGY_H
te::rp::MixtureModelPCAStrategyFactory::MixtureModelPCAStrategyFactory
MixtureModelPCAStrategyFactory()
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::MixtureModelPCAStrategy::Parameters::Parameters
Parameters()
te::rp::MixtureModelStrategyParameters
Mixture model strategy parameters base class.
Definition: MixtureModelStrategyParameters.h:37
te::rp::MixtureModelPCAStrategy::Parameters::reset
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::MixtureModelPCAStrategy::Parameters
MixtureModel Parameters.
Definition: MixtureModelPCAStrategy.h:60
boost
Definition: Translator.h:43
te::rp::MixtureModelPCAStrategy::Parameters::operator=
const Parameters & operator=(const Parameters &params)
te::rp::MixtureModelPCAStrategy
Definition: MixtureModelPCAStrategy.h:51
MixtureModelStrategy.h
Raster mixture model strategy base class.
te::rp::MixtureModelPCAStrategyFactory::~MixtureModelPCAStrategyFactory
~MixtureModelPCAStrategyFactory()
te::Exception
Base exception class for plugin module.
Definition: Exception.h:42
TERPEXPORT
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
te::rp::MixtureModelPCAStrategy::Parameters::~Parameters
~Parameters()
te::rp::StrategyParameters
Raster strategy parameters base class.
Definition: StrategyParameters.h:43
te::rp::MixtureModelStrategy
Raster mixture model strategy base class.
Definition: MixtureModelStrategy.h:50
te::rp::MixtureModelPCAStrategyFactory
Raster PCA mixture model strategy factory.
Definition: MixtureModelPCAStrategy.h:124
te::rp::MixtureModelStrategyFactory
Raster Mixture model strategy factory base class.
Definition: MixtureModelStrategyFactory.h:47
te::rp::MixtureModelPCAStrategyFactory::build
te::rp::MixtureModelStrategy * build()
Concrete factories (derived from this one) must implement this method in order to create objects.
te::mnt::getMinMax
TEMNTEXPORT void getMinMax(te::rst::Raster *inputRst, double &vmin, double &vmax)
Config.h
Proxy configuration file for TerraView (see terraview_config.h).
MixtureModelStrategyFactory.h
Raster mixture model strategy factory base class.
MixtureModelStrategyParameters.h