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  bool m_enableRasterCache; // Enable/disable input raster cache (default:true).
55 
56  unsigned int m_weight; //!< The weight value defines the number of times the frequency of the central point has to be considered.
57 
58  unsigned int m_threshold; //!< The threshold value is the frequency value above which the central point is modified.
59 
61 
63 
64  ~InputParameters();
65 
66  //overload
67  void reset() _NOEXCEPT_OP(false);
68 
69  //overload
70  const InputParameters& operator=(const InputParameters& params);
71 
72  //overload
73  AbstractParameters* clone() const;
74  };
75 
76  /*!
77  \class OutputParameters
78  \brief PostClassification output parameters
79  */
81  {
82  public:
83 
84  std::string m_rType; //!< Output raster data source type (as described in te::raster::RasterFactory ).
85 
86  std::map< std::string, std::string > m_rInfo; //!< The necessary information to create the raster (as described in te::raster::RasterFactory).
87 
88  std::unique_ptr< te::rst::Raster > m_outputRasterPtr; //!< A pointer the ge generated output raster (label image).
89 
91 
93 
95 
96  //overload
97  void reset() _NOEXCEPT_OP(false);
98 
99  //overload
100  const OutputParameters& operator=(const OutputParameters& params);
101 
102  //overload
103  AbstractParameters* clone() const;
104  };
105 
107 
109 
110  //overload
111  bool execute(AlgorithmOutputParameters& outputParams) _NOEXCEPT_OP(false);
112 
113  //overload
114  void reset() _NOEXCEPT_OP(false);
115 
116  //overload
117  bool initialize(const AlgorithmInputParameters& inputParams) _NOEXCEPT_OP(false);
118 
119  //overload
120  bool isInitialized() const;
121 
122  protected:
123 
124  bool m_isInitialized; //!< Is this instance already initialized?
125 
126  PostClassification::InputParameters m_inputParameters; //!< Input parameters.
127 
128  /*!
129  \brief Apply the post classification.
130  \param srcRaster Source raster.
131  \param srcBandIdx Source raster band index.
132  \param dstRaster Destination raster.
133  \param dstBandIdx Destination raster band index.
134  \param weight Weight value.
135  \param threshold Threshold value.
136  \param useProgress if true, the progress interface must be used.
137  */
138  bool runPostClassification(const te::rst::Raster& srcRaster, te::rst::Raster& dstRaster,
139  unsigned int weight, unsigned int threshold);
140  };
141 
142  } // end namespace rp
143 } // end namespace te
144 
145 #endif
146 
PostClassification output parameters.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Raster post classification.
Raster Processing algorithm output parameters base interface.
#define _NOEXCEPT_OP(x)
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
TerraLib.
#define TERPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:139
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer the ge generated output raster (label image).
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
Raster Processing algorithm input parameters base interface.
te::rst::Raster const * m_inRasterPtr
Input raster.