00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMaskNegatedImageFilter_h
00018 #define __itkMaskNegatedImageFilter_h
00019
00020 #include "itkBinaryFunctorImageFilter.h"
00021 #include "itkNumericTraits.h"
00022
00023
00024 namespace itk
00025 {
00026
00053 namespace Functor {
00054
00055 template< class TInput, class TMask, class TOutput >
00056 class MaskNegatedInput
00057 {
00058 public:
00059 typedef typename NumericTraits< TInput >::AccumulateType AccumulatorType;
00060
00061 MaskNegatedInput() {};
00062 ~MaskNegatedInput() {};
00063 inline TOutput operator()( const TInput & A, const TMask & B)
00064 {
00065 if (B != NumericTraits< TMask >::Zero )
00066 {
00067 return NumericTraits< TOutput >::Zero;
00068 }
00069 else
00070 {
00071 return static_cast<TOutput>( A );
00072 }
00073 }
00074 };
00075
00076 }
00077 template <class TInputImage, class TMaskImage, class TOutputImage>
00078 class ITK_EXPORT MaskNegatedImageFilter :
00079 public
00080 BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage,
00081 Functor::MaskNegatedInput<
00082 typename TInputImage::PixelType,
00083 typename TMaskImage::PixelType,
00084 typename TOutputImage::PixelType> >
00085
00086
00087 {
00088 public:
00090 typedef MaskNegatedImageFilter Self;
00091 typedef BinaryFunctorImageFilter<TInputImage,TMaskImage,TOutputImage,
00092 Functor::MaskNegatedInput<
00093 typename TInputImage::PixelType,
00094 typename TMaskImage::PixelType,
00095 typename TOutputImage::PixelType>
00096 > Superclass;
00097 typedef SmartPointer<Self> Pointer;
00098 typedef SmartPointer<const Self> ConstPointer;
00099
00101 itkNewMacro(Self);
00102
00103 protected:
00104 MaskNegatedImageFilter() {}
00105 virtual ~MaskNegatedImageFilter() {}
00106
00107 private:
00108 MaskNegatedImageFilter(const Self&);
00109 void operator=(const Self&);
00110
00111 };
00112
00113 }
00114
00115
00116 #endif