ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBinaryCrossStructuringElement.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkBinaryCrossStructuringElement_h
19 #define itkBinaryCrossStructuringElement_h
20 
21 #include "itkNeighborhood.h"
22 
23 namespace itk
24 {
51 template< typename TPixel, unsigned int VDimension = 2,
52  typename TAllocator = NeighborhoodAllocator< TPixel > >
53 class ITK_TEMPLATE_EXPORT BinaryCrossStructuringElement:
54  public Neighborhood< TPixel, VDimension, TAllocator >
55 {
56 public:
60 
62  using AllocatorType = TAllocator;
63 
65  static constexpr unsigned int NeighborhoodDimension = VDimension;
66 
68  using PixelType = TPixel;
69 
73  using Iterator = typename AllocatorType::iterator;
74  using ConstIterator = typename AllocatorType::const_iterator;
75 
77  using SizeType = typename Superclass::SizeType;
79 
83 
86 
89 
92  {
93  // Default structuring element is defined to be 3x3x3...
94  RadiusType radius;
95  radius.Fill(1);
96  Self::SetRadius(radius);
97  Self::CreateStructuringElement();
98  }
100 
102  ~BinaryCrossStructuringElement() override = default;
103 
106  Neighborhood< TPixel, VDimension, TAllocator >(other)
107  {}
108 
110  Self & operator=(const Self & other)
111  {
112  Superclass::operator=(other);
113  return *this;
114  }
116 
118  void CreateStructuringElement();
119 
120 protected:
121 
122 private:
123 };
124 } // namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 #include "itkBinaryCrossStructuringElement.hxx"
128 #endif
129 
130 #endif
typename SizeType::SizeValueType SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
A light-weight container object for storing an N-dimensional neighborhood of values.
typename OffsetType::OffsetValueType OffsetValueType
typename AllocatorType::iterator Iterator
typename AllocatorType::const_iterator ConstIterator
Represent a n-dimensional size (bounds) of a n-dimensional image.
Definition: itkSize.h:68
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
Definition: itkOffset.h:67
A flexible iterator for itk containers(i.e. itk::Neighborhood) that support pixel access through oper...
TAllocator AllocatorType
A Neighborhood that represents a cross structuring element with binary elements.
void Fill(SizeValueType value)
Definition: itkSize.h:201
signed long OffsetValueType
Definition: itkIntTypes.h:94