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 public:
42 
45 
47  static const char *type_descr;
48 
50  typedef std::shared_ptr<C2DMorphShape> Pointer;
51 
54 
56  C2DMorphShape();
57 
58 
66  C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask);
67 
68 
75  void add_pixel(const value_type& pixel, bool foreground);
76 
84  void add_pixel(int x, int y, bool foreground);
85 
86 
88  const C2DShape& get_foreground_mask() const;
89 
91  const C2DShape& get_background_mask() const;
92 
94  C2DMorphShape rotate_by_90() const;
95 private:
96 
97  P2DShape m_foreground_mask;
98  P2DShape m_background_mask;
99 };
100 
103 
104 
113 size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
114 
123 size_t EXPORT_2D morph_thinning_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
124 
125 
127 
128 #endif
129 
C2DImage plugin_data
helper type for plug-in handling
Definition: morphshape.hh:41
T< int > value_type
the actual value type of the mask coordinates
Definition: core/shape.hh:77
std::shared_ptr< C2DMorphShape > Pointer
The pointer type of the class.
Definition: morphshape.hh:50
size_t EXPORT_2D morph_thinning_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
C2DMorphShape::Pointer P2DMorphShape
The pointer type for the morp shape class.
Definition: morphshape.hh:102
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:138
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
a class for advanced morphological filter masks
Definition: morphshape.hh:38
std::shared_ptr< C2DShape > P2DShape
Pointer type of the C2DShape.
Definition: 2d/shape.hh:35
#define EXPORT_2D
Definition: defines2d.hh:37
a generic class for morphological shapes
Definition: core/shape.hh:63
C2DMorphShape plugin_type
helper type for plug-in handling
Definition: morphshape.hh:44
static const char * type_descr
helper string for plug-in handling
Definition: morphshape.hh:47
The base class for all plug-in created object.
Definition: product_base.hh:40
C2DShape::value_type value_type
the value type based on the shape representation
Definition: morphshape.hh:53
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:47
size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36