MeVisLab Toolbox Reference
mlITKFlatStructElement.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#pragma once
14
17
19#include "mlModuleIncludes.h"
20#include "itkFlatStructuringElement.h"
21
22
23// Be sure that all your modules are part of the ml. So collisions
24// with names in system files or other libraries are minimized.
25ML_START_NAMESPACE
26
27//----------------------------------------------------------------------------------
29//----------------------------------------------------------------------------------
31
32public:
33
36
38 enum {
39 Box = 0,
44
46
47 } FlatStructureElementTypes;
48
51
53 template <size_t DIM> const itk::FlatStructuringElement<DIM> &getFlatStructuringElement() const;
54
55protected:
56
58 void activateAttachments() override;
59
61 void handleNotification(Field * field) override;
62
63private:
64
66 BaseField *_outputBaseFld;
67
69 EnumField *_selectElementFld;
70
72 ImageVectorField *_radiusFld;
73
75 IntField *_thicknessFld;
76
78 BoolField *_includeCenterFld;
79
81 IntField *_numLinesFld;
82
84
85 itk::FlatStructuringElement<1> _dim1FlatStructuringElement;
86 itk::FlatStructuringElement<2> _dim2FlatStructuringElement;
87 itk::FlatStructuringElement<3> _dim3FlatStructuringElement;
88 itk::FlatStructuringElement<4> _dim4FlatStructuringElement;
89 itk::FlatStructuringElement<5> _dim5FlatStructuringElement;
90 itk::FlatStructuringElement<6> _dim6FlatStructuringElement;
92
96};
97
98
100
101template<> inline const itk::FlatStructuringElement<1> &ITKFlatStructElement::getFlatStructuringElement<1>() const { return _dim1FlatStructuringElement; };
102template<> inline const itk::FlatStructuringElement<2> &ITKFlatStructElement::getFlatStructuringElement<2>() const { return _dim2FlatStructuringElement; };
103template<> inline const itk::FlatStructuringElement<3> &ITKFlatStructElement::getFlatStructuringElement<3>() const { return _dim3FlatStructuringElement; };
104template<> inline const itk::FlatStructuringElement<4> &ITKFlatStructElement::getFlatStructuringElement<4>() const { return _dim4FlatStructuringElement; };
105template<> inline const itk::FlatStructuringElement<5> &ITKFlatStructElement::getFlatStructuringElement<5>() const { return _dim5FlatStructuringElement; };
106template<> inline const itk::FlatStructuringElement<6> &ITKFlatStructElement::getFlatStructuringElement<6>() const { return _dim6FlatStructuringElement; };
108
109ML_END_NAMESPACE
void handleNotification(Field *field) override
Called on each change of fields in the field container to notify the module about changes.
const itk::FlatStructuringElement< DIM > & getFlatStructuringElement() const
Returns the structuring elements for the corresponding dimension, the implementation is outside the c...
void activateAttachments() override
Called after reload or clones of field values without field notifications.
static const char *const FlatStructuringElementTypeNames[NumFlatStructuringElements]
Enumerations strings corresponding to FlatStructureElementTypes.
ITKFlatStructElement()
Constructor.
@ Polygon
Creates a Polygon FlatStruturingElement.
@ Box
Creates a Box FlatStruturingElement.
@ Annulus
Creates a Annulus FlatStruturingElement.
@ NumFlatStructuringElements
Not a valid mode; it defines the number of availabale FlatStruturingElement,.
@ Ball
Creates a Ball FlatStruturingElement.
@ Cross
Creates a Cross FlatStruturingElement.
Module(int numInputImages, int numOutputImages)
#define ML_MODULE_CLASS_HEADER(className)
#define MLITK_SUPPORT_EXPORT