Orfeo Toolbox  3.16
itkAbsoluteValueDifferenceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkAbsoluteValueDifferenceImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-04-01 14:36:05 $
7  Version: $Revision: 1.8 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkAbsoluteValueDifferenceImageFilter_h
18 #define __itkAbsoluteValueDifferenceImageFilter_h
19 
21 #include "itkConceptChecking.h"
22 
23 namespace itk
24 {
25 
49 namespace Functor {
50 
51 template< class TInput1, class TInput2, class TOutput>
53 {
54 public:
57  bool operator!=( const AbsoluteValueDifference2 & ) const
58  {
59  return false;
60  }
61  bool operator==( const AbsoluteValueDifference2 & other ) const
62  {
63  return !(*this != other);
64  }
65  inline TOutput operator()( const TInput1 & A,
66  const TInput2 & B) const
67  {
68  const double dA = static_cast<double>( A );
69  const double dB = static_cast<double>( B );
70  const double diff = dA - dB;
71  const double absdiff = ( diff > 0.0 ) ? diff : -diff;
72  return static_cast<TOutput>( absdiff );
73  }
74 };
75 }
76 
77 template <class TInputImage1, class TInputImage2, class TOutputImage>
79  public
80 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
81  Functor::AbsoluteValueDifference2<
82  typename TInputImage1::PixelType,
83  typename TInputImage2::PixelType,
84  typename TOutputImage::PixelType> >
85 {
86 public:
89  typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
91  typename TInputImage1::PixelType,
92  typename TInputImage2::PixelType,
93  typename TOutputImage::PixelType>
95 
98 
100  itkNewMacro(Self);
101 
105 
106 #ifdef ITK_USE_CONCEPT_CHECKING
107 
108  itkConceptMacro(Input1CovertibleToDoubleCheck,
110  itkConceptMacro(Input2ConvertibleToDoubleCheck,
112  itkConceptMacro(DoubleCovertibleToOutputCheck,
115 #endif
116 
117 protected:
120 
121 private:
122  AbsoluteValueDifferenceImageFilter(const Self&); //purposely not implemented
123  void operator=(const Self&); //purposely not implemented
124 
125 };
126 
127 } // end namespace itk
128 
129 
130 #endif

Generated at Sat Feb 2 2013 23:22:54 for Orfeo Toolbox with doxygen 1.8.1.1