00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageSliceConstIteratorWithIndex.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/01/23 04:23:26 $ 00007 Version: $Revision: 1.5 $ 00008 00009 Copyright (c) 2002 Insight Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkImageSliceConstIteratorWithIndex_h 00018 #define __itkImageSliceConstIteratorWithIndex_h 00019 00020 #include "itkImageConstIteratorWithIndex.h" 00021 00022 namespace itk 00023 { 00024 00058 template<typename TImage> 00059 class ImageSliceConstIteratorWithIndex : public ImageConstIteratorWithIndex<TImage> 00060 { 00061 public: 00063 typedef ImageSliceConstIteratorWithIndex Self; 00064 typedef ImageConstIteratorWithIndex<TImage> Superclass; 00065 00070 typedef typename TImage::IndexType IndexType; 00071 00076 typedef TImage ImageType; 00077 00079 typedef typename TImage::RegionType RegionType; 00080 00084 typedef typename TImage::PixelContainer PixelContainer; 00085 typedef typename PixelContainer::Pointer PixelContainerPointer; 00086 00088 ImageSliceConstIteratorWithIndex() : ImageConstIteratorWithIndex<TImage>() {} 00089 00092 ImageSliceConstIteratorWithIndex( const ImageType *ptr, 00093 const RegionType & region) 00094 : ImageConstIteratorWithIndex<TImage>(ptr, region) 00095 { 00096 m_Direction_A = 0; 00097 m_Direction_B = 1; 00098 } 00099 00106 ImageSliceConstIteratorWithIndex( const ImageConstIteratorWithIndex<TImage> &it) 00107 { this->ImageConstIteratorWithIndex<TImage>::operator=(it); } 00108 00111 void NextLine(void); 00112 00115 void NextSlice(void); 00116 00119 void PreviousLine(void); 00120 00123 void PreviousSlice(void); 00124 00126 bool IsAtEndOfLine(void); 00127 00129 bool IsAtEndOfSlice(void); 00130 00132 bool IsAtBeginOfLine(void); 00133 00135 bool IsAtBeginOfSlice(void); 00136 00138 void SetFirstDirection(unsigned int direction); 00139 00141 void SetSecondDirection(unsigned int direction); 00142 00146 Self & operator++(); 00147 00151 Self & operator--(); 00152 00153 private: 00154 unsigned long m_PixelJump; 00155 unsigned long m_LineJump; 00156 unsigned int m_Direction_A; 00157 unsigned int m_Direction_B; 00158 }; 00159 00160 } // end namespace itk 00161 00162 #ifndef ITK_MANUAL_INSTANTIATION 00163 #include "itkImageSliceConstIteratorWithIndex.txx" 00164 #endif 00165 00166 #endif