ITK  6.0.0
Insight Toolkit
itkReflectiveImageRegionConstIterator.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 itkReflectiveImageRegionConstIterator_h
19 #define itkReflectiveImageRegionConstIterator_h
20 
22 
23 namespace itk
24 {
53 template <typename TImage>
54 class ITK_TEMPLATE_EXPORT ReflectiveImageRegionConstIterator : public ImageConstIteratorWithIndex<TImage>
55 {
56 public:
57 
61 
66  using IndexType = typename TImage::IndexType;
67 
72  using ImageType = TImage;
73 
78  using PixelContainer = typename TImage::PixelContainer;
80 
86  using RegionType = typename TImage::RegionType;
87  using SizeType = typename TImage::SizeType;
89 
92  using OffsetType = typename TImage::OffsetType;
94 
97 
99  ~ReflectiveImageRegionConstIterator() override = default;
100 
103  ReflectiveImageRegionConstIterator(TImage * ptr, const RegionType & region);
104 
108 
117 
120  Self &
121  operator=(const Self & it);
122 
123  bool
124  IsReflected(unsigned int) const;
125 
133  Self &
134  operator++();
135 
137  void
138  GoToBegin();
139 
141  bool
142  IsAtBegin() const
143  {
144  return !this->m_Remaining;
145  }
146 
149  void
150  SetBeginOffset(const OffsetType & offset)
151  {
152  m_BeginOffset = offset;
153  }
154 
157  void
158  SetEndOffset(const OffsetType & offset)
159  {
160  m_EndOffset = offset;
161  }
162 
165  OffsetType
167  {
168  return m_BeginOffset;
169  }
170 
173  OffsetType
175  {
176  return m_EndOffset;
177  }
178 
180  void
181  FillOffsets(const OffsetValueType & value);
182 
183 private:
184  bool m_IsFirstPass[TImage::ImageDimension]{};
185  OffsetType m_BeginOffset{};
186  OffsetType m_EndOffset{};
187 };
188 } // end namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 # include "itkReflectiveImageRegionConstIterator.hxx"
192 #endif
193 
194 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ImageConstIteratorWithIndex::SizeType
typename TImage::SizeType SizeType
Definition: itkImageConstIteratorWithIndex.h:109
itk::ReflectiveImageRegionConstIterator::GetEndOffset
OffsetType GetEndOffset(const OffsetType &)
Definition: itkReflectiveImageRegionConstIterator.h:174
itk::ImageConstIteratorWithIndex::PixelContainerPointer
typename PixelContainer::Pointer PixelContainerPointer
Definition: itkImageConstIteratorWithIndex.h:122
itk::ReflectiveImageRegionConstIterator::SetEndOffset
void SetEndOffset(const OffsetType &offset)
Definition: itkReflectiveImageRegionConstIterator.h:158
itk::ImageConstIteratorWithIndex::OffsetValueType
typename OffsetType::OffsetValueType OffsetValueType
Definition: itkImageConstIteratorWithIndex.h:137
itkImageConstIteratorWithIndex.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ImageConstIteratorWithIndex::IndexType
typename TImage::IndexType IndexType
Definition: itkImageConstIteratorWithIndex.h:105
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ReflectiveImageRegionConstIterator
Multi-dimensional image iterator which only walks a region.
Definition: itkReflectiveImageRegionConstIterator.h:54
itk::ReflectiveImageRegionConstIterator::IsAtBegin
bool IsAtBegin() const
Definition: itkReflectiveImageRegionConstIterator.h:142
itk::ReflectiveImageRegionConstIterator::GetBeginOffset
OffsetType GetBeginOffset(const OffsetType &)
Definition: itkReflectiveImageRegionConstIterator.h:166
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageConstIteratorWithIndex
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
Definition: itkImageConstIteratorWithIndex.h:92
itk::OffsetValueType
long OffsetValueType
Definition: itkIntTypes.h:97
itk::ReflectiveImageRegionConstIterator::SetBeginOffset
void SetBeginOffset(const OffsetType &offset)
Definition: itkReflectiveImageRegionConstIterator.h:150
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ImageConstIteratorWithIndex::RegionType
typename TImage::RegionType RegionType
Definition: itkImageConstIteratorWithIndex.h:113
itk::ImageConstIteratorWithIndex::ImageType
TImage ImageType
Definition: itkImageConstIteratorWithIndex.h:116
itk::ImageConstIteratorWithIndex::PixelContainer
typename TImage::PixelContainer PixelContainer
Definition: itkImageConstIteratorWithIndex.h:121
itk::ImageConstIteratorWithIndex::SizeValueType
typename SizeType::SizeValueType SizeValueType
Definition: itkImageConstIteratorWithIndex.h:110
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageConstIteratorWithIndex::OffsetType
typename TImage::OffsetType OffsetType
Definition: itkImageConstIteratorWithIndex.h:136