# ConstNeighborhoodIterator GetBoundaryCondition() Change

Cory Quammen
2011-07-13
ConstNeighborhoodIterator::GetBoundaryCondition() now returns a pointer to the ImageBoundaryCondition base class instead of dynamically casting it to the template boundary condition type; the casting didn't make sense when the boundary condition had been overridden to a different type of boundary condition, as it would always return NULL in that case.
#include "itkConstNeighborhoodIterator.h" #include "itkImage.h" #include "itkZeroFluxNeumannBoundaryCondition.h" typedef itk::Image< float, 2 > ImageType; typedef itk::ZeroFluxNeummanBoundaryCondition< ImageType > BoundaryConditionType;

itk::ConstNeighborhoodIterator< ImageType, BoundaryConditionType > iter; BoundaryConditionType* boundaryCondition = iter.GetBoundaryCondition();
#include "itkConstNeighborhoodIterator.h" #include "itkImage.h" #include "itkZeroFluxNeumannBoundaryCondition.h" typedef itk::Image< float, 2 > ImageType; typedef itk::ZeroFluxNeummanBoundaryCondition< ImageType > BoundaryConditionType;

itk::ConstNeighborhoodIterator< ImageType, BoundaryConditionType > iter; BoundaryConditionType* boundaryCondition = dynamic_cast< BoundaryConditionType * >( iter.GetBoundaryCondition() );
I8de7c1989577ebf316340fab68d748edf0e5f833
Modules/Core/Common/include/itkConstNeighborhoodIterator.h Modules/Core/Common/include/itkConstNeighborhoodIterator.txx Modules/Core/Common/include/itkConstantBoundaryCondition.h Modules/Core/Common/include/itkConstantBoundaryCondition.txx Modules/Core/Common/include/itkImageBoundaryCondition.h Modules/Core/Common/include/itkPeriodicBoundaryCondition.h Modules/Core/Common/include/itkPeriodicBoundaryCondition.txx Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.h Modules/Core/Common/include/itkZeroFluxNeumannBoundaryCondition.txx Modules/Core/Common/test/CMakeLists.txt Modules/Core/Common/test/itkConstantBoundaryConditionTest.cxx Modules/Core/Common/test/itkPeriodicBoundaryConditionTest.cxx Modules/Core/Common/test/itkZeroFluxBoundaryConditionTest.cxx