ITK  6.0.0
Insight Toolkit
itkPathIterator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
22
23namespace itk
24{
67template <typename TImage, typename TPath>
68class ITK_TEMPLATE_EXPORT PathIterator : public PathConstIterator<TImage, TPath>
69{
70public:
71
74
79 static constexpr unsigned int ImageIteratorDimension = TImage::ImageDimension;
80
83
85 using typename Superclass::IndexType;
86 using typename Superclass::OffsetType;
87 using typename Superclass::SizeType;
88 using typename Superclass::ImageType;
89 using typename Superclass::PixelContainer;
91 using typename Superclass::InternalPixelType;
92 using typename Superclass::PixelType;
93 using typename Superclass::AccessorType;
94 using typename Superclass::PathType;
95 using typename Superclass::PathInputType;
96 using typename Superclass::PathOutputType;
97
99 itkOverrideGetNameOfClassMacro(PathIterator);
100
102 void
103 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())->SetPixel(this->m_CurrentImageIndex, value);
110 }
116 PixelType &
118 {
119 return this->GetImage()->GetPixel(this->m_ImageIndex);
120 }
121
124 Self &
125 operator=(const Self & it);
126
128 PathIterator(ImageType * imagePtr, const PathType * pathPtr);
129
131 ~PathIterator() override = default;
132};
133} // end namespace itk
134
135#ifndef ITK_MANUAL_INSTANTIATION
136# include "itkPathIterator.hxx"
137#endif
138
139#endif
Pixel-wise addition of two images.
PathConstIterator iterates (traces) over a path through an image.
typename TImage::PixelContainer PixelContainer
typename TImage::InternalPixelType InternalPixelType
typename PixelContainer::Pointer PixelContainerPointer
typename PathType::InputType PathInputType
typename TImage::PixelType PixelType
typename PathType::OutputType PathOutputType
typename TImage::OffsetType OffsetType
typename TImage::AccessorType AccessorType
PathIterator iterates (traces) over a path through an image.
void Set(const PixelType &value)
Self & operator=(const Self &it)
~PathIterator() override=default
PathIterator(ImageType *imagePtr, const PathType *pathPtr)
PixelType & Value()
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....