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

itkConstRandomAccessNeighborhoodIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkConstRandomAccessNeighborhoodIterator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:12 $
00007   Version:   $Revision: 1.9 $
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 __itkConstRandomAccessNeighborhoodIterator_h
00018 #define __itkConstRandomAccessNeighborhoodIterator_h
00019 
00020 #include "itkConstNeighborhoodIterator.h"
00021 
00022 namespace itk {
00023 
00039 template<class TImage>
00040 class ITK_EXPORT ConstRandomAccessNeighborhoodIterator
00041   :  public ConstNeighborhoodIterator<TImage>
00042 {
00043 public:
00045   typedef ConstRandomAccessNeighborhoodIterator Self;
00046   typedef ConstNeighborhoodIterator<TImage> Superclass;
00047   
00049   typedef typename Superclass::InternalPixelType InternalPixelType;
00050   typedef typename Superclass::PixelType  PixelType;
00051   typedef typename Superclass::SizeType   SizeType;
00052   typedef typename Superclass::SizeValueType SizeValueType;
00053   typedef typename Superclass::ImageType  ImageType;
00054   typedef typename Superclass::RegionType RegionType;
00055   typedef typename Superclass::IndexType  IndexType;
00056   typedef typename Superclass::IndexValueType IndexValueType;
00057   typedef typename Superclass::OffsetType OffsetType;
00058   typedef typename Superclass::OffsetValueType OffsetValueType;
00059   typedef typename Superclass::RadiusType RadiusType;
00060   typedef typename Superclass::NeighborhoodType NeighborhoodType;
00061   itkStaticConstMacro(Dimension, unsigned int, Superclass::Dimension);
00062   typedef typename Superclass::Iterator      Iterator;
00063   typedef typename Superclass::ConstIterator ConstIterator;
00064   typedef typename Superclass::ImageBoundaryConditionPointerType
00065    ImageBoundaryConditionPointerType;
00066     
00068   ConstRandomAccessNeighborhoodIterator()
00069     : Superclass()
00070     {}
00071 
00073   virtual ~ConstRandomAccessNeighborhoodIterator() {}
00074   
00076   ConstRandomAccessNeighborhoodIterator( const
00077                                          ConstRandomAccessNeighborhoodIterator
00078                                          &orig )
00079     : Superclass(orig)
00080     {}
00081   
00084   ConstRandomAccessNeighborhoodIterator(const SizeType &radius,
00085                        const ImageType * ptr,
00086                        const RegionType &region
00087                                         )
00088     : Superclass(radius, ptr, region)
00089     {}
00090 
00092   Self &operator=(const Self& orig)
00093     {
00094     Superclass::operator=(orig);
00095     return *this;
00096     }
00097 
00099   virtual void PrintSelf(std::ostream &, Indent) const;
00100 
00104   Self &operator+=(const OffsetType &);
00105 
00109   Self &operator-=(const OffsetType &);
00110 
00112   OffsetType operator-(const Self& b)
00113   {  return m_Loop - b.m_Loop;  }
00114   
00115 };
00116 
00117 template<class TImage>
00118 inline ConstRandomAccessNeighborhoodIterator<TImage>
00119 operator+(const ConstRandomAccessNeighborhoodIterator<TImage> &it,
00120           const typename ConstRandomAccessNeighborhoodIterator<TImage>
00121           ::OffsetType &ind)
00122 {
00123   ConstRandomAccessNeighborhoodIterator<TImage> ret;
00124   ret = it;
00125   ret += ind;
00126   return ret;
00127 }
00128 
00129 template<class TImage>
00130 inline ConstRandomAccessNeighborhoodIterator<TImage>
00131 operator+(const typename ConstRandomAccessNeighborhoodIterator<TImage>
00132           ::OffsetType &ind,
00133           const ConstRandomAccessNeighborhoodIterator<TImage> &it)
00134 {  return (it + ind); }
00135 
00136 template<class TImage>
00137 inline ConstRandomAccessNeighborhoodIterator<TImage>
00138 operator-(const ConstRandomAccessNeighborhoodIterator<TImage> &it,
00139           const typename ConstRandomAccessNeighborhoodIterator<TImage>
00140           ::OffsetType &ind)
00141 {
00142   ConstRandomAccessNeighborhoodIterator<TImage> ret;
00143   ret = it;
00144   ret -= ind;
00145   return ret;
00146 }
00147 
00148 
00149   
00150 } // namespace itk
00151 
00152 
00153 #ifndef ITK_MANUAL_INSTANTIATION
00154 #include "itkConstRandomAccessNeighborhoodIterator.txx"
00155 #endif
00156 
00157 #endif

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