ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkConditionalConstIterator.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 itkConditionalConstIterator_h
19#define itkConditionalConstIterator_h
20
21#include "itkIndex.h"
22
23namespace itk
24{
37template <typename TImage>
38class ITK_TEMPLATE_EXPORT ConditionalConstIterator
39{
40public:
43
48 static constexpr unsigned int NDimension = TImage::ImageDimension;
49
51 using IndexType = typename TImage::IndexType;
52
54 using SizeType = typename TImage::SizeType;
55
57 using RegionType = typename TImage::RegionType;
58
60 using ImageType = TImage;
61
63 using InternalPixelType = typename TImage::InternalPixelType;
64
66 using PixelType = typename TImage::PixelType;
67
69 [[nodiscard]] virtual bool
70 IsPixelIncluded(const IndexType & index) const = 0;
71
74 Self &
75 operator=(const Self & it) = default;
76
78 static unsigned int
80 {
81 return Self::NDimension;
82 }
83
85 virtual const IndexType
86 GetIndex() = 0;
87
89 [[nodiscard]] virtual const PixelType
90 Get() const = 0;
91
93 [[nodiscard]] virtual bool
94 IsAtEnd() const = 0;
95
97 virtual void
99
102
104 virtual ~ConditionalConstIterator() = default;
105
106protected: // made protected so other iterators can access
108 // SmartPointer<const ImageType> m_Image;
109 typename ImageType::ConstWeakPointer m_Image{};
110
113
115 bool m_IsAtEnd{ false };
116};
117} // end namespace itk
118
119#endif
virtual bool IsPixelIncluded(const IndexType &index) const =0
Self & operator=(const Self &it)=default
static constexpr unsigned int NDimension
virtual ~ConditionalConstIterator()=default
typename TImage::InternalPixelType InternalPixelType
virtual const PixelType Get() const =0
virtual const IndexType GetIndex()=0
virtual bool IsAtEnd() const =0
typename TImage::RegionType RegionType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....