00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00190 template<class TImage>
00191 class ITK_EXPORT NeighborhoodIterator
00192 : public ConstNeighborhoodIterator<TImage>
00193 {
00194 public:
00196 typedef NeighborhoodIterator Self;
00197 typedef ConstNeighborhoodIterator<TImage> Superclass;
00198
00200 typedef typename Superclass::InternalPixelType InternalPixelType;
00201 typedef typename Superclass::PixelType PixelType;
00202 typedef typename Superclass::SizeType SizeType;
00203 typedef typename Superclass::ImageType ImageType;
00204 typedef typename Superclass::RegionType RegionType;
00205 typedef typename Superclass::IndexType IndexType;
00206 typedef typename Superclass::OffsetType OffsetType;
00207 typedef typename Superclass::RadiusType RadiusType;
00208 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00209 typedef typename Superclass::Iterator Iterator;
00210 typedef typename Superclass::ConstIterator ConstIterator;
00211 typedef typename Superclass::ImageBoundaryConditionPointerType
00212 ImageBoundaryConditionPointerType;
00213
00215 NeighborhoodIterator(): Superclass() {}
00216
00218 NeighborhoodIterator( const NeighborhoodIterator &n )
00219 : Superclass(n) {}
00220
00222 Self &operator=(const Self& orig)
00223 {
00224 Superclass::operator=(orig);
00225 return *this;
00226 }
00227
00230 NeighborhoodIterator(const SizeType &radius, ImageType * ptr,
00231 const RegionType ®ion)
00232 : Superclass(radius, ptr, region) { }
00233
00235 virtual void PrintSelf(std::ostream &, Indent) const;
00236
00238 InternalPixelType *GetCenterPointer()
00239 { return (this->operator[]((this->Size())>>1)); }
00240
00242 virtual void SetCenterPixel(const PixelType &p)
00243 { *( this->GetCenterPointer() ) = p; }
00244
00248 virtual void SetNeighborhood(const NeighborhoodType &);
00249
00251 virtual void SetPixel(const unsigned long i, const PixelType &v)
00252 { *(this->operator[](i)) = v; }
00253
00254 };
00255
00256 }
00257
00258
00259 #ifndef ITK_MANUAL_INSTANTIATION
00260 #include "itkNeighborhoodIterator.txx"
00261 #endif
00262
00263 #endif