Orfeo Toolbox  3.16
itkShapedNeighborhoodIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkShapedNeighborhoodIterator.h,v $
5  Language: C++
6  Date: $Date: 2009-03-03 15:09:16 $
7  Version: $Revision: 1.13 $
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 __itkShapedNeighborhoodIterator_h
18 #define __itkShapedNeighborhoodIterator_h
19 
20 #include <vector>
21 #include <list>
23 
24 namespace itk {
25 
142 template<class TImage, class TBoundaryCondition
143  = ZeroFluxNeumannBoundaryCondition<TImage> >
145  : public ConstShapedNeighborhoodIterator<TImage, TBoundaryCondition>
146 {
147 public:
149  typedef typename TImage::InternalPixelType InternalPixelType;
150  typedef typename TImage::PixelType PixelType;
151 
153  itkStaticConstMacro(Dimension, unsigned int, TImage::ImageDimension);
154 
159 
164  typedef typename Superclass::SizeType SizeType;
167  typedef typename Superclass::IndexListType IndexListType;
168  typedef typename Superclass::BoundaryConditionType BoundaryConditionType;
169  typedef typename Superclass::ImageBoundaryConditionPointerType
171  typedef typename Superclass::NeighborhoodType NeighborhoodType;
172  typedef typename Superclass::IndexType IndexType;
173  typedef typename Superclass::ImageType ImageType;
174  typedef typename Superclass::RegionType RegionType;
175  typedef typename Superclass::IndexValueType IndexValueType;
176 
178  struct Iterator : public ConstIterator
179  {
180  Iterator() {}
182 
184  const Iterator &operator=(const Iterator &o)
185  {
186  ConstIterator::operator=(o);
187  return *this;
188  }
189 
190  // Promote to public
191  void Set(const PixelType &v) const
192  { ConstIterator::ProtectedSet(v); }
193 
194  };
195 
198  {
199  m_BeginIterator = Iterator(this);
200  m_EndIterator = Iterator(this);
201  m_EndIterator.GoToEnd();
202  }
203 
206 
210  const ImageType * ptr,
211  const RegionType &region
212  ) : Superclass(radius, const_cast<ImageType*>(ptr),
213  region)
214  {
215  m_BeginIterator = Iterator(this);
216  m_EndIterator = Iterator(this);
217  m_EndIterator.GoToEnd();
218  }
219 
220  // Expose the following methods from the superclass. This is a restricted
221  // subset of the methods available for NeighborhoodIterator.
222  Superclass::SetPixel;
223  Superclass::SetCenterPixel;
224 
226  Self &operator=(const Self& orig)
227  {
228  Superclass::operator=(orig);
229 
230  // Reset begin and end pointer locations
231  m_BeginIterator.GoToBegin();
232  m_EndIterator.GoToEnd();
233  return *this;
234  }
235 
237  virtual void PrintSelf(std::ostream &, Indent) const;
238 
241  Iterator &Begin() { return m_BeginIterator; }
242  Iterator &End() { return m_EndIterator; }
243 
246  const ConstIterator &End() const
247  { return this->m_ConstEndIterator; }
248 
249  void ClearActiveList()
250  {
251  Superclass::ClearActiveList();
252  m_EndIterator.GoToEnd();
253  m_BeginIterator.GoToBegin();
254  }
255 
256 protected:
257 
260  // purposely not implemented
261 
262 
263  void ActivateIndex(const unsigned int n)
264  {
265  Superclass::ActivateIndex(n);
266  m_EndIterator.GoToEnd();
267  m_BeginIterator.GoToBegin();
268  }
269 
270  void DeactivateIndex(const unsigned int n)
271  {
272  Superclass::DeactivateIndex(n);
273  m_EndIterator.GoToEnd();
274  m_BeginIterator.GoToBegin();
275  }
278 };
279 
280 } // namespace itk
281 
282 
283 #ifndef ITK_MANUAL_INSTANTIATION
285 #endif
286 
287 #endif

Generated at Sun Feb 3 2013 00:06:00 for Orfeo Toolbox with doxygen 1.8.1.1