| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkBinaryCrossStructuringElement.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:33 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
|
#ifndef __itkBinaryCrossStructuringElement_h |
| 18 |
|
#define __itkBinaryCrossStructuringElement_h |
| 19 |
|
|
| 20 |
|
#include "itkNeighborhood.h" |
| 21 |
|
|
| 22 |
|
namespace itk { |
| 23 |
|
|
| 24 |
|
/** \class BinaryCrossStructuringElement |
| 25 |
LEN |
* \brief A Neighborhood that represents a cross structuring element with binary elements. |
| 26 |
|
* |
| 27 |
|
* This class defines a Neighborhood whose elements are either 0 or 1 |
| 28 |
|
* depending on whether they are the face connected neighbors of the |
| 29 |
|
* neighborhood center. The Neighborhood is defined to be of radii 1 |
| 30 |
|
* (i.e. 3x3x...). |
| 31 |
|
* |
| 32 |
|
* \sa Neighborhood |
| 33 |
|
* \sa MorphologyImageFilter |
| 34 |
|
* \sa BinaryDilateImageFilter |
| 35 |
|
* \sa BinaryErodeImageFilter |
| 36 |
|
* |
| 37 |
|
* \ingroup Operators |
| 38 |
|
* \ingroup ImageIterators |
| 39 |
|
*/ |
| 40 |
|
|
| 41 |
|
template<class TPixel, unsigned int VDimension = 2, |
| 42 |
|
class TAllocator = NeighborhoodAllocator<TPixel> > |
| 43 |
|
class ITK_EXPORT BinaryCrossStructuringElement |
| 44 |
IND |
**: public Neighborhood<TPixel, VDimension, TAllocator> |
| 45 |
|
{ |
| 46 |
|
public: |
| 47 |
|
/** Standard class typedefs. */ |
| 48 |
|
typedef BinaryCrossStructuringElement Self; |
| 49 |
TDA |
typedef Neighborhood<TPixel, VDimension, TAllocator> Superclass; |
| 50 |
|
|
| 51 |
|
/** External support for allocator type. */ |
| 52 |
|
typedef TAllocator AllocatorType; |
| 53 |
|
|
| 54 |
|
/** External support for dimensionality. */ |
| 55 |
|
itkStaticConstMacro(NeighborhoodDimension, unsigned int, VDimension); |
| 56 |
|
|
| 57 |
|
/** External support for pixel type. */ |
| 58 |
|
typedef TPixel PixelType; |
| 59 |
|
|
| 60 |
|
/** Iterator typedef support. Note the naming is intentional, i.e., |
| 61 |
IND |
*** ::iterator and ::const_iterator, because the allocator may be a |
| 62 |
IND |
*** vnl object or other type, which uses this form. */ |
| 63 |
|
typedef typename AllocatorType::iterator Iterator; |
| 64 |
TDA |
typedef typename AllocatorType::const_iterator ConstIterator; |
| 65 |
|
|
| 66 |
|
/** Size and value typedef support. */ |
| 67 |
|
typedef typename Superclass::SizeType SizeType; |
| 68 |
TDA |
typedef typename Superclass::SizeValueType SizeValueType; |
| 69 |
|
|
| 70 |
|
/** Offset and value typedef support. */ |
| 71 |
|
typedef typename Superclass::OffsetType OffsetType; |
| 72 |
TDA |
typedef typename OffsetType::OffsetValueType OffsetValueType; |
| 73 |
|
|
| 74 |
|
/** Radius typedef support. */ |
| 75 |
|
typedef typename Superclass::RadiusType RadiusType; |
| 76 |
|
|
| 77 |
|
/** External slice iterator type typedef support. */ |
| 78 |
|
typedef SliceIterator<TPixel, Self> SliceIteratorType; |
| 79 |
|
|
| 80 |
|
/** Default constructor. */ |
| 81 |
|
BinaryCrossStructuringElement() {} |
| 82 |
|
|
| 83 |
|
/** Default destructor. */ |
| 84 |
|
virtual ~BinaryCrossStructuringElement() {} |
| 85 |
|
|
| 86 |
|
/** Copy constructor. */ |
| 87 |
|
BinaryCrossStructuringElement(const Self& other) |
| 88 |
IND |
****: Neighborhood<TPixel, VDimension, TAllocator>(other) |
| 89 |
IND |
**{ |
| 90 |
IND |
**} |
| 91 |
|
|
| 92 |
|
/** Assignment operator. */ |
| 93 |
|
Self &operator=(const Self& other) |
| 94 |
IND |
**{ |
| 95 |
|
Superclass::operator=(other); |
| 96 |
|
return *this; |
| 97 |
IND |
**} |
| 98 |
|
|
| 99 |
|
/** Build the structuring element */ |
| 100 |
|
void CreateStructuringElement(); |
| 101 |
|
|
| 102 |
|
protected: |
| 103 |
|
|
| 104 |
|
private: |
| 105 |
|
|
| 106 |
|
}; |
| 107 |
|
|
| 108 |
|
} // namespace itk |
| 109 |
|
|
| 110 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 111 |
|
#include "itkBinaryCrossStructuringElement.txx" |
| 112 |
|
#endif |
| 113 |
|
|
| 114 |
|
#endif |
| 115 |
|
|