Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkNeighborhoodIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNeighborhoodIterator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/09/07 14:46:30 $
00007   Version:   $Revision: 1.49 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkNeighborhoodIterator_h
00018 #define __itkNeighborhoodIterator_h
00019 
00020 #include <vector>
00021 #include <string.h>
00022 #include <iostream>
00023 #include "itkConstNeighborhoodIterator.h"
00024 
00025 namespace itk {
00026 
00097 
00210 template<class TImage, class TBoundaryCondition
00211                        = ZeroFluxNeumannBoundaryCondition<TImage> >
00212 class ITK_EXPORT NeighborhoodIterator
00213   :  public ConstNeighborhoodIterator<TImage,TBoundaryCondition>
00214 {
00215 public:
00217   typedef NeighborhoodIterator Self;
00218   typedef ConstNeighborhoodIterator<TImage,TBoundaryCondition> Superclass;
00219 
00221   typedef typename Superclass::InternalPixelType InternalPixelType;
00222   typedef typename Superclass::PixelType  PixelType;
00223   typedef typename Superclass::SizeType   SizeType;
00224   typedef typename Superclass::ImageType  ImageType;
00225   typedef typename Superclass::RegionType RegionType;
00226   typedef typename Superclass::IndexType  IndexType;
00227   typedef typename Superclass::OffsetType OffsetType;
00228   typedef typename OffsetType::OffsetValueType OffsetValueType;
00229   typedef typename Superclass::RadiusType RadiusType;
00230   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00231   typedef typename Superclass::Iterator      Iterator;
00232   typedef typename Superclass::ConstIterator ConstIterator;
00233   typedef typename Superclass::ImageBoundaryConditionPointerType
00234    ImageBoundaryConditionPointerType;
00235 
00237   NeighborhoodIterator(): Superclass() {}
00238 
00240   NeighborhoodIterator( const NeighborhoodIterator &n )
00241     : Superclass(n) {}
00242 
00244   Self &operator=(const Self& orig)
00245     {
00246       Superclass::operator=(orig);
00247       return *this;
00248     }
00250 
00253   NeighborhoodIterator(const SizeType &radius, ImageType * ptr,
00254                        const RegionType &region)
00255     : Superclass(radius, ptr, region) { }
00256 
00258   virtual void PrintSelf(std::ostream &, Indent) const;
00259 
00261   InternalPixelType *GetCenterPointer()
00262     { return (this->operator[]((this->Size())>>1)); }
00263 
00265   virtual void SetCenterPixel(const PixelType &p)
00266   { this->m_NeighborhoodAccessorFunctor.Set(this->operator[]((this->Size())>>1), p); }
00267 
00271   virtual void SetNeighborhood(const NeighborhoodType &);
00272 
00275   virtual void SetPixel(const unsigned i, const PixelType &v,
00276                         bool  &status);
00277 
00279   virtual void SetPixel(const unsigned i, const PixelType &v);
00280   //  { *(this->operator[](i)) = v; }
00282 
00284   virtual void SetPixel(const OffsetType o, const PixelType &v)
00285   { this->SetPixel(this->GetNeighborhoodIndex(o), v); }
00286     //  { *(this->operator[](o)) = v; }
00288 
00292   virtual void SetNext(const unsigned axis, const unsigned i,
00293                             const PixelType &v)
00294   {   this->SetPixel(this->GetCenterNeighborhoodIndex()
00295                      + (i * this->GetStride(axis)), v); }
00296 
00297   
00301   virtual void SetNext(const unsigned axis, const PixelType &v)
00302     {   this->SetPixel(this->GetCenterNeighborhoodIndex()
00303                        + this->GetStride(axis), v); }
00304 
00308   virtual void SetPrevious(const unsigned axis, const unsigned i,
00309                                 const PixelType &v)
00310     { this->SetPixel(this->GetCenterNeighborhoodIndex()
00311                      - (i * this->GetStride(axis)), v); }
00312 
00313   
00317   virtual void SetPrevious(const unsigned axis,
00318                                 const PixelType &v)
00319     { this->SetPixel(this->GetCenterNeighborhoodIndex()
00320                      - this->GetStride(axis), v); }
00321 
00322 };
00323 
00324 } // namespace itk
00325 
00326 
00327 #ifndef ITK_MANUAL_INSTANTIATION
00328 #include "itkNeighborhoodIterator.txx"
00329 #endif
00330 
00331 #endif
00332 

Generated at Wed Nov 5 23:11:27 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000