ROI.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/classification/ROI.h
22 
23  \brief A region of interest (often abbreviated ROI), is a selected subset of
24  samples within a dataset identified for a particular purpose.
25 */
26 
27 #ifndef __TERRALIB_CLASSIFICATION_INTERNAL_ROI_H
28 #define __TERRALIB_CLASSIFICATION_INTERNAL_ROI_H
29 
30 // TerraLib
31 #include "Config.h"
32 
33 // STL
34 #include <map>
35 #include <string>
36 
37 namespace te
38 {
39  // Forward declarations
40  namespace gm
41  {
42  class Polygon;
43  }
44 
45  namespace cl
46  {
47  /*!
48  \brief A region of interest (often abbreviated ROI), is a selected subset of
49  samples within a dataset identified for a particular purpose.
50 
51  An ROI can be taken literally as a polygonal selection from a 2D map.
52  In computer vision and optical character recognition, the ROI defines the borders
53  of an object under consideration. In many applications, symbolic (textual) labels
54  are added to a ROI, to describe its content in a compact manner.
55 
56  Within an ROI may lie individual points of interest (POIs).
57 
58  In this first version, the region will be represented only by polygons.
59  */
61  {
62  public:
63 
64  /*! \brief Default constructor. */
65  ROI(std::string label);
66 
67  /*! \brief Virtual destructor. */
68  virtual ~ROI();
69 
70  public:
71 
72  /*! \brief Set the ROI label. */
73  void setLabel(std::string label);
74 
75  /*! \brief Get the ROI label. */
76  std::string getLabel();
77 
78  /*! \brief Set the ROI color using the hexadecimal color name. */
79  void setColor(std::string color);
80 
81  /*! \brief Get the ROI color defined by a hexadecimal color name. */
82  std::string getColor();
83 
84  /*! \brief Get all polygons belongs to this roi. */
85  std::map<std::string, te::gm::Polygon*>& getPolygons();
86 
87  /*!
88  \brief Add a new region into this ROI
89 
90  \param p The polygon that represents the region of interest.
91 
92  \param id The polygon unique identifier.
93  */
94  void addPolygon(te::gm::Polygon* p, std::string id);
95 
96  /*!
97  \brief Removes a region from this ROI
98 
99  \param id The polygon ID that has to be removed.
100  */
101  void removePolygon(std::string id);
102 
103  private:
104 
105  std::string m_label; //!< ROI label.
106  std::string m_color; //!< The hexa color associated with this ROI.
107  std::map<std::string, te::gm::Polygon*> m_roiMap; //!< The map of acquired regions.
108  };
109  } // end namespace cl
110 } // end namespace te
111 
112 
113 #endif // __TERRALIB_CLASSIFICATION_INTERNAL_ROI_H
Configuration flags for the Terrralib Classification module.
std::map< std::string, te::gm::Polygon * > m_roiMap
The map of acquired regions.
Definition: ROI.h:107
URI C++ Library.
std::string m_color
The hexa color associated with this ROI.
Definition: ROI.h:106
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
Definition: ROI.h:60
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:105
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
std::string m_label
ROI label.
Definition: ROI.h:105