#include "itkNumericTraits.h" namespace itk { namespace Functor { // MIPt (T1 weighted measurement) template class CalcMax { public: typedef typename NumericTraits::ValueType ValueType; CalcMax() {} ~CalcMax() {} inline TOutput operator()(const Array &A,const Array &T) { ValueType result=A[0]; for (unsigned int i=1; iresult) result=temp; } return static_cast(result); } }; // MIPt (T2* weighted measurement) template class CalcMin { public: typedef typename NumericTraits::ValueType ValueType; CalcMin() {} ~CalcMin() {} inline TOutput operator()(const Array &A,const Array &T) { ValueType result=A[0]; for (unsigned int i=1; i(result); } }; // WI (T1 weighted measurement) template class CalcMaxDev { public: typedef typename NumericTraits::FloatType FloatType; CalcMaxDev() {} ~CalcMaxDev() {} inline TOutput operator()(const Array &A,const Array &T) { FloatType result=0.0f; for (unsigned int i=1; i(A[i])-static_cast(A[i-1]); double delta=T[i]-T[i-1]; if (delta<=0.0f) delta=1.0; FloatType dev=diff/delta; if (dev>result) result=dev; } return static_cast(result); } }; // WI (T2* weighted measurement) template class CalcMinDev { public: typedef typename NumericTraits::FloatType FloatType; CalcMinDev() {} ~CalcMinDev() {} inline TOutput operator()(const Array &A,const Array &T) { FloatType result=0.0f; for (unsigned int i=1; i(A[i])-static_cast(A[i-1]); double delta=T[i]-T[i-1]; if (delta<=0.0f) delta=1.0; FloatType dev=diff/delta; if (dev(-result); } }; } }