ITK  5.4.0
Insight Toolkit
itkImageSliceConstIteratorWithIndex.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 itkImageSliceConstIteratorWithIndex_h
19 #define itkImageSliceConstIteratorWithIndex_h
20 
22 
23 namespace itk
24 {
112 template <typename TImage>
113 class ITK_TEMPLATE_EXPORT ImageSliceConstIteratorWithIndex : public ImageConstIteratorWithIndex<TImage>
114 {
115 public:
119 
121  using typename Superclass::IndexType;
122  using typename Superclass::SizeType;
123  using typename Superclass::OffsetType;
124  using typename Superclass::RegionType;
125  using typename Superclass::ImageType;
126  using typename Superclass::PixelContainer;
127  using typename Superclass::PixelContainerPointer;
128  using typename Superclass::InternalPixelType;
129  using typename Superclass::PixelType;
130  using typename Superclass::AccessorType;
131 
134  : ImageConstIteratorWithIndex<TImage>()
135  {}
136 
140  : ImageConstIteratorWithIndex<TImage>(ptr, region)
141  , m_PixelJump(0)
142  , m_LineJump(0)
143  , m_Direction_A(0)
144  , m_Direction_B(1)
145  {}
146 
154  {
156  }
157 
160  void
161  NextLine();
162 
164  void
165  GoToBeginOfSlice();
166 
169  void
170  NextSlice();
171 
174  void
175  PreviousLine();
176 
179  void
180  PreviousSlice();
181 
183  bool
184  IsAtEndOfLine() const;
185 
187  bool
188  IsAtEndOfSlice() const;
189 
191  bool
192  IsAtReverseEndOfLine() const;
193 
195  bool
196  IsAtReverseEndOfSlice() const;
197 
199  void
200  SetFirstDirection(unsigned int direction);
201 
203  void
204  SetSecondDirection(unsigned int direction);
205 
209  inline Self &
210  operator++();
211 
215  inline Self &
216  operator--();
217 
218 private:
221  unsigned int m_Direction_A;
222  unsigned int m_Direction_B;
223 };
224 } // end namespace itk
225 
226 #ifndef ITK_MANUAL_INSTANTIATION
227 # include "itkImageSliceConstIteratorWithIndex.hxx"
228 #endif
229 
230 #endif
itk::ImageSliceConstIteratorWithIndex::ImageSliceConstIteratorWithIndex
ImageSliceConstIteratorWithIndex(const ImageType *ptr, const RegionType &region)
Definition: itkImageSliceConstIteratorWithIndex.h:139
itk::ImageConstIteratorWithIndex::PixelContainerPointer
typename PixelContainer::Pointer PixelContainerPointer
Definition: itkImageConstIteratorWithIndex.h:122
itk::ImageSliceConstIteratorWithIndex::ImageSliceConstIteratorWithIndex
ImageSliceConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)
Definition: itkImageSliceConstIteratorWithIndex.h:153
itkImageConstIteratorWithIndex.h
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::ImageSliceConstIteratorWithIndex::m_Direction_A
unsigned int m_Direction_A
Definition: itkImageSliceConstIteratorWithIndex.h:221
itk::ImageSliceConstIteratorWithIndex::m_PixelJump
SizeValueType m_PixelJump
Definition: itkImageSliceConstIteratorWithIndex.h:219
itk::ImageSliceConstIteratorWithIndex::m_Direction_B
unsigned int m_Direction_B
Definition: itkImageSliceConstIteratorWithIndex.h:222
itk::ImageSliceConstIteratorWithIndex
Multi-dimensional image iterator which only walks a region.
Definition: itkImageSliceConstIteratorWithIndex.h:113
itk::ImageConstIteratorWithIndex::PixelType
typename TImage::PixelType PixelType
Definition: itkImageConstIteratorWithIndex.h:128
itk::ImageConstIteratorWithIndex::InternalPixelType
typename TImage::InternalPixelType InternalPixelType
Definition: itkImageConstIteratorWithIndex.h:125
itk::ImageSliceConstIteratorWithIndex::ImageSliceConstIteratorWithIndex
ImageSliceConstIteratorWithIndex()
Definition: itkImageSliceConstIteratorWithIndex.h:133
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::ImageConstIteratorWithIndex::AccessorType
typename TImage::AccessorType AccessorType
Definition: itkImageConstIteratorWithIndex.h:132
itk::ImageConstIteratorWithIndex
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
Definition: itkImageConstIteratorWithIndex.h:92
itk::ImageSliceConstIteratorWithIndex::m_LineJump
SizeValueType m_LineJump
Definition: itkImageSliceConstIteratorWithIndex.h:220
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ImageConstIteratorWithIndex::RegionType
typename TImage::RegionType RegionType
Definition: itkImageConstIteratorWithIndex.h:113
AddImageFilter
Definition: itkAddImageFilter.h:81
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::ImageConstIteratorWithIndex::operator=
Self & operator=(const Self &it)
itk::ImageConstIteratorWithIndex::OffsetType
typename TImage::OffsetType OffsetType
Definition: itkImageConstIteratorWithIndex.h:136