18 #ifndef itkConstShapedNeighborhoodIterator_h
19 #define itkConstShapedNeighborhoodIterator_h
70 template<
typename TImage,
83 static constexpr
unsigned int Dimension = TImage::ImageDimension;
123 m_NeighborhoodIterator = s;
144 { m_ListIterator++; }
147 { m_ListIterator--; }
168 if ( m_ListIterator == m_NeighborhoodIterator->GetActiveIndexList().end() )
180 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().begin();
185 m_ListIterator = m_NeighborhoodIterator->GetActiveIndexList().end();
189 {
return m_NeighborhoodIterator->GetPixel(*m_ListIterator); }
192 {
return m_NeighborhoodIterator->GetOffset(*m_ListIterator); }
195 {
return *m_ListIterator; }
202 : m_NeighborhoodIterator(const_cast<
Self*>(s)),
211 { m_NeighborhoodIterator->SetPixel(*m_ListIterator, v); }
217 {
return ConstIterator(
this, this->m_ActiveIndexList.begin()); }
222 {
return ConstIterator(
this, this->m_ActiveIndexList.end()); }
242 using Superclass::GetImagePointer;
243 using Superclass::GetRadius;
244 using Superclass::GetIndex;
245 using Superclass::GetNeighborhoodIndex;
246 using Superclass::GetCenterNeighborhoodIndex;
247 using Superclass::GetRegion;
248 using Superclass::GetBeginIndex;
249 using Superclass::GoToBegin;
250 using Superclass::GoToEnd;
251 using Superclass::IsAtBegin;
252 using Superclass::IsAtEnd;
253 using Superclass::GetOffset;
254 using Superclass::operator==;
255 using Superclass::operator!=;
256 using Superclass::operator<;
257 using Superclass::operator>;
258 using Superclass::operator>=;
259 using Superclass::operator<=;
260 using Superclass::operator[];
261 using Superclass::GetElement;
262 using Superclass::SetLocation;
263 using Superclass::GetCenterPointer;
264 using Superclass::GetCenterPixel;
265 using Superclass::OverrideBoundaryCondition;
266 using Superclass::ResetBoundaryCondition;
267 using Superclass::GetBoundaryCondition;
268 using Superclass::GetNeedToUseBoundaryCondition;
269 using Superclass::SetNeedToUseBoundaryCondition;
270 using Superclass::NeedToUseBoundaryConditionOn;
271 using Superclass::NeedToUseBoundaryConditionOff;
272 using Superclass::Print;
273 using Superclass::operator-;
274 using Superclass::GetPixel;
275 using Superclass::SetRegion;
282 Superclass::operator=(orig);
283 m_ActiveIndexList = orig.m_ActiveIndexList;
284 m_CenterIsActive = orig.m_CenterIsActive;
292 void PrintSelf(std::ostream &,
Indent)
const override;
298 { this->ActivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
300 { this->DeactivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
305 template <
typename TOffsets>
308 for (
const auto& offset: offsets)
310 this->ActivateOffset(offset);
318 m_ActiveIndexList.clear();
319 m_CenterIsActive =
false;
325 {
return m_ActiveIndexList; }
329 {
return m_ActiveIndexList.size(); }
334 void CreateActiveListFromNeighborhood(
const NeighborhoodType &);
347 Self & operator+=(
const OffsetType &);
352 Self & operator-=(
const OffsetType &);
355 using Superclass::SetPixel;
356 using Superclass::SetCenterPixel;
372 ITK_ITERATOR_VIRTUAL
void DeactivateIndex(
NeighborIndexType ) ITK_ITERATOR_FINAL;
375 bool m_CenterIsActive{
false };
384 #ifndef ITK_MANUAL_INSTANTIATION
385 #include "itkConstShapedNeighborhoodIterator.hxx"
bool operator!=(const ConstIterator &o) const
typename NeighborhoodType::NeighborIndexType NeighborIndexType
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
typename Superclass::OffsetType OffsetType
typename OffsetType::OffsetValueType OffsetValueType
ITK_ITERATOR_VIRTUAL void ActivateOffset(const OffsetType &off) ITK_ITERATOR_FINAL
typename ImageType::InternalPixelType InternalPixelType
unsigned long SizeValueType
A light-weight container object for storing an N-dimensional neighborhood of values.
typename SizeType::SizeValueType SizeValueType
SizeValueType NeighborIndexType
IndexListType::const_iterator m_ListIterator
typename IndexListType::iterator IndexListIterator
Self & operator=(const Self &orig)
std::list< NeighborIndexType > IndexListType
ITK_ITERATOR_VIRTUAL void ClearActiveList() ITK_ITERATOR_FINAL
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ImageType::PixelType PixelType
void ProtectedSet(const PixelType &v) const
constexpr unsigned int Dimension
const IndexListType & GetActiveIndexList() const
typename Superclass::SizeType SizeType
ImageBaseType::SizeType SizeType
IndexListType::size_type GetActiveIndexListSize() const
signed long IndexValueType
Represent a n-dimensional size (bounds) of a n-dimensional image.
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image...
typename IndexListType::const_iterator IndexListConstIterator
typename Superclass::ConstIterator ConstIterator
OffsetType GetNeighborhoodOffset() const
ConstShapedNeighborhoodIterator(const SizeType &radius, const ImageType *ptr, const RegionType ®ion)
typename IndexType::IndexValueType IndexValueType
ConstIterator(const ConstIterator &o)
typename ImageType::RegionType RegionType
ConstIterator Begin() const
ConstIterator(const Self *s, const typename IndexListType::const_iterator &li)
ITK_ITERATOR_VIRTUAL void DeactivateOffset(const OffsetType &off) ITK_ITERATOR_FINAL
Control indentation during Print() invocation.
Self * m_NeighborhoodIterator
IndexListType m_ActiveIndexList
typename Superclass::RadiusType RadiusType
ConstIterator & operator=(const ConstIterator &o)
ImageBaseType::RegionType RegionType
const ConstIterator & operator++()
ConstIterator End() const
const ConstIterator & operator--()
bool operator==(const ConstIterator &o) const
signed long OffsetValueType
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
void ActivateOffsets(const TOffsets &offsets)
IndexListType::value_type GetNeighborhoodIndex() const