MixtureModelStrategy.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/MixtureModelStrategy.h
22 
23  \brief Raster mixture model strategy base class.
24  */
25 
26 #ifndef __TERRALIB_RP_INTERNAL_MIXTUREMODELSTRATEGY_H
27 #define __TERRALIB_RP_INTERNAL_MIXTUREMODELSTRATEGY_H
28 
29 // TerraLib
30 #include "../raster/Raster.h"
31 #include "StrategyParameters.h"
32 #include "Config.h"
33 #include "Exception.h"
34 
35 // STL
36 #include <vector>
37 
38 // Boost
39 #include <boost/numeric/ublas/matrix.hpp>
40 
41 namespace te
42 {
43  namespace rp
44  {
45  /*!
46  \class MixtureModelStrategy
47  \brief Raster mixture model strategy base class.
48  */
50  {
51  public:
52 
53  /*! \brief Virtual destructor. */
54  virtual ~MixtureModelStrategy();
55 
56  /*!
57  \brief Initialize the segmentation strategy.
58  \param strategyParams A pointer to the user given specific segmentation strategy parameters ou NULL if no parameters are present.
59  \return true if OK, false on errors.
60  */
61  virtual bool initialize(StrategyParameters const* const strategyParams) throw(te::rp::Exception) = 0;
62 
63  /*!
64  \brief Executes the segmentation strategy.
65 
66  \param inputRaster Input raster.
67  \param inputRasterBands Input raster bands.
68  \param components The set of endmembers and its radiances.
69  \param outputRaster Output raster.
70  \param enableProgressInterface Enable the internal strategy to update the progress interface.
71 
72  \return true if OK, false on errors.
73  */
74  virtual bool execute(const te::rst::Raster& inputRaster, const std::vector<unsigned int>& inputRasterBands,
75  const std::vector<std::string>& inputSensorBands, const std::map<std::string, std::vector<double> >& components,
76  te::rst::Raster& outputRaster, const bool enableProgressInterface) throw(te::rp::Exception) = 0;
77 
78  /*!
79  \brief Returns the used transformation matrix (when applicable).
80  \param matrix The transformation matrix.
81  \return true if OK, false on errors or not applicable cases.
82  */
83  virtual bool getTransformMatrix( boost::numeric::ublas::matrix<double>& matrix ) const = 0;
84 
85  /*!
86  \brief Sets the used transformation matrix.
87  \param matrix The transformation matrix.
88  \return true if OK, false on errors or not applicable cases.
89  */
90  virtual bool setTransformMatrix(boost::numeric::ublas::matrix<double>& matrix) = 0;
91 
92  /*!
93  \brief Generates the used transformation matrix (when applicable).
94  \param inputRasterBands Input raster bands.
95  \param inputSensorBands Input names of the sensor/bands.
96  \param components A set of endmembers and its radiances.
97  \return true if OK, false on errors or not applicable cases.
98  */
99  virtual bool generateTransformMatrix(const std::vector<unsigned int>& inputRasterBands, const std::vector<std::string>& inputSensorBands,
100  const std::map<std::string, std::vector<double> >& components) = 0;
101 
102  virtual bool getMinMax(std::vector<double>&, std::vector<double>&) const = 0;
103 
104  protected:
105 
106  /*! \brief Default constructor. */
108 
109  private:
110 
111  /*!
112  \brief Copy constructor.
113 
114  \param rhs The right-hand side Raster.
115  */
117 
118  /*!
119  \brief Assignment operator.
120 
121  \param rhs The right-hand-side copy that would be used to copy from.
122 
123  \return A reference to this object.
124  */
125  const MixtureModelStrategy& operator=(const MixtureModelStrategy& rhs);
126  };
127 
128  } // end namespace rp
129 } // end namespace te
130 
131 #endif // __TERRALIB_RP_INTERNAL_MIXTUREMODELSTRATEGY_H
132 
Exception class.
Raster mixture model strategy base class.
TEMNTEXPORT void getMinMax(te::rst::Raster *inputRst, double &vmin, double &vmax)
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
Raster strategy parameters base class.
Raster strategy parameters base class.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
Configuration flags for the Raster Processing module of TerraLib.