core/shape.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_core_shape_hh
#define mia_core_shape_hh
#include <set>
#include <mia/core/product_base.hh>
#include <mia/core/type_traits.hh>
#include <mia/core/utils.hh>
#ifndef EXPORT_SHAPE
# ifdef WIN32
# define EXPORT_SHAPE __declspec(dllimport)
# else
# define EXPORT_SHAPE
# endif
#endif
NS_MIA_BEGIN
struct EXPORT_CORE shape_type {
static const char *type_descr;
};
template <template <typename> class T, typename M>
class EXPORT_SHAPE TShape : public CProductBase
{
public:
typedef shape_type plugin_type;
typedef typename M::Super plugin_data;
typedef std::set< T<int>, less_then<T<int>>> Flat;
typedef T<int> value_type;
typedef typename Flat::const_iterator const_iterator;
typedef M Mask;
typedef T<unsigned int> Size;
TShape();
const_iterator begin() const;
const_iterator end() const;
Mask get_mask()const;
Size get_size()const;
typename Flat::size_type size() const;
void insert(const T<int>& p);
bool has_location(const T<int>& p) const;
private:
Flat m_shape;
T<int> m_size;
};
NS_MIA_END
#endif
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TShape::Size
T< unsigned int > Size
the size type for the mask image
Definition core/shape.hh:87
TShape::Mask
M Mask
the mask image type
Definition core/shape.hh:84
TShape::insert
void insert(const T< int > &p)
TShape::const_iterator
Flat::const_iterator const_iterator
iterator over the mask coordinate set
Definition core/shape.hh:81
TShape::begin
const_iterator begin() const
TShape::Flat
std::set< T< int >, less_then< T< int > > > Flat
Definition core/shape.hh:75
TShape::end
const_iterator end() const
TShape::get_mask
Mask get_mask() const
TShape::plugin_type
shape_type plugin_type
helper type for use of the class in TFactory
Definition core/shape.hh:67
TShape::plugin_data
M::Super plugin_data
Obtain the data type that is used for the mask image from the template parameters.
Definition core/shape.hh:70
TShape::value_type
T< int > value_type
the actual value type of the mask coordinates
Definition core/shape.hh:78
TShape::get_size
Size get_size() const
returns the nD size of the mask
TShape::has_location
bool has_location(const T< int > &p) const
TShape::TShape
TShape()
standard constructor initialises the shape set
TShape::size
Flat::size_type size() const
EXPORT_SHAPE
#define EXPORT_SHAPE
Definition core/shape.hh:35
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
product_base.hh
shape_type
Definition core/shape.hh:42
shape_type::type_descr
static const char * type_descr
Definition core/shape.hh:43
type_traits.hh
utils.hh