ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkPathIterator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkPathIterator_h
19 #define __itkPathIterator_h
20 
21 #include "itkPathConstIterator.h"
22 
23 namespace itk
24 {
67 template< class TImage, class TPath >
68 class ITK_EXPORT PathIterator:public PathConstIterator< TImage, TPath >
69 {
70 public:
71 
73  typedef PathIterator Self;
74 
79  itkStaticConstMacro(ImageIteratorDimension, unsigned int,
80  TImage::ImageDimension);
81 
84 
86  typedef typename Superclass::IndexType IndexType;
88  typedef typename Superclass::SizeType SizeType;
89  typedef typename Superclass::ImageType ImageType;
93  typedef typename Superclass::PixelType PixelType;
95  typedef typename Superclass::PathType PathType;
98 
100  itkTypeMacro(PathIterator, PathConstIterator);
101 
103  void Set(const PixelType & value)
104  {
105  // Normally, this would just be the following:
106  // m_Image->SetPixel(m_CurrentImageIndex,value);
107  // However, we don't want a warning about m_Image being a ConstPointer
108  // in the Superclass.
109  const_cast< ImageType * >( this->m_Image.GetPointer() )->
110  SetPixel(this->m_CurrentImageIndex, value);
111  }
113 
117  PixelType & Value(void)
118  {
119  return this->GetImage()->GetPixel(this->m_ImageIndex);
120  }
121 
124  Self & operator=(const Self & it);
125 
127  PathIterator(ImageType *imagePtr, const PathType *pathPtr);
128 
130  virtual ~PathIterator() {}
131 };
132 } // end namespace itk
133 
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkPathIterator.hxx"
136 #endif
137 
138 #endif
139