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{
40public:
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
90
93
96private:
97
98 P2DShape m_foreground_mask;
99 P2DShape m_background_mask;
100};
101
104
105
114size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
115
124size_t EXPORT_2D morph_thinning_2d(C2DBitImage& target, const C2DBitImage& source, const C2DMorphShape& shape);
125
126
128
129#endif
130
std::shared_ptr< C2DShape > P2DShape
Pointer type of the C2DShape.
Definition: 2d/shape.hh:35
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:48
a class for advanced morphological filter masks
Definition: morphshape.hh:39
C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask)
void add_pixel(const value_type &pixel, bool foreground)
std::shared_ptr< C2DMorphShape > Pointer
The pointer type of the class.
Definition: morphshape.hh:51
C2DMorphShape rotate_by_90() const
const C2DShape & get_background_mask() const
void add_pixel(int x, int y, bool foreground)
C2DShape::value_type value_type
the value type based on the shape representation
Definition: morphshape.hh:54
C2DMorphShape()
default constructor
const C2DShape & get_foreground_mask() const
C2DMorphShape plugin_type
helper type for plug-in handling
Definition: morphshape.hh:45
C2DImage plugin_data
helper type for plug-in handling
Definition: morphshape.hh:42
static const char * type_descr
helper string for plug-in handling
Definition: morphshape.hh:48
The base class for all plug-in created object.
Definition: product_base.hh:41
This is the template version of a 2D image that is used for holding real data.
Definition: 2d/image.hh:140
a generic class for morphological shapes
Definition: core/shape.hh:64
T< int > value_type
the actual value type of the mask coordinates
Definition: core/shape.hh:78
#define EXPORT_2D
Definition: defines2d.hh:37
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
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:103