00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 ®ion
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 }
00112
00113
00114 #ifndef ITK_MANUAL_INSTANTIATION
00115 #include "itkRandomAccessNeighborhoodIterator.txx"
00116 #endif
00117
00118 #endif