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
00056 template<class TImage>
00057 class ITK_EXPORT ConstantBoundaryCondition
00058 : public ImageBoundaryCondition<TImage>
00059 {
00060 public:
00062 typedef ConstantBoundaryCondition Self;
00063 typedef ImageBoundaryCondition<TImage> Superclass;
00064
00066 typedef typename Superclass::PixelType PixelType;
00067 typedef typename Superclass::PixelPointerType PixelPointerType;
00068 typedef typename Superclass::IndexType IndexType;
00069 typedef typename Superclass::OffsetType OffsetType;
00070 typedef typename Superclass::NeighborhoodType NeighborhoodType;
00071
00073 itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
00074
00076 ConstantBoundaryCondition()
00077 { m_Constant = NumericTraits<PixelType>::Zero; }
00078
00081 virtual PixelType operator()(const OffsetType&,
00082 const OffsetType&,
00083 const NeighborhoodType *) const
00084 { return m_Constant; }
00085
00087 void SetConstant(const PixelType &c)
00088 { m_Constant = c; }
00089
00091 const PixelType &GetConstant() const
00092 { return m_Constant; }
00093
00094 private:
00095 PixelType m_Constant;
00096 };
00097
00098 }
00099
00100 #endif