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 
00209 template<class TImage, class TBoundaryCondition
00210                        = ZeroFluxNeumannBoundaryCondition<TImage> >
00211 class ITK_EXPORT NeighborhoodIterator
00212   :  public ConstNeighborhoodIterator<TImage,TBoundaryCondition>
00213 {
00214 public:
00216   typedef NeighborhoodIterator Self;
00217   typedef ConstNeighborhoodIterator<TImage,TBoundaryCondition> Superclass;
00218   
00220   typedef typename Superclass::InternalPixelType InternalPixelType;
00221   typedef typename Superclass::PixelType  PixelType;
00222   typedef typename Superclass::SizeType   SizeType;
00223   typedef typename Superclass::ImageType  ImageType;
00224   typedef typename Superclass::RegionType RegionType;
00225   typedef typename Superclass::IndexType  IndexType;
00226   typedef typename Superclass::OffsetType OffsetType;
00227   typedef typename OffsetType::OffsetValueType OffsetValueType;
00228   typedef typename Superclass::RadiusType RadiusType;
00229   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00230   typedef typename Superclass::Iterator      Iterator;
00231   typedef typename Superclass::ConstIterator ConstIterator;
00232   typedef typename Superclass::ImageBoundaryConditionPointerType
00233    ImageBoundaryConditionPointerType;
00234     
00236   NeighborhoodIterator(): Superclass() {}
00237   
00239   NeighborhoodIterator( const NeighborhoodIterator &n )
00240     : Superclass(n) {}
00241   
00243   Self &operator=(const Self& orig)
00244     {
00245       Superclass::operator=(orig);
00246       return *this;
00247     }
00248   
00251   NeighborhoodIterator(const SizeType &radius, ImageType * ptr,
00252                        const RegionType &region)
00253     : Superclass(radius, ptr, region) { }
00254 
00256   virtual void PrintSelf(std::ostream &, Indent) const;
00257 
00259   InternalPixelType *GetCenterPointer()
00260     { return (this->operator[]((this->Size())>>1)); }
00261 
00263   virtual void SetCenterPixel(const PixelType &p)
00264   { this->m_NeighborhoodAccessorFunctor.Set(this->operator[]((this->Size())>>1), p); }
00265   
00269   virtual void SetNeighborhood(const NeighborhoodType &);
00270 
00273   virtual void SetPixel(const unsigned i, const PixelType &v,
00274                         bool  &status);
00275   
00277   virtual void SetPixel(const unsigned i, const PixelType &v);
00278   //  { *(this->operator[](i)) = v; }
00279   
00281   virtual void SetPixel(const OffsetType o, const PixelType &v)
00282   { this->SetPixel(this->GetNeighborhoodIndex(o), v); }
00283     //  { *(this->operator[](o)) = v; }
00284 
00288   virtual void SetNext(const unsigned axis, const unsigned i,
00289                             const PixelType &v)
00290   {   this->SetPixel(this->GetCenterNeighborhoodIndex()
00291                      + (i * this->GetStride(axis)), v); }
00292   
00293   
00297   virtual void SetNext(const unsigned axis, const PixelType &v)
00298     {   this->SetPixel(this->GetCenterNeighborhoodIndex()
00299                        + this->GetStride(axis), v); }
00300   
00304   virtual void SetPrevious(const unsigned axis, const unsigned i,
00305                                 const PixelType &v)
00306     { this->SetPixel(this->GetCenterNeighborhoodIndex()
00307                      - (i * this->GetStride(axis)), v); }
00308   
00309   
00313   virtual void SetPrevious(const unsigned axis,
00314                                 const PixelType &v)
00315     { this->SetPixel(this->GetCenterNeighborhoodIndex()
00316                      - this->GetStride(axis), v); }
00317   
00318 };
00319 
00320 } // namespace itk
00321 
00322 
00323 #ifndef ITK_MANUAL_INSTANTIATION
00324 #include "itkNeighborhoodIterator.txx"
00325 #endif
00326 
00327 #endif

Generated at Wed May 24 23:46:02 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000