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

itkRandomAccessNeighborhoodIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkRandomAccessNeighborhoodIterator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.22 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkRandomAccessNeighborhoodIterator_h
00018 #define __itkRandomAccessNeighborhoodIterator_h
00019 
00020 #include <vector>
00021 #include <string.h>
00022 #include <iostream>
00023 #include "itkConstRandomAccessNeighborhoodIterator.h"
00024 
00025 namespace itk {
00026 
00041 template<class TImage>
00042 class ITK_EXPORT RandomAccessNeighborhoodIterator
00043   :  public ConstRandomAccessNeighborhoodIterator<TImage>
00044 {
00045 public:
00047   typedef RandomAccessNeighborhoodIterator Self;
00048   typedef ConstRandomAccessNeighborhoodIterator<TImage> Superclass;
00049   
00051   itkStaticConstMacro(Dimension, unsigned int, Superclass::Dimension);
00052 
00054   typedef typename Superclass::InternalPixelType InternalPixelType;
00055   typedef typename Superclass::PixelType  PixelType;
00056   typedef typename Superclass::SizeType   SizeType;
00057   typedef typename Superclass::ImageType  ImageType;
00058   typedef typename Superclass::RegionType RegionType;
00059   typedef typename Superclass::IndexType  IndexType;
00060   typedef typename Superclass::OffsetType OffsetType;
00061   typedef typename Superclass::RadiusType RadiusType;
00062   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00063   typedef typename Superclass::Iterator      Iterator;
00064   typedef typename Superclass::ConstIterator ConstIterator;
00065   typedef typename Superclass::ImageBoundaryConditionPointerType
00066    ImageBoundaryConditionPointerType;
00067     
00069   RandomAccessNeighborhoodIterator(): Superclass() {}
00070   
00072   RandomAccessNeighborhoodIterator( const RandomAccessNeighborhoodIterator &n )
00073     : Superclass(n) {}
00074   
00076   Self &operator=(const Self& orig)
00077     {
00078       Superclass::operator=(orig);
00079       return *this;
00080     }
00081   
00084   RandomAccessNeighborhoodIterator(const SizeType &radius,
00085                        ImageType * ptr,
00086                        const RegionType &region
00087                        )
00088     : Superclass(radius, ptr, region) { }
00089 
00091   virtual void PrintSelf(std::ostream &, Indent) const;
00092 
00094   InternalPixelType *GetCenterPointer()
00095     { return (this->operator[]((this->Size())>>1)); }
00096 
00098   virtual void SetCenterPixel(const PixelType &p)
00099     { *( this->GetCenterPointer() ) = p; }
00100   
00104   virtual void SetNeighborhood(const NeighborhoodType &);
00105 
00107   virtual void SetPixel(const unsigned long i, const PixelType &v)
00108     { *(this->operator[](i)) = v; }
00109 };
00110 
00111 } // namespace itk
00112 
00113 
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkRandomAccessNeighborhoodIterator.txx"
00116 #endif
00117 
00118 #endif

Generated at Wed Mar 12 01:13:09 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000