17 #ifndef itkConstrainedValueMultiplicationImageFilter_h 18 #define itkConstrainedValueMultiplicationImageFilter_h 20 #include "itkBinaryFunctorImageFilter.h" 21 #include "itkNumericTraits.h" 56 template<
class TInput1,
class TInput2,
class TOutput>
68 return !(*
this != other);
73 const double dA =
static_cast<double>( A );
74 const double dB =
static_cast<double>( B );
75 const double add = dA * dB;
76 const double cadd1 = ( add < NumericTraits<TOutput>::max() ) ?
77 add : NumericTraits<TOutput>::max();
78 const double cadd2 = ( cadd1 > NumericTraits<TOutput>::NonpositiveMin() ) ?
79 cadd1 : NumericTraits<TOutput>::NonpositiveMin();
80 return static_cast<TOutput
>( cadd2 );
85 template <
class TInputImage1,
class TInputImage2,
class TOutputImage>
88 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
89 Functor::ConstrainedValueMultiplication<
90 typename TInputImage1::PixelType,
91 typename TInputImage2::PixelType,
92 typename TOutputImage::PixelType> >
97 typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
99 typename TInputImage1::PixelType,
100 typename TInputImage2::PixelType,
101 typename TOutputImage::PixelType> >
111 BinaryFunctorImageFilter);
113 #ifdef ITK_USE_CONCEPT_CHECKING 116 (Concept::Convertible<typename TInputImage1::PixelType, double>));
118 (Concept::Convertible<typename TInputImage2::PixelType, double>));
120 (Concept::Convertible<double, typename TOutputImage::PixelType>));
122 (Concept::LessThanComparable<double, typename TOutputImage::PixelType>));
132 void operator=(
const Self&);
ConstrainedValueMultiplicationImageFilter Self
bool operator==(const ConstrainedValueMultiplication &other) const
SmartPointer< Self > Pointer
Simplified inverse ITK transforms.
BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::ConstrainedValueMultiplication< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > > Superclass
virtual ~ConstrainedValueMultiplicationImageFilter()
* itkConceptMacro(OutputEqualityComparableCheck, *(Concept::EqualityComparable< OutputImagePixelType >))
ConstrainedValueMultiplication()
ConstrainedValueMultiplicationImageFilter()
~ConstrainedValueMultiplication()
TOutput operator()(const TInput1 &A, const TInput2 &B)
SmartPointer< const Self > ConstPointer
Implements pixel-wise the computation of constrained value addition.
bool operator!=(const ConstrainedValueMultiplication &) const