ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageSliceConstIteratorWithIndex.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkImageSliceConstIteratorWithIndex_h
00019 #define __itkImageSliceConstIteratorWithIndex_h
00020 
00021 #include "itkImageConstIteratorWithIndex.h"
00022 
00023 namespace itk
00024 {
00113 template< typename TImage >
00114 class ITK_EXPORT ImageSliceConstIteratorWithIndex:public ImageConstIteratorWithIndex< TImage >
00115 {
00116 public:
00118   typedef ImageSliceConstIteratorWithIndex      Self;
00119   typedef ImageConstIteratorWithIndex< TImage > Superclass;
00120 
00122   typedef typename Superclass::IndexType             IndexType;
00123   typedef typename Superclass::SizeType              SizeType;
00124   typedef typename Superclass::OffsetType            OffsetType;
00125   typedef typename Superclass::RegionType            RegionType;
00126   typedef typename Superclass::ImageType             ImageType;
00127   typedef typename Superclass::PixelContainer        PixelContainer;
00128   typedef typename Superclass::PixelContainerPointer PixelContainerPointer;
00129   typedef typename Superclass::InternalPixelType     InternalPixelType;
00130   typedef typename Superclass::PixelType             PixelType;
00131   typedef typename Superclass::AccessorType          AccessorType;
00132 
00134   ImageSliceConstIteratorWithIndex():ImageConstIteratorWithIndex< TImage >() {}
00135 
00138   ImageSliceConstIteratorWithIndex(const ImageType *ptr,
00139                                    const RegionType & region):
00140     ImageConstIteratorWithIndex< TImage >(ptr, region)
00141   {
00142     m_Direction_A = 0;
00143     m_Direction_B = 1;
00144   }
00146 
00153   ImageSliceConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > & it)
00154   { this->ImageConstIteratorWithIndex< TImage >::operator=(it); }
00155 
00158   void NextLine(void);
00159 
00161   void GoToBeginOfSlice(void);
00162 
00165   void NextSlice(void);
00166 
00169   void PreviousLine(void);
00170 
00173   void PreviousSlice(void);
00174 
00176   bool IsAtEndOfLine(void);
00177 
00179   bool IsAtEndOfSlice(void);
00180 
00182   bool IsAtReverseEndOfLine(void);
00183 
00185   bool IsAtReverseEndOfSlice(void);
00186 
00188   void SetFirstDirection(unsigned int direction);
00189 
00191   void SetSecondDirection(unsigned int direction);
00192 
00196   inline Self & operator++();
00197 
00201   inline Self & operator--();
00202 
00203 private:
00204   SizeValueType m_PixelJump;
00205   SizeValueType m_LineJump;
00206   unsigned int  m_Direction_A;
00207   unsigned int  m_Direction_B;
00208 };
00209 } // end namespace itk
00210 
00211 #ifndef ITK_MANUAL_INSTANTIATION
00212 #include "itkImageSliceConstIteratorWithIndex.hxx"
00213 #endif
00214 
00215 #endif
00216