18#ifndef itkConstShapedNeighborhoodIterator_h
19#define itkConstShapedNeighborhoodIterator_h
71template <
typename TImage,
typename TBoundaryCondition = ZeroFluxNeumannBoundaryCondition<TImage>>
80 static constexpr unsigned int Dimension = TImage::ImageDimension;
121 m_NeighborhoodIterator = s;
171 return m_ListIterator == o.m_ListIterator;
179 if (m_ListIterator == m_NeighborhoodIterator->GetActiveIndexList().end())
190 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().begin();
196 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().end();
202 return m_NeighborhoodIterator->GetPixel(*m_ListIterator);
208 return m_NeighborhoodIterator->
GetOffset(*m_ListIterator);
211 typename IndexListType::value_type
214 return *m_ListIterator;
221 : m_NeighborhoodIterator(const_cast<
Self *>(s))
232 m_NeighborhoodIterator->
SetPixel(*m_ListIterator, v);
270 using Superclass::GetImagePointer;
271 using Superclass::GetRadius;
272 using Superclass::GetIndex;
273 using Superclass::GetNeighborhoodIndex;
274 using Superclass::GetCenterNeighborhoodIndex;
275 using Superclass::GetRegion;
276 using Superclass::GetBeginIndex;
277 using Superclass::GoToBegin;
278 using Superclass::GoToEnd;
279 using Superclass::IsAtBegin;
280 using Superclass::IsAtEnd;
281 using Superclass::GetOffset;
282 using Superclass::operator==;
283#ifndef ITK_EXPERIMENTAL_CXX20_REWRITTEN_UNEQUAL_OPERATOR
284 using Superclass::operator!=;
286 using Superclass::operator<;
287 using Superclass::operator>;
288 using Superclass::operator>=;
289 using Superclass::operator<=;
290 using Superclass::operator[];
291 using Superclass::GetElement;
292 using Superclass::SetLocation;
293 using Superclass::GetCenterPointer;
294 using Superclass::GetCenterPixel;
295 using Superclass::OverrideBoundaryCondition;
296 using Superclass::ResetBoundaryCondition;
297 using Superclass::GetBoundaryCondition;
298 using Superclass::SetBoundaryCondition;
299 using Superclass::GetNeedToUseBoundaryCondition;
300 using Superclass::SetNeedToUseBoundaryCondition;
301 using Superclass::NeedToUseBoundaryConditionOn;
302 using Superclass::NeedToUseBoundaryConditionOff;
303 using Superclass::Print;
304 using Superclass::operator-;
305 using Superclass::GetPixel;
306 using Superclass::SetRegion;
314 Superclass::operator=(orig);
332 this->ActivateIndex(Superclass::GetNeighborhoodIndex(off));
337 this->DeactivateIndex(Superclass::GetNeighborhoodIndex(off));
343 template <
typename TOffsets>
347 for (
const auto & offset : offsets)
349 this->ActivateOffset(offset);
358 m_ActiveIndexList.clear();
359 m_CenterIsActive =
false;
364 const IndexListType &
367 return m_ActiveIndexList;
371 typename IndexListType::size_type
374 return m_ActiveIndexList.size();
380 template <
typename TNeighborPixel>
387 this->CreateActiveListFromNeighborhood<PixelType>(neighborhood);
414 using Superclass::SetPixel;
415 using Superclass::SetCenterPixel;
434 bool m_CenterIsActive{
false };
439#ifndef ITK_MANUAL_INSTANTIATION
440# include "itkConstShapedNeighborhoodIterator.hxx"
Pixel-wise addition of two images.
typename AllocatorType::const_iterator ConstIterator
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
IndexListType::size_type GetActiveIndexListSize() const
IndexListType m_ActiveIndexList
ConstIterator End() const
typename TImage::RegionType RegionType
void PrintSelf(std::ostream &, Indent) const override
typename OffsetType::OffsetValueType OffsetValueType
typename TImage::PixelType PixelType
void ActivateIndex(NeighborIndexType)
ConstShapedNeighborhoodIterator(const SizeType &radius, const ImageType *ptr, const RegionType ®ion)
void DeactivateOffset(const OffsetType &off)
void SetPixel(const unsigned int n, const PixelType &v, bool &status)
void CreateActiveListFromNeighborhood(const NeighborhoodType &neighborhood)
void ActivateOffset(const OffsetType &off)
typename SizeType::SizeValueType SizeValueType
TBoundaryCondition BoundaryConditionType
typename IndexListType::const_iterator IndexListConstIterator
Self & operator-=(const OffsetType &)
Self & operator=(const Self &orig)
typename TImage::InternalPixelType InternalPixelType
typename IndexListType::iterator IndexListIterator
typename IndexType::IndexValueType IndexValueType
ConstIterator Begin() const
void CreateActiveListFromNeighborhood(const Neighborhood< TNeighborPixel, Self::Dimension > &)
void DeactivateIndex(NeighborIndexType)
ConstShapedNeighborhoodIterator(const ConstShapedNeighborhoodIterator &)=delete
Self & operator+=(const OffsetType &)
void ActivateOffsets(const TOffsets &offsets)
typename NeighborhoodType::NeighborIndexType NeighborIndexType
~ConstShapedNeighborhoodIterator() override=default
const IndexListType & GetActiveIndexList() const
std::list< NeighborIndexType > IndexListType
A virtual base object that defines an interface to a class of boundary condition objects for use by n...
Control indentation during Print() invocation.
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
A light-weight container object for storing an N-dimensional neighborhood of values.
SizeValueType NeighborIndexType
ImageBaseType::RegionType RegionType
constexpr unsigned int Dimension
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
unsigned long SizeValueType
ConstIterator & operator=(const ConstIterator &o)
Self * m_NeighborhoodIterator
OffsetType GetNeighborhoodOffset() const
const ConstIterator & operator++()
IndexListType::const_iterator m_ListIterator
const ConstIterator & operator--()
void ProtectedSet(const PixelType &v) const
IndexListType::value_type GetNeighborhoodIndex() const
ConstIterator(const ConstIterator &o)
ConstIterator(const Self *s, const typename IndexListType::const_iterator &li)
const OffsetValueType * GetOffset() const