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 
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 
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::rp::AlgorithmOutputParameters
Raster Processing algorithm output parameters base interface.
Definition: AlgorithmOutputParameters.h:40
te::rp::PostClassification::InputParameters
Filter input parameters.
Definition: PostClassification.h:49
te::rp::PostClassification::InputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rst::Raster
An abstract class for raster data strucutures.
Definition: Raster.h:72
te::rp::AlgorithmInputParameters
Raster Processing algorithm input parameters base interface.
Definition: AlgorithmInputParameters.h:40
te::rp::PostClassification::InputParameters::m_threshold
unsigned int m_threshold
The threshold value is the frequency value above which the central point is modified.
Definition: PostClassification.h:58
te::rp::PostClassification::InputParameters::InputParameters
InputParameters(const InputParameters &)
_NOEXCEPT_OP
#define _NOEXCEPT_OP(x)
Definition: NoExceptDefinition.h:36
te::rp::Algorithm
Raster Processing algorithm base interface.
Definition: Algorithm.h:42
te::rp::PostClassification::OutputParameters
PostClassification output parameters.
Definition: PostClassification.h:81
te::rp::PostClassification::OutputParameters::reset
void reset() _NOEXCEPT_OP(false)
Clear all internal allocated resources and reset the parameters instance to its initial state.
te::rp::PostClassification::OutputParameters::OutputParameters
OutputParameters(const OutputParameters &)
te::rp::PostClassification
Raster post classification.
Definition: PostClassification.h:41
te::rp::PostClassification::OutputParameters::~OutputParameters
~OutputParameters()
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::PostClassification::InputParameters::m_enableRasterCache
bool m_enableRasterCache
Definition: PostClassification.h:54
te::rp::PostClassification::OutputParameters::m_outputRasterPtr
std::unique_ptr< te::rst::Raster > m_outputRasterPtr
A pointer the ge generated output raster (label image).
Definition: PostClassification.h:88
te::rp::PostClassification::OutputParameters::OutputParameters
OutputParameters()
te::rp::PostClassification::OutputParameters::m_rInfo
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
Definition: PostClassification.h:86
Algorithm.h
Abstract algorithm.
te::rp::PostClassification::InputParameters::m_weight
unsigned int m_weight
The weight value defines the number of times the frequency of the central point has to be considered.
Definition: PostClassification.h:56
te::rp::PostClassification::InputParameters::InputParameters
InputParameters()
te::rp::PostClassification::InputParameters::m_inRasterPtr
te::rst::Raster const * m_inRasterPtr
Input raster.
Definition: PostClassification.h:52
te::rp::PostClassification::InputParameters::~InputParameters
~InputParameters()
te::rp::PostClassification::OutputParameters::m_rType
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
Definition: PostClassification.h:84