00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkNeighborhoodInnerProduct_h
00018 #define __itkNeighborhoodInnerProduct_h
00019
00020 #include "itkNeighborhoodIterator.h"
00021 #include "itkSmartNeighborhoodIterator.h"
00022 #include "itkNeighborhood.h"
00023 #include "itkConstSliceIterator.h"
00024 #include "itkImageBoundaryCondition.h"
00025
00026 namespace itk {
00027
00042 template<class TImage, class TOperator=ITK_TYPENAME TImage::PixelType, class TComputation=TOperator>
00043 class NeighborhoodInnerProduct
00044 {
00045 public:
00047 typedef NeighborhoodInnerProduct Self;
00048
00050 typedef typename TImage::PixelType ImagePixelType;
00051 typedef TOperator OperatorPixelType;
00052 typedef TComputation OutputPixelType;
00053
00055 itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
00056
00058 typedef Neighborhood<OperatorPixelType,
00059 itkGetStaticConstMacro(ImageDimension)> OperatorType;
00060
00062 OutputPixelType operator()(const ConstNeighborhoodIterator<TImage> &it,
00063 const OperatorType &op) const;
00064 OutputPixelType operator()(const std::slice &s,
00065 const ConstNeighborhoodIterator<TImage> &it,
00066 const OperatorType &op) const;
00067 };
00068
00069 template<class TImage, class TOperator=ITK_TYPENAME TImage::PixelType, class TComputation=TOperator>
00070 class SmartNeighborhoodInnerProduct
00071 {
00072 public:
00074 typedef SmartNeighborhoodInnerProduct Self;
00075
00077 typedef typename TImage::PixelType ImagePixelType;
00078 typedef TOperator OperatorPixelType;
00079 typedef TComputation OutputPixelType;
00080
00082 itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
00083
00085 typedef Neighborhood<OperatorPixelType,
00086 itkGetStaticConstMacro(ImageDimension)> OperatorType;
00087
00089 OutputPixelType operator()(const std::slice &s,
00090 const ConstSmartNeighborhoodIterator<TImage> &it,
00091 const OperatorType &op) const;
00092 OutputPixelType operator()(const ConstSmartNeighborhoodIterator<TImage> &it,
00093 const OperatorType &op) const
00094 {
00095 return this->operator()(std::slice(0, it.Size(), 1), it, op);
00096 }
00097 };
00098
00099
00100
00101 }
00102
00103 #ifndef ITK_MANUAL_INSTANTIATION
00104 #include "itkNeighborhoodInnerProduct.txx"
00105 #endif
00106
00107 #endif