diff --git a/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h b/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h index b0a8337bb9..c3ac6b66ac 100644 --- a/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h +++ b/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h @@ -1,64 +1,63 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKCONVERTT2CONCENTRATIONFUNCTOR #define MITKCONVERTT2CONCENTRATIONFUNCTOR #include "MitkPharmacokineticsExports.h" namespace mitk { template class MITKPHARMACOKINETICS_EXPORT ConvertT2ConcentrationFunctor { public: ConvertT2ConcentrationFunctor(): m_k(0.0), m_TE(0.0) {} ; ~ConvertT2ConcentrationFunctor() {}; void initialize(double factor, double TE) { this->m_k = factor; this->m_TE = TE; } bool operator!=( const ConvertT2ConcentrationFunctor & other)const { return !(*this == other); } bool operator==( const ConvertT2ConcentrationFunctor & other) const { return (this->m_k == other.m_k && this->m_TE == other.m_TE); } inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline) { - TOutputpixel concentration(0); + double concentration = 0.0; if(value !=0 && baseline != 0) { - concentration = (-1) * ((double)this->m_k / this->m_TE) * log( (double)value/baseline); - + concentration = (-1.) * (this->m_k / this->m_TE) * log(static_cast(value) / baseline); } - return concentration; + return static_cast(concentration); } private: double m_k; double m_TE; }; } #endif // MITKCONVERTT2CONCENTRATIONFUNCTOR