ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkShapedNeighborhoodIterator.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 itkShapedNeighborhoodIterator_h
19 #define itkShapedNeighborhoodIterator_h
20 
21 #include <vector>
22 #include <list>
24 
25 namespace itk
26 {
150 template< typename TImage, typename TBoundaryCondition =
153  public ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >
154 {
155 public:
157  typedef typename TImage::InternalPixelType InternalPixelType;
158  typedef typename TImage::PixelType PixelType;
159 
161  itkStaticConstMacro(Dimension, unsigned int, TImage::ImageDimension);
162 
167 
172  typedef typename Superclass::SizeType SizeType;
183 
185  struct Iterator:public ConstIterator {
186  Iterator() {}
189 
192  {
194  return *this;
195  }
196 
197  // Promote to public
198  void Set(const PixelType & v) const
200  };
201 
204  {
205  m_BeginIterator = Iterator(this);
206  m_EndIterator = Iterator(this);
208  }
210 
213 
217  const ImageType *ptr,
218  const RegionType & region
219  ):Superclass(radius, const_cast< ImageType * >( ptr ),
220  region)
221  {
222  m_BeginIterator = Iterator(this);
223  m_EndIterator = Iterator(this);
225  }
227 
228  // Expose the following methods from the superclass. This is a restricted
229  // subset of the methods available for NeighborhoodIterator.
230  using Superclass::SetPixel;
232 
233 
235  Self & operator=(const Self & orig)
236  {
237  Superclass::operator=(orig);
238 
239  // Reset begin and end pointer locations
242  return *this;
243  }
244 
246  virtual void PrintSelf(std::ostream &, Indent) const;
247 
251  Iterator & End() { return m_EndIterator; }
253 
256  const ConstIterator & End() const
257  { return this->m_ConstEndIterator; }
258 
260  {
264  }
265 
266 protected:
267 
269  ShapedNeighborhoodIterator(const ShapedNeighborhoodIterator & o) ITK_DELETE_FUNCTION;
270 
272 
274  {
278  }
279 
281  {
285  }
286 
289 };
290 } // namespace itk
291 
292 #ifndef ITK_MANUAL_INSTANTIATION
293 #include "itkShapedNeighborhoodIterator.hxx"
294 #endif
295 
296 #endif
Superclass::BoundaryConditionType BoundaryConditionType
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
Superclass::ImageBoundaryConditionPointerType ImageBoundaryConditionPointerType
Index< itkGetStaticConstMacro(Dimension) > IndexType
Superclass::NeighborhoodType NeighborhoodType
ImageBoundaryCondition< ImageType > * ImageBoundaryConditionPointerType
A light-weight container object for storing an N-dimensional neighborhood of values.
ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition > Superclass
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A neighborhood iterator which can take on an arbitrary shape.
ShapedNeighborhoodIterator(const SizeType &radius, const ImageType *ptr, const RegionType &region)
virtual void DeactivateIndex(NeighborIndexType)
virtual void SetCenterPixel(const PixelType &p)
Neighborhood< PixelType, itkGetStaticConstMacro(Dimension) > NeighborhoodType
virtual void ActivateIndex(NeighborIndexType)
virtual void PrintSelf(std::ostream &, Indent) const
virtual void SetPixel(const unsigned i, const PixelType &v, bool &status)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
AllocatorType::const_iterator ConstIterator
SizeType::SizeValueType SizeValueType
itk::OffsetValueType OffsetValueType
Definition: itkOffset.h:69
Superclass::NeighborIndexType NeighborIndexType
SizeValueType NeighborIndexType