18 #ifndef itkConstShapedNeighborhoodIterator_h
19 #define itkConstShapedNeighborhoodIterator_h
70 template<
typename TImage,
typename TBoundaryCondition =
82 itkStaticConstMacro(
Dimension,
unsigned int, TImage::ImageDimension);
124 m_NeighborhoodIterator = s;
145 { m_ListIterator++; }
148 { m_ListIterator--; }
169 if ( m_ListIterator == m_NeighborhoodIterator->GetActiveIndexList().end() )
181 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().begin();
186 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().end();
190 {
return m_NeighborhoodIterator->GetPixel(*m_ListIterator); }
193 {
return m_NeighborhoodIterator->
GetOffset(*m_ListIterator); }
196 {
return *m_ListIterator; }
205 { m_NeighborhoodIterator->SetPixel(*m_ListIterator, v); }
211 {
return m_ConstBeginIterator; }
216 {
return m_ConstEndIterator; }
221 InitializeConstShapedNeighborhoodIterator();
229 m_ConstEndIterator.GoToEnd();
230 m_CenterIsActive =
false;
244 InitializeConstShapedNeighborhoodIterator();
250 using Superclass::GetImagePointer;
251 using Superclass::GetRadius;
252 using Superclass::GetIndex;
253 using Superclass::GetNeighborhoodIndex;
254 using Superclass::GetCenterNeighborhoodIndex;
255 using Superclass::GetRegion;
256 using Superclass::GetBeginIndex;
257 using Superclass::GoToBegin;
258 using Superclass::GoToEnd;
259 using Superclass::IsAtBegin;
260 using Superclass::IsAtEnd;
261 using Superclass::GetOffset;
262 using Superclass::operator==;
263 using Superclass::operator!=;
264 using Superclass::operator<;
265 using Superclass::operator>;
266 using Superclass::operator>=;
267 using Superclass::operator<=;
268 using Superclass::operator[];
269 using Superclass::GetElement;
270 using Superclass::SetLocation;
271 using Superclass::GetCenterPointer;
272 using Superclass::GetCenterPixel;
273 using Superclass::OverrideBoundaryCondition;
274 using Superclass::ResetBoundaryCondition;
275 using Superclass::GetBoundaryCondition;
276 using Superclass::GetNeedToUseBoundaryCondition;
277 using Superclass::SetNeedToUseBoundaryCondition;
278 using Superclass::NeedToUseBoundaryConditionOn;
279 using Superclass::NeedToUseBoundaryConditionOff;
280 using Superclass::Print;
281 using Superclass::operator-;
282 using Superclass::GetPixel;
283 using Superclass::SetRegion;
290 Superclass::operator=(orig);
291 m_ActiveIndexList = orig.m_ActiveIndexList;
292 m_CenterIsActive = orig.m_CenterIsActive;
297 m_ConstEndIterator.GoToBegin();
303 virtual void PrintSelf(std::ostream &,
Indent)
const;
309 { this->ActivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
311 { this->DeactivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
317 m_ActiveIndexList.clear();
318 m_ConstBeginIterator.GoToBegin();
319 m_ConstEndIterator.GoToEnd();
320 m_CenterIsActive =
false;
326 {
return m_ActiveIndexList; }
330 {
return m_ActiveIndexList.size(); }
335 void CreateActiveListFromNeighborhood(
const NeighborhoodType &);
348 Self & operator+=(
const OffsetType &);
353 Self & operator-=(
const OffsetType &);
356 using Superclass::SetPixel;
357 using Superclass::SetCenterPixel;
385 #ifndef ITK_MANUAL_INSTANTIATION
386 #include "itkConstShapedNeighborhoodIterator.hxx"
bool operator!=(const ConstIterator &o) const
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
Superclass::SizeType SizeType
IndexType::IndexValueType IndexValueType
Index< itkGetStaticConstMacro(Dimension) > IndexType
std::list< NeighborIndexType > IndexListType
IndexListType::const_iterator IndexListConstIterator
TImage::PixelType PixelType
void InitializeConstShapedNeighborhoodIterator()
ImageBoundaryCondition< ImageType > * ImageBoundaryConditionPointerType
Superclass::RadiusType RadiusType
A light-weight container object for storing an N-dimensional neighborhood of values.
TBoundaryCondition BoundaryConditionType
const OffsetValueType * GetOffset() const
virtual void ActivateOffset(const OffsetType &off)
ConstIterator m_ConstBeginIterator
IndexListType::const_iterator m_ListIterator
NeighborhoodType::NeighborIndexType NeighborIndexType
virtual void ClearActiveList()
Self & operator=(const Self &orig)
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
unsigned long SizeValueType
void ProtectedSet(const PixelType &v) const
virtual void DeactivateOffset(const OffsetType &off)
const IndexListType & GetActiveIndexList() const
Superclass::SizeType SizeType
TImage::InternalPixelType InternalPixelType
Superclass::ConstIterator ConstIterator
::itk::IndexValueType IndexValueType
ConstShapedNeighborhoodIterator()
ConstIterator m_ConstEndIterator
Neighborhood< PixelType, itkGetStaticConstMacro(Dimension) > NeighborhoodType
ConstShapedNeighborhoodIterator Self
IndexListType::size_type GetActiveIndexListSize() const
IndexListType::iterator IndexListIterator
OffsetType GetNeighborhoodOffset() const
const unsigned int Dimension
Superclass::OffsetType OffsetType
ConstShapedNeighborhoodIterator(const SizeType &radius, const ImageType *ptr, const RegionType ®ion)
ImageType::RegionType RegionType
ConstIterator(const ConstIterator &o)
TImage::PixelType PixelType
OffsetType::OffsetValueType OffsetValueType
NeighborhoodIterator< TImage, TBoundaryCondition > Superclass
const ConstIterator & End() const
NeighborhoodType::NeighborIndexType NeighborIndexType
Control indentation during Print() invocation.
Self * m_NeighborhoodIterator
IndexListType m_ActiveIndexList
ImageBaseType::SizeType SizeType
ConstIterator & operator=(const ConstIterator &o)
virtual ~ConstShapedNeighborhoodIterator()
const ConstIterator & operator++()
itk::OffsetValueType OffsetValueType
const ConstIterator & operator--()
bool operator==(const ConstIterator &o) const
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
const ConstIterator & Begin() const
SizeType::SizeValueType SizeValueType
TImage::RegionType RegionType
IndexListType::value_type GetNeighborhoodIndex() const
SizeValueType NeighborIndexType