00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 ®ion
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 }
00151
00152
00153 #ifndef ITK_MANUAL_INSTANTIATION
00154 #include "itkConstRandomAccessNeighborhoodIterator.txx"
00155 #endif
00156
00157 #endif