00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkConstantBoundaryCondition_h
00018 #define __itkConstantBoundaryCondition_h
00019 #include "itkNeighborhood.h"
00020 #include "itkNumericTraits.h"
00021 #include "itkImageBoundaryCondition.h"
00022
00023 namespace itk
00024 {
00025
00059 template<class TImage>
00060 class ITK_EXPORT ConstantBoundaryCondition
00061 : public ImageBoundaryCondition<TImage>
00062 {
00063 public:
00065 typedef ConstantBoundaryCondition Self;
00066 typedef ImageBoundaryCondition<TImage> Superclass;
00067
00069 typedef typename Superclass::PixelType PixelType;
00070 typedef typename Superclass::PixelPointerType PixelPointerType;
00071 typedef typename Superclass::IndexType IndexType;
00072 typedef typename Superclass::OffsetType OffsetType;
00073 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00074
00075 typedef typename Superclass::NeighborhoodAccessorFunctorType
00076 NeighborhoodAccessorFunctorType;
00077
00079 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00080
00082 ConstantBoundaryCondition()
00083 { m_Constant = NumericTraits<PixelType>::Zero; }
00084
00087 virtual PixelType operator()(const OffsetType&,
00088 const OffsetType&,
00089 const NeighborhoodType *) const
00090 { return m_Constant; }
00091
00094 virtual PixelType operator()(
00095 const OffsetType& ,
00096 const OffsetType& ,
00097 const NeighborhoodType *,
00098 const NeighborhoodAccessorFunctorType & ) const
00099 { return m_Constant; }
00100
00102 void SetConstant(const PixelType &c)
00103 { m_Constant = c; }
00104
00106 const PixelType &GetConstant() const
00107 { return m_Constant; }
00108
00112 bool RequiresCompleteNeighborhood() { return false; }
00113
00114 private:
00115 PixelType m_Constant;
00116 };
00117
00118 }
00119
00120 #endif
00121