ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkImageSliceConstIteratorWithIndex.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 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 
122  using SizeType = typename Superclass::SizeType;
131 
134 
138  const RegionType & region):
139  ImageConstIteratorWithIndex< TImage >(ptr, region),
140  m_PixelJump(0),
141  m_LineJump(0),
142  m_Direction_A(0),
143  m_Direction_B(1)
144  {
145  }
146 
155 
158  void NextLine();
159 
161  void GoToBeginOfSlice();
162 
165  void NextSlice();
166 
169  void PreviousLine();
170 
173  void PreviousSlice();
174 
176  bool IsAtEndOfLine() const;
177 
179  bool IsAtEndOfSlice() const;
180 
182  bool IsAtReverseEndOfLine() const;
183 
185  bool IsAtReverseEndOfSlice() const;
186 
188  void SetFirstDirection(unsigned int direction);
189 
191  void SetSecondDirection(unsigned int direction);
192 
196  inline Self & operator++();
197 
201  inline Self & operator--();
202 
203 private:
206  unsigned int m_Direction_A;
207  unsigned int m_Direction_B;
208 };
209 } // end namespace itk
210 
211 #ifndef ITK_MANUAL_INSTANTIATION
212 #include "itkImageSliceConstIteratorWithIndex.hxx"
213 #endif
214 
215 #endif
typename SizeType::SizeValueType SizeValueType
ImageSliceConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)
typename PixelContainer::Pointer PixelContainerPointer
ImageSliceConstIteratorWithIndex(const ImageType *ptr, const RegionType &region)
typename TImage::InternalPixelType InternalPixelType
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
typename TImage::PixelContainer PixelContainer
Self & operator=(const Self &it)
Multi-dimensional image iterator which only walks a region.