ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkPathIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkPathIterator_h
00019 #define __itkPathIterator_h
00020 
00021 #include "itkPathConstIterator.h"
00022 
00023 namespace itk
00024 {
00067 template< class TImage, class TPath >
00068 class ITK_EXPORT PathIterator:public PathConstIterator< TImage, TPath >
00069 {
00070 public:
00071 
00073   typedef PathIterator Self;
00074 
00079   itkStaticConstMacro(ImageIteratorDimension, unsigned int,
00080                       TImage::ImageDimension);
00081 
00083   typedef PathConstIterator< TImage, TPath > Superclass;
00084 
00086   typedef typename Superclass::IndexType             IndexType;
00087   typedef typename Superclass::OffsetType            OffsetType;
00088   typedef typename Superclass::SizeType              SizeType;
00089   typedef typename Superclass::ImageType             ImageType;
00090   typedef typename Superclass::PixelContainer        PixelContainer;
00091   typedef typename Superclass::PixelContainerPointer PixelContainerPointer;
00092   typedef typename Superclass::InternalPixelType     InternalPixelType;
00093   typedef typename Superclass::PixelType             PixelType;
00094   typedef typename Superclass::AccessorType          AccessorType;
00095   typedef typename Superclass::PathType              PathType;
00096   typedef typename Superclass::PathInputType         PathInputType;
00097   typedef typename Superclass::PathOutputType        PathOutputType;
00098 
00100   itkTypeMacro(PathIterator, PathConstIterator);
00101 
00103   void Set(const PixelType & value)
00104   {
00105     // Normally, this would just be the following:
00106     //   m_Image->SetPixel(m_CurrentImageIndex,value);
00107     // However, we don't want a warning about m_Image being a ConstPointer
00108     // in the Superclass.
00109     const_cast< ImageType * >( this->m_Image.GetPointer() )->
00110     SetPixel(this->m_CurrentImageIndex, value);
00111   }
00113 
00117   PixelType & Value(void)
00118   {
00119     return this->GetImage()->GetPixel(this->m_ImageIndex);
00120   }
00121 
00124   Self & operator=(const Self & it);
00125 
00127   PathIterator(ImageType *imagePtr, const PathType  *pathPtr);
00128 
00130   virtual ~PathIterator() {}
00131 };
00132 } // end namespace itk
00133 
00134 #ifndef ITK_MANUAL_INSTANTIATION
00135 #include "itkPathIterator.hxx"
00136 #endif
00137 
00138 #endif
00139