itkLineConstIterator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkLineConstIterator_h
00018 #define __itkLineConstIterator_h
00019
00020 #include "itkIndex.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00025
00049 template<class TImage>
00050 class ITK_EXPORT LineConstIterator
00051 {
00052 public:
00053
00055 typedef LineConstIterator Self;
00056
00061 itkStaticConstMacro(ImageIteratorDimension, unsigned int,
00062 TImage::ImageDimension);
00063
00065 typedef typename TImage::IndexType IndexType;
00066 typedef typename TImage::IndexValueType IndexValueType;
00067
00069 typedef typename TImage::OffsetType OffsetType;
00070 typedef typename TImage::OffsetValueType OffsetValueType;
00071
00073 typedef typename TImage::SizeType SizeType;
00074 typedef typename TImage::SizeValueType SizeValueType;
00075
00077 typedef typename TImage::RegionType RegionType;
00078
00080 typedef typename TImage::SpacingType SpacingType;
00081
00083 typedef typename TImage::PointType PointType;
00084
00086 typedef TImage ImageType;
00087
00091 typedef typename TImage::PixelContainer PixelContainer;
00092 typedef typename PixelContainer::Pointer PixelContainerPointer;
00093
00095 typedef typename TImage::InternalPixelType InternalPixelType;
00096
00098 typedef typename TImage::PixelType PixelType;
00099
00102 typedef typename TImage::AccessorType AccessorType;
00103
00105 itkTypeMacro(LineConstIterator, None);
00106
00108 static unsigned int GetImageIteratorDimension()
00109 {
00110 return TImage::ImageDimension;
00111 }
00112
00114 const IndexType GetIndex()
00115 {
00116 return m_CurrentImageIndex;
00117 }
00118
00120 const PixelType & Get(void) const
00121 {
00122 return m_Image->GetPixel(m_CurrentImageIndex );
00123 }
00124
00126 bool IsAtEnd()
00127 {
00128 return m_IsAtEnd;
00129 }
00130
00132 void GoToBegin();
00133
00135 void operator++();
00136
00139 Self &operator=(const Self& it);
00140
00142 LineConstIterator(const ImageType *imagePtr, const IndexType &firstIndex, const IndexType &lastIndex);
00143
00145 virtual ~LineConstIterator() {};
00146
00147
00148 protected:
00150 typename ImageType::ConstWeakPointer m_Image;
00151
00153 RegionType m_Region;
00154
00156 bool m_IsAtEnd;
00157
00159 IndexType m_CurrentImageIndex;
00160 IndexType m_StartIndex;
00161 IndexType m_LastIndex;
00162 IndexType m_EndIndex;
00163
00165
00166 unsigned int m_MainDirection;
00167
00168
00169 IndexType m_AccumulateError;
00170
00171
00172
00173 IndexType m_IncrementError;
00174
00175
00176
00177 IndexType m_MaximalError;
00178
00179
00180 IndexType m_OverflowIncrement;
00181
00182
00183
00184 IndexType m_ReduceErrorAfterIncrement;
00185 };
00186
00187 }
00188
00189
00190 #define ITK_TEMPLATE_LineConstIterator(_, EXPORT, x, y) namespace itk { \
00191 _(1(class EXPORT LineConstIterator< ITK_TEMPLATE_1 x >)) \
00192 namespace Templates { typedef LineConstIterator< ITK_TEMPLATE_1 x > \
00193 LineConstIterator##y; } \
00194 }
00195
00196 #if ITK_TEMPLATE_EXPLICIT
00197 # include "Templates/itkLineConstIterator+-.h"
00198 #endif
00199
00200 #if ITK_TEMPLATE_TXX
00201 # include "itkLineConstIterator.txx"
00202 #endif
00203
00204
00205 #endif
00206