morphshape.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_2d_morphshape_hh
#define mia_2d_morphshape_hh
#include <mia/2d/shape.hh>
NS_MIA_BEGIN
class EXPORT_2D C2DMorphShape : public CProductBase
{
public:
typedef C2DImage plugin_data;
typedef C2DMorphShape plugin_type;
static const char *type_descr;
typedef std::shared_ptr<C2DMorphShape> Pointer;
typedef C2DShape::value_type value_type;
C2DMorphShape();
C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask);
void add_pixel(const value_type& pixel, bool foreground);
void add_pixel(int x, int y, bool foreground);
const C2DShape& get_foreground_mask() const;
const C2DShape& get_background_mask() const;
C2DMorphShape rotate_by_90() const;
private:
P2DShape m_foreground_mask;
P2DShape m_background_mask;
};
typedef C2DMorphShape::Pointer P2DMorphShape;
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);
NS_MIA_END
#endif
C2DBitImage
T2DImage< bool > C2DBitImage
2D image with binary values
Definition 2d/image.hh:442
shape.hh
P2DShape
std::shared_ptr< C2DShape > P2DShape
Pointer type of the C2DShape.
Definition 2d/shape.hh:37
C2DShape
TShape< T2DVector, C2DBitImage > C2DShape
2D shape class, see also TShape
Definition 2d/shape.hh:34
C2DImage
This is the base class for 2D images that can hold generic pixel data.
Definition 2d/image.hh:48
C2DMorphShape
a class for advanced morphological filter masks
Definition morphshape.hh:39
C2DMorphShape::C2DMorphShape
C2DMorphShape(P2DShape foreground_mask, P2DShape background_mask)
C2DMorphShape::add_pixel
void add_pixel(const value_type &pixel, bool foreground)
C2DMorphShape::Pointer
std::shared_ptr< C2DMorphShape > Pointer
The pointer type of the class.
Definition morphshape.hh:51
C2DMorphShape::rotate_by_90
C2DMorphShape rotate_by_90() const
C2DMorphShape::get_background_mask
const C2DShape & get_background_mask() const
C2DMorphShape::add_pixel
void add_pixel(int x, int y, bool foreground)
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::get_foreground_mask
const C2DShape & get_foreground_mask() const
C2DMorphShape::plugin_type
C2DMorphShape plugin_type
helper type for plug-in handling
Definition morphshape.hh:45
C2DMorphShape::plugin_data
C2DImage plugin_data
helper type for plug-in handling
Definition morphshape.hh:42
C2DMorphShape::type_descr
static const char * type_descr
helper string for plug-in handling
Definition morphshape.hh:48
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TShape< T2DVector, C2DBitImage >::value_type
T2DVector< int > value_type
Definition core/shape.hh:78
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
morph_hit_and_miss_2d
size_t EXPORT_2D morph_hit_and_miss_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
morph_thinning_2d
size_t EXPORT_2D morph_thinning_2d(C2DBitImage &target, const C2DBitImage &source, const C2DMorphShape &shape)
P2DMorphShape
C2DMorphShape::Pointer P2DMorphShape
The pointer type for the morp shape class.
Definition morphshape.hh:103