18 #ifndef __itkConstShapedNeighborhoodIterator_h
19 #define __itkConstShapedNeighborhoodIterator_h
70 template<
class TImage,
class TBoundaryCondition =
71 ZeroFluxNeumannBoundaryCondition< TImage > >
82 itkStaticConstMacro(Dimension,
unsigned int, TImage::ImageDimension);
92 typedef typename Superclass::SizeType
SizeType;
124 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); }
194 typename IndexListType::value_type GetNeighborhoodIndex()
const
195 {
return *m_ListIterator; }
204 { m_NeighborhoodIterator->SetPixel(*m_ListIterator, v); }
210 {
return m_ConstBeginIterator; }
215 {
return m_ConstEndIterator; }
220 InitializeConstShapedNeighborhoodIterator();
224 void InitializeConstShapedNeighborhoodIterator()
228 m_ConstEndIterator.GoToEnd();
229 m_CenterIsActive =
false;
243 InitializeConstShapedNeighborhoodIterator();
249 using Superclass::GetImagePointer;
250 using Superclass::GetRadius;
251 using Superclass::GetIndex;
252 using Superclass::GetNeighborhoodIndex;
253 using Superclass::GetCenterNeighborhoodIndex;
254 using Superclass::GetRegion;
255 using Superclass::GetBeginIndex;
256 using Superclass::GoToBegin;
257 using Superclass::GoToEnd;
258 using Superclass::IsAtBegin;
259 using Superclass::IsAtEnd;
260 using Superclass::GetOffset;
261 using Superclass::operator==;
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::GetElement;
269 using Superclass::SetLocation;
270 using Superclass::GetCenterPointer;
271 using Superclass::GetCenterPixel;
272 using Superclass::OverrideBoundaryCondition;
273 using Superclass::ResetBoundaryCondition;
274 using Superclass::GetBoundaryCondition;
275 using Superclass::GetNeedToUseBoundaryCondition;
276 using Superclass::SetNeedToUseBoundaryCondition;
277 using Superclass::NeedToUseBoundaryConditionOn;
278 using Superclass::NeedToUseBoundaryConditionOff;
279 using Superclass::Print;
280 using Superclass::operator-;
281 using Superclass::GetPixel;
282 using Superclass::SetRegion;
287 Superclass::operator=(orig);
288 m_ActiveIndexList = orig.m_ActiveIndexList;
289 m_CenterIsActive = orig.m_CenterIsActive;
294 m_ConstEndIterator.GoToBegin();
299 virtual void PrintSelf(std::ostream &,
Indent)
const;
305 { this->ActivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
307 { this->DeactivateIndex( Superclass::GetNeighborhoodIndex(off) ); }
311 virtual void ClearActiveList()
313 m_ActiveIndexList.clear();
314 m_ConstBeginIterator.GoToBegin();
315 m_ConstEndIterator.GoToEnd();
316 m_CenterIsActive =
false;
322 {
return m_ActiveIndexList; }
325 typename IndexListType::size_type GetActiveIndexListSize()
const
326 {
return m_ActiveIndexList.size(); }
331 void CreateActiveListFromNeighborhood(
const NeighborhoodType &);
344 Self & operator+=(
const OffsetType &);
349 Self & operator-=(
const OffsetType &);
352 using Superclass::SetPixel;
353 using Superclass::SetCenterPixel;
381 #ifndef ITK_MANUAL_INSTANTIATION
382 #include "itkConstShapedNeighborhoodIterator.hxx"