My Project
core/shape.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
22#ifndef mia_core_shape_hh
23#define mia_core_shape_hh
24
25#include <set>
26
29#include <mia/core/utils.hh>
30
31#ifndef EXPORT_SHAPE
32# ifdef WIN32
33# define EXPORT_SHAPE __declspec(dllimport)
34# else
35# define EXPORT_SHAPE
36# endif
37#endif
38
40
41
43 static const char *type_descr;
44};
45
46
47
62template <template <typename> class T, typename M>
64{
65public:
68
70 typedef typename M::Super plugin_data;
71
75 typedef std::set< T<int>, less_then<T<int>>> Flat;
76
78 typedef T<int> value_type;
79
81 typedef typename Flat::const_iterator const_iterator;
82
84 typedef M Mask;
85
87 typedef T<unsigned int> Size;
88
91
94
97
99 Mask get_mask()const;
100
103
105 typename Flat::size_type size() const;
106
110 void insert(const T<int>& p);
111
117 bool has_location(const T<int>& p) const;
118private:
119 Flat m_shape;
120 T<int> m_size;
121};
122
124
125#endif
The base class for all plug-in created object.
a generic class for morphological shapes
Definition core/shape.hh:64
T< unsigned int > Size
the size type for the mask image
Definition core/shape.hh:87
M Mask
the mask image type
Definition core/shape.hh:84
void insert(const T< int > &p)
Flat::const_iterator const_iterator
iterator over the mask coordinate set
Definition core/shape.hh:81
const_iterator begin() const
std::set< T< int >, less_then< T< int > > > Flat
Definition core/shape.hh:75
const_iterator end() const
Mask get_mask() const
shape_type plugin_type
helper type for use of the class in TFactory
Definition core/shape.hh:67
M::Super plugin_data
Obtain the data type that is used for the mask image from the template parameters.
Definition core/shape.hh:70
T< int > value_type
the actual value type of the mask coordinates
Definition core/shape.hh:78
Size get_size() const
returns the nD size of the mask
bool has_location(const T< int > &p) const
TShape()
standard constructor initialises the shape set
Flat::size_type size() const
#define EXPORT_SHAPE
Definition core/shape.hh:35
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
static const char * type_descr
Definition core/shape.hh:43