13 #ifndef mitkConvertToConcentrationTurboFlashFunctor_h
14 #define mitkConvertToConcentrationTurboFlashFunctor_h
20 template <
class TInputPixel1,
class TInputPixel2,
class TOutputpixel>
28 void initialize(
double relaxationtime,
double relaxivity,
double recoverytime)
30 m_Trec = relaxationtime;
37 return !(*
this == other);
41 return (this->m_Trec == other.m_Trec) && (this->m_alpha == other.m_alpha) && (this->m_T10 == other.m_T10);
44 inline TOutputpixel
operator()(
const TInputPixel1 & value,
const TInputPixel2 & baseline)
46 TOutputpixel concentration(0);
50 if (baseline != 0 && ((
double)value/baseline - exp(m_Trec/m_T10) * ((
double)value/baseline - 1)) > 0 )
52 concentration = -1 / (m_Trec * m_alpha) * log((
double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1));