00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __itkSubtractImageFilter_h
00018
#define __itkSubtractImageFilter_h
00019
00020
#include "itkBinaryFunctorImageFilter.h"
00021
00022
namespace itk
00023 {
00024
00036
namespace Function {
00037
00038
template<
class TInput1,
class TInput2,
class TOutput>
00039 class Sub2
00040 {
00041
public:
00042 Sub2() {}
00043 ~Sub2() {}
00044 inline TOutput
operator()(
const TInput1 & A,
const TInput2 & B)
00045 {
return (TOutput)(A - B); }
00046 };
00047 }
00048
00049
template <
class TInputImage1,
class TInputImage2,
class TOutputImage>
00050 class ITK_EXPORT SubtractImageFilter :
00051
public
00052
BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00053 Function::Sub2<
00054 typename TInputImage1::PixelType,
00055 typename TInputImage2::PixelType,
00056 typename TOutputImage::PixelType> >
00057 {
00058
public:
00060 typedef SubtractImageFilter
Self;
00061
typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00062
Function::Sub2<
typename TInputImage1::PixelType,
00063
typename TInputImage2::PixelType,
00064 typename TOutputImage::PixelType> >
Superclass;
00065 typedef SmartPointer<Self> Pointer;
00066 typedef SmartPointer<const Self> ConstPointer;
00067
00068
00070
itkNewMacro(
Self);
00071
00072
protected:
00073 SubtractImageFilter() {}
00074 virtual ~SubtractImageFilter() {}
00075
00076
private:
00077 SubtractImageFilter(
const Self&);
00078
void operator=(
const Self&);
00079
00080
00081 };
00082
00083 }
00084
00085
00086
#endif