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

itkLineIterator.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLineIterator.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/06/06 14:53:24 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) Insight Software 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 __itkLineIterator_h
00018 #define __itkLineIterator_h
00019 
00020 #include "itkIndex.h"
00021 #include "itkImage.h"
00022 #include "itkLineConstIterator.h"
00023 
00024 namespace itk
00025 {
00026 
00051 template<class TImage>
00052 class ITK_EXPORT LineIterator : public LineConstIterator<TImage>
00053 {
00054 public:
00056   typedef LineIterator Self;
00057 
00062   itkStaticConstMacro(ImageIteratorDimension, unsigned int,
00063                       TImage::ImageDimension);
00064 
00066   typedef LineConstIterator<TImage> Superclass;
00067 
00069   typedef typename Superclass::IndexType              IndexType;
00070   typedef typename Superclass::IndexValueType         IndexValueType;
00071   typedef typename Superclass::OffsetType             OffsetType;
00072   typedef typename Superclass::OffsetValueType        OffsetValueType;
00073   typedef typename Superclass::SizeType               SizeType;
00074   typedef typename Superclass::SizeValueType          SizeValueType;
00075   typedef typename Superclass::RegionType             RegionType;
00076   typedef typename Superclass::ImageType              ImageType;
00077   typedef typename Superclass::PixelContainer         PixelContainer;
00078   typedef typename Superclass::PixelContainerPointer  PixelContainerPointer;
00079   typedef typename Superclass::InternalPixelType      InternalPixelType;
00080   typedef typename Superclass::PixelType              PixelType;
00081   typedef typename Superclass::AccessorType           AccessorType;
00082 
00084   itkTypeMacro(LineIterator, LineConstIterator);
00085   
00087   void Set( const PixelType & value)
00088     {
00089     // Normally, this would just be the following:
00090     //   m_Image->SetPixel(m_CurrentImageIndex,value);
00091     // However, we don't want a warning about m_Image being a ConstPointer
00092     // in the Superclass.
00093     const_cast<ImageType *>(this->m_Image.GetPointer())->
00094       SetPixel(this->m_CurrentImageIndex,value);
00095     }
00096 
00100   PixelType & Value(void) 
00101     {
00102     return this->GetImage()->GetPixel(this->m_ImageIndex);
00103     }
00104 
00107   Self &operator=(const Self& it);
00108 
00110   LineIterator(ImageType *imagePtr, const IndexType &firstIndex,
00111                const IndexType &lastIndex);
00112 
00114   virtual ~LineIterator() {};
00115 };
00116 
00117 } // end namespace itk
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkLineIterator.txx"
00121 #endif
00122 
00123 #endif 

Generated at Wed May 24 23:36:19 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000