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())
192 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().begin();
198 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().end();
204 return m_NeighborhoodIterator->GetPixel(*m_ListIterator);
210 return m_NeighborhoodIterator->
GetOffset(*m_ListIterator);
213 typename IndexListType::value_type
216 return *m_ListIterator;
223 : m_NeighborhoodIterator(const_cast<
Self *>(s))
234 m_NeighborhoodIterator->
SetPixel(*m_ListIterator, v);
272 using Superclass::GetImagePointer;
273 using Superclass::GetRadius;
274 using Superclass::GetIndex;
275 using Superclass::GetNeighborhoodIndex;
276 using Superclass::GetCenterNeighborhoodIndex;
277 using Superclass::GetRegion;
278 using Superclass::GetBeginIndex;
279 using Superclass::GoToBegin;
280 using Superclass::GoToEnd;
281 using Superclass::IsAtBegin;
282 using Superclass::IsAtEnd;
283 using Superclass::GetOffset;
284 using Superclass::operator==;
285#ifndef ITK_EXPERIMENTAL_CXX20_REWRITTEN_UNEQUAL_OPERATOR
286 using Superclass::operator!=;
288 using Superclass::operator<;
289 using Superclass::operator>;
290 using Superclass::operator>=;
291 using Superclass::operator<=;
292 using Superclass::operator[];
293 using Superclass::GetElement;
294 using Superclass::SetLocation;
295 using Superclass::GetCenterPointer;
296 using Superclass::GetCenterPixel;
297 using Superclass::OverrideBoundaryCondition;
298 using Superclass::ResetBoundaryCondition;
299 using Superclass::GetBoundaryCondition;
300 using Superclass::SetBoundaryCondition;
301 using Superclass::GetNeedToUseBoundaryCondition;
302 using Superclass::SetNeedToUseBoundaryCondition;
303 using Superclass::NeedToUseBoundaryConditionOn;
304 using Superclass::NeedToUseBoundaryConditionOff;
305 using Superclass::Print;
306 using Superclass::operator-;
307 using Superclass::GetPixel;
308 using Superclass::SetRegion;
316 Superclass::operator=(orig);
334 this->ActivateIndex(Superclass::GetNeighborhoodIndex(off));
339 this->DeactivateIndex(Superclass::GetNeighborhoodIndex(off));
345 template <
typename TOffsets>
349 for (
const auto & offset : offsets)
351 this->ActivateOffset(offset);
360 m_ActiveIndexList.clear();
361 m_CenterIsActive =
false;
366 const IndexListType &
369 return m_ActiveIndexList;
373 typename IndexListType::size_type
376 return m_ActiveIndexList.size();
382 template <
typename TNeighborPixel>
389 this->CreateActiveListFromNeighborhood<PixelType>(neighborhood);
416 using Superclass::SetPixel;
417 using Superclass::SetCenterPixel;
436 bool m_CenterIsActive{
false };
441#ifndef ITK_MANUAL_INSTANTIATION
442# 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 CreateActiveListFromNeighborhood(const NeighborhoodType &neighborhood)
ConstShapedNeighborhoodIterator()=default
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)
void SetPixel(const unsigned int i, const PixelType &v, bool &status)
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