Loading...
Searching...
No Matches
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
37namespace 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
A region of interest (often abbreviated ROI), is a selected subset of samples within a dataset identi...
Definition: ROI.h:61
void addPolygon(te::gm::Polygon *p, std::string id)
Add a new region into this ROI.
std::string getColor()
Get the ROI color defined by a hexadecimal color name.
std::string m_label
ROI label.
Definition: ROI.h:105
std::map< std::string, te::gm::Polygon * > & getPolygons()
Get all polygons belongs to this roi.
std::map< std::string, te::gm::Polygon * > m_roiMap
The map of acquired regions.
Definition: ROI.h:107
virtual ~ROI()
Virtual destructor.
void setColor(std::string color)
Set the ROI color using the hexadecimal color name.
ROI(std::string label)
Default constructor.
std::string m_color
The hexa color associated with this ROI.
Definition: ROI.h:106
void setLabel(std::string label)
Set the ROI label.
void removePolygon(std::string id)
Removes a region from this ROI.
std::string getLabel()
Get the ROI label.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:51
TerraLib.
#define TECLEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:102
Proxy configuration file for TerraView (see terraview_config.h).