My Project
morphshape.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef mia_2d_morphshape_hh
22 #define mia_2d_morphshape_hh
23 
24 #include <mia/2d/shape.hh>
25 
27 
28 
39 {
40 public:
43 
46 
48  static const char *type_descr;
49 
51  typedef std::shared_ptr<C2DMorphShape> Pointer;
52 
55 
58 
59 
67  C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask);
68 
69 
76  void add_pixel(const value_type& pixel, bool foreground);
77 
85  void add_pixel(int x, int y, bool foreground);
86 
87 
89  const C2DShape& get_foreground_mask() const;
90 
92  const C2DShape& get_background_mask() const;
93 
96 private:
97 
98  P2DShape m_foreground_mask;
99  P2DShape m_background_mask;
100 };
101 
104 
105 
114 size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
115 
124 size_t EXPORT_2D morph_thinning_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
125 
126 
128 
129 #endif
130 
C2DMorphShape::add_pixel
void add_pixel(const value_type &pixel, bool foreground)
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
C2DMorphShape::value_type
C2DShape::value_type value_type
the value type based on the shape representation
Definition: morphshape.hh:54
C2DMorphShape::C2DMorphShape
C2DMorphShape()
default constructor
C2DMorphShape::plugin_type
C2DMorphShape plugin_type
helper type for plug-in handling
Definition: morphshape.hh:45
C2DMorphShape::type_descr
static const char * type_descr
helper string for plug-in handling
Definition: morphshape.hh:48
TShape::value_type
T< int > value_type
the actual value type of the mask coordinates
Definition: core/shape.hh:78
C2DMorphShape::get_foreground_mask
const C2DShape & get_foreground_mask() const
C2DImage
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:48
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
C2DMorphShape::get_background_mask
const C2DShape & get_background_mask() const
C2DMorphShape
a class for advanced morphological filter masks
Definition: morphshape.hh:39
morph_thinning_2d
size_t EXPORT_2D morph_thinning_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
C2DMorphShape::add_pixel
void add_pixel(int x, int y, bool foreground)
CProductBase
The base class for all plug-in created object.
Definition: product_base.hh:41
morph_hit_and_miss_2d
size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
shape.hh
TShape
a generic class for morphological shapes
Definition: core/shape.hh:64
C2DMorphShape::Pointer
std::shared_ptr< C2DMorphShape > Pointer
The pointer type of the class.
Definition: morphshape.hh:51
C2DMorphShape::plugin_data
C2DImage plugin_data
helper type for plug-in handling
Definition: morphshape.hh:42
P2DMorphShape
C2DMorphShape::Pointer P2DMorphShape
The pointer type for the morp shape class.
Definition: morphshape.hh:103
T2DImage
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:140
C2DMorphShape::rotate_by_90
C2DMorphShape rotate_by_90() const
P2DShape
std::shared_ptr< C2DShape > P2DShape
Pointer type of the C2DShape.
Definition: 2d/shape.hh:35
C2DMorphShape::C2DMorphShape
C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask)
EXPORT_2D
#define EXPORT_2D
Definition: defines2d.hh:37