PostClassification.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/PostClassification.h
22 \brief Raster post classification.
23 */
24 
25 #ifndef __TERRALIB_RP_INTERNAL_POSTCLASSIFICATION_H
26 #define __TERRALIB_RP_INTERNAL_POSTCLASSIFICATION_H
27 
28 #include "Algorithm.h"
29 #include "../raster/Raster.h"
30 
31 namespace te
32 {
33  namespace rp
34  {
35  /*!
36  \class PostClassification
37  \brief Raster post classification.
38  \ingroup rp_enh
39  */
41  {
42  public:
43 
44  /*!
45  \class InputParameters
46  \brief Filter input parameters
47  */
49  {
50  public:
51 
52  te::rst::Raster const* m_inRasterPtr; //!< Input raster.
53 
54  unsigned int m_weight; //!< The weight value defines the number of times the frequency of the central point has to be considered.
55 
56  unsigned int m_threshold; //!< The threshold value is the frequency value above which the central point is modified.
57 
59 
61 
62  ~InputParameters();
63 
64  //overload
65  void reset() throw(te::rp::Exception);
66 
67  //overload
68  const InputParameters& operator=(const InputParameters& params);
69 
70  //overload
71  AbstractParameters* clone() const;
72  };
73 
74  /*!
75  \class OutputParameters
76  \brief PostClassification output parameters
77  */
79  {
80  public:
81 
82  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
83 
84  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the raster (as described in te::raster::RasterFactory).
85 
86  std::auto_ptr< te::rst::Raster > m_outputRasterPtr; //!< A pointer the ge generated output raster (label image).
87 
89 
91 
93 
94  //overload
95  void reset() throw(te::rp::Exception);
96 
97  //overload
98  const OutputParameters& operator=(const OutputParameters& params);
99 
100  //overload
101  AbstractParameters* clone() const;
102  };
103 
105 
107 
108  //overload
109  bool execute(AlgorithmOutputParameters& outputParams) throw(te::rp::Exception);
110 
111  //overload
112  void reset() throw(te::rp::Exception);
113 
114  //overload
115  bool initialize(const AlgorithmInputParameters& inputParams) throw(te::rp::Exception);
116 
117  //overload
118  bool isInitialized() const;
119 
120  protected:
121 
122  bool m_isInitialized; //!< Is this instance already initialized?
123 
124  PostClassification::InputParameters m_inputParameters; //!< Input parameters.
125 
126  /*!
127  \brief Apply the post classification.
128  \param srcRaster Source raster.
129  \param srcBandIdx Source raster band index.
130  \param dstRaster Destination raster.
131  \param dstBandIdx Destination raster band index.
132  \param weight Weight value.
133  \param threshold Threshold value.
134  \param useProgress if true, the progress interface must be used.
135  */
136  bool runPostClassification(const te::rst::Raster& srcRaster, te::rst::Raster& dstRaster,
137  unsigned int weight, unsigned int threshold);
138  };
139 
140  } // end namespace rp
141 } // end namespace te
142 
143 #endif
144 
PostClassification output parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Raster post classification.
Base exception class for plugin module.
Definition: Exception.h:42
Raster Processing algorithm output parameters base interface.
Raster Processing algorithm base interface class.
unsigned int m_weight
The weight value defines the number of times the frequency of the central point has to be considered...
Raster Processing algorithm base interface.
Definition: Algorithm.h:41
unsigned int m_threshold
The threshold value is the frequency value above which the central point is modified.
An abstract class for raster data strucutures.
Definition: Raster.h:71
URI C++ Library.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
A pointer the ge generated output raster (label image).
Raster Processing algorithm input parameters base interface.
te::rst::Raster const * m_inRasterPtr
Input raster.