24#include <itkNeighborhood.h>
25#include <itkFlatStructuringElement.h>
26#include <itkNumericTraits.h>
34template<
class TPixel,
unsigned int VDimension = 2,
class TAllocator = NeighborhoodAllocator<TPixel>,
class SuperClss = Neighborhood<TPixel, VDimension, TAllocator > >
42 typedef Neighborhood<TPixel, VDimension, TAllocator>
Superclass;
57 typedef typename AllocatorType::iterator
Iterator;
63 typedef typename Superclass::SizeType
SizeType;
101 Superclass::operator=(
other);
125 ML_NAMESPACE::ImageVector
kExt =
kernel.getExtent();
128 itkKExt = ML_NAMESPACE::ITKSizeFromMLVector<SizeType>(
kExt);
135 ML_NAMESPACE::ImageVector pos(0);
138 for (
size_t n=0;
n <
kernel.getTabSize();
n++){
139 pos.set(
kernel.getCoordTab()[
n]);
140 for (
unsigned int i=0;
i<offset.GetOffsetDimension();
i++){
147 (*this)[offset] =
static_cast<TPixel>(
kernel.getValueTab()[
n]);
157template<
class TPixel,
unsigned int VDimension = 2,
class TAllocator = NeighborhoodAllocator<TPixel> >
228#define ML_ITK_KERNEL_WRAPPER_TYPEDEFS_0(CLASS_NAME, NAMESPACE) \
233 typedef itk::MLITKStructuringElement<ITK_INDATATYPE,DIM> MLITKKernelType; \
238 typedef NAMESPACE::CLASS_NAME<_TEMPLATE_INPUTS0, MLITKKernelType> FilterType; \
245#define ML_ITK_KERNEL_WRAPPER_TYPEDEFS_1(CLASS_NAME, NAMESPACE) \
250 typedef itk::MLITKStructuringElement<ITK_INDATATYPE,DIM> MLITKKernelType; \
255 typedef NAMESPACE::CLASS_NAME<_TEMPLATE_INPUTS1, MLITKKernelType> FilterType; \
263#define ML_ITK_KERNEL_WRAPPER_TYPEDEFS_2(CLASS_NAME, NAMESPACE) \
268 typedef itk::MLITKStructuringElement<ITK_INDATATYPE,DIM> MLITKKernelType; \
273 typedef NAMESPACE::CLASS_NAME<_TEMPLATE_INPUTS2, MLITKKernelType> FilterType; \
281#define ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_0(CLASS_NAME, NAMESPACE) \
286 typedef itk::FlatStructuringElement<DIM> MLITKFLATKernelType; \
291 typedef NAMESPACE::CLASS_NAME<_TEMPLATE_INPUTS0, MLITKFLATKernelType > FilterType; \
298#define ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_1(CLASS_NAME, NAMESPACE) \
303 typedef itk::FlatStructuringElement<DIM> MLITKFLATKernelType; \
308 typedef NAMESPACE::CLASS_NAME<_TEMPLATE_INPUTS1, MLITKFLATKernelType > FilterType; \
317#define ML_ITK_KERNEL_WRAPPER_0_2D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
318 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
319 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_0, \
320 ML_IMPLEMENT_ALL_ITK_2D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
327#define ML_ITK_KERNEL_WRAPPER_0_3D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
328 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
329 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_0, \
330 ML_IMPLEMENT_ALL_ITK_3D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
336#define ML_ITK_KERNEL_WRAPPER_0_6D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
337 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
338 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_0, \
339 ML_IMPLEMENT_ALL_ITK_6D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
347#define ML_ITK_KERNEL_WRAPPER_1_2D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
348 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
349 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_1, \
350 ML_IMPLEMENT_ALL_ITK_2D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
357#define ML_ITK_KERNEL_WRAPPER_1_3D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
358 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
359 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_1, \
360 ML_IMPLEMENT_ALL_ITK_3D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
366#define ML_ITK_KERNEL_WRAPPER_1_6D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
367 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
368 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_1, \
369 ML_IMPLEMENT_ALL_ITK_6D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
376#define ML_ITK_KERNEL_WRAPPER_2_6D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
377 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
378 ML_ITK_KERNEL_WRAPPER_TYPEDEFS_2, \
379 ML_IMPLEMENT_ALL_ITK_6D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
389#define ML_ITK_FLAT_KERNEL_WRAPPER_0_2D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
390 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
391 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_0, \
392 ML_IMPLEMENT_ALL_ITK_2D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
399#define ML_ITK_FLAT_KERNEL_WRAPPER_0_3D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
400 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
401 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_0, \
402 ML_IMPLEMENT_ALL_ITK_3D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
408#define ML_ITK_FLAT_KERNEL_WRAPPER_0_6D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
409 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
410 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_0, \
411 ML_IMPLEMENT_ALL_ITK_6D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
419#define ML_ITK_FLAT_KERNEL_WRAPPER_1_2D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
420 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
421 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_1, \
422 ML_IMPLEMENT_ALL_ITK_2D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
429#define ML_ITK_FLAT_KERNEL_WRAPPER_1_3D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
430 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
431 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_1, \
432 ML_IMPLEMENT_ALL_ITK_3D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
438#define ML_ITK_FLAT_KERNEL_WRAPPER_1_6D(PROJECT_PREFIX, CLASS_NAME, NAMESPACE) \
439 _ML_ITK_WRAPPER(PROJECT_PREFIX, CLASS_NAME, NAMESPACE, _ML_ITK_DETERMINE_IN_REGION_N, \
440 ML_ITK_FLAT_KERNEL_WRAPPER_TYPEDEFS_1, \
441 ML_IMPLEMENT_ALL_ITK_6D_CASES, _ML_ITK_DETERMINE_OUT_REGION_N)
Template class to create an itk structured element from an ML kernel.
Superclass::SizeType SizeType
Size and value typedef support.
virtual void CreateStructuringElement(const ml::Kernel &kernel)
Create the structuring element.
Self & operator=(const Self &other)
Assignment operator. Only superclass stuff is done.
virtual ~MLITKStructuringElementBase()
Default destructor. Only superclass stuff is done.
Superclass::RadiusType RadiusType
Radius typedef support.
MLITKStructuringElementBase()
Default constructor.
virtual void setKernelFromString(const std::string &kernelStr)
Convenience constructor from a string description of an ML kernel.
itkStaticConstMacro(NeighborhoodDimension, unsigned int, VDimension)
External support for dimensionality.
TPixel PixelType
External support for pixel type.
Superclass::SizeValueType SizeValueType
TAllocator AllocatorType
External support for allocator type.
MLITKStructuringElementBase(const ml::Kernel &kernel)
Convenience constructor directly from the ML kernel.
Superclass::OffsetType OffsetType
Offset and value typedef support.
OffsetType::OffsetValueType OffsetValueType
AllocatorType::iterator Iterator
Iterator typedef support.
MLITKStructuringElementBase(const Self &other)
Copy constructor. Only superclass stuff is done.
AllocatorType::const_iterator ConstIterator
SliceIterator< TPixel, Self > SliceIteratorType
External slice iterator type typedef support.
MLITKStructuringElementBase Self
Standard self typedef.
Neighborhood< TPixel, VDimension, TAllocator > Superclass
Standard super class typedef.
Specialized class for generated toolkit modules using normal kernels.
MLITKStructuringElement(const ml::Kernel &kernel)
Convenience constructor directly from the ML kernel.
Superclass::RadiusType RadiusType
Radius typedef support.
SliceIterator< TPixel, Self > SliceIteratorType
External slice iterator type typedef support.
TAllocator AllocatorType
External support for allocator type.
AllocatorType::iterator Iterator
Iterator typedef support.
Superclass::OffsetType OffsetType
Offset and value typedef support.
itkStaticConstMacro(NeighborhoodDimension, unsigned int, VDimension)
External support for dimensionality.
MLITKStructuringElement(const Self &other)
Copy constructor. Only superclass stuff is done.
MLITKStructuringElement Self
Standard self typedef.
TPixel PixelType
External support for pixel type.
OffsetType::OffsetValueType OffsetValueType
MLITKStructuringElementBase< TPixel, VDimension, TAllocator, NeighbourHoodClass > Superclass
Standard super class typedef.
Superclass::SizeType SizeType
Size and value typedef support.
Self & operator=(const Self &other)
Assignment operator. Only superclass stuff is done.
AllocatorType::const_iterator ConstIterator
MLITKStructuringElement()
Default constructor.
Superclass::SizeValueType SizeValueType
Neighborhood< TPixel, VDimension, TAllocator > NeighbourHoodClass
Used neighborhood.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Include dll-specific settings.