13 #ifndef mitkConvertToConcentrationTurboFlashFunctor_h
14 #define mitkConvertToConcentrationTurboFlashFunctor_h
20 template <
class TInputPixel1,
class TInputPixel2,
class TOutputpixel>
33 void initialize(
double relaxationtime,
double relaxivity,
double recoverytime)
35 m_Trec = recoverytime;
37 m_T10 = relaxationtime;
42 return !(*
this == other);
46 return (this->m_Trec == other.m_Trec) && (this->m_alpha == other.m_alpha) && (this->m_T10 == other.m_T10);
49 inline TOutputpixel
operator()(
const TInputPixel1 & value,
const TInputPixel2 & baseline)
51 TOutputpixel concentration(0);
55 if (baseline != 0 && ((
double)value/baseline - exp(m_Trec/m_T10) * ((
double)value/baseline - 1)) > 0 )
57 concentration = -1 / (m_Trec * m_alpha) * log((
double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1));