ITK  5.0.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< typename TImage, typename TPath >
68 class ITK_TEMPLATE_EXPORT PathIterator:public PathConstIterator< TImage, TPath >
69 {
70 public:
71 
73  using Self = PathIterator;
74 
79  static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension;
80 
83 
85  using IndexType = typename Superclass::IndexType;
87  using SizeType = typename Superclass::SizeType;
88  using ImageType = typename Superclass::ImageType;
92  using PixelType = typename Superclass::PixelType;
94  using PathType = typename Superclass::PathType;
97 
99  itkTypeMacro(PathIterator, PathConstIterator);
100 
102  void Set(const PixelType & value)
103  {
104  // Normally, this would just be the following:
105  // m_Image->SetPixel(m_CurrentImageIndex,value);
106  // However, we don't want a warning about m_Image being a ConstPointer
107  // in the Superclass.
108  const_cast< ImageType * >( this->m_Image.GetPointer() )->
109  SetPixel(this->m_CurrentImageIndex, value);
110  }
112 
117  {
118  return this->GetImage()->GetPixel(this->m_ImageIndex);
119  }
120 
123  Self & operator=(const Self & it);
124 
126  PathIterator(ImageType *imagePtr, const PathType *pathPtr);
127 
129  ~PathIterator() override = default;
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkPathIterator.hxx"
135 #endif
136 
137 #endif
typename PathType::InputType PathInputType
typename TImage::OffsetType OffsetType
typename TImage::InternalPixelType InternalPixelType
typename TImage::SizeType SizeType
PixelType & Value()
PathIterator iterates (traces) over a path through an image.
void Set(const PixelType &value)
typename TImage::IndexType IndexType
typename TImage::AccessorType AccessorType
typename PixelContainer::Pointer PixelContainerPointer
typename PathType::OutputType PathOutputType
typename TImage::PixelType PixelType
PathConstIterator iterates (traces) over a path through an image.
typename TImage::PixelContainer PixelContainer