13 #ifndef MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H 14 #define MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H 22 template <
class TInputPixel1,
class TInputPixel2,
class TInputPixel3,
class TOutputpixel>
35 m_flipangle = flipangle;
40 return !(*
this == other);
45 return (this->m_relaxivity == other.m_relaxivity) && (this->m_TR == other.m_TR) && (this->m_flipangle == other.m_flipangle);
49 inline TOutputpixel
operator()(
const TInputPixel1 & value,
const TInputPixel2 & baseline,
const TInputPixel3 & nativeT1)
51 TOutputpixel concentration(0);
53 if (baseline !=0 && nativeT1 != 0 && value != 0)
55 double s = (double) value/baseline;
56 R10 = (double) 1/nativeT1;
57 double tmp1 = log(1-s + s*exp(-R10*m_TR) - exp(-R10*m_TR)* cos(m_flipangle));
58 double tmp2 = (1-s*cos(m_flipangle) + s*exp(-R10*m_TR)*cos(m_flipangle) - exp(-R10*m_TR)* cos(m_flipangle));
60 R1 = (double) -1/m_TR * tmp1/tmp2 ;
62 concentration = (double) (R1 - R10)/ m_relaxivity;
79 #endif // MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline, const TInputPixel3 &nativeT1)
#define MITKPHARMACOKINETICS_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
~ConvertToConcentrationViaT1CalcFunctor()
bool operator!=(const ConvertToConcentrationViaT1CalcFunctor &other) const
US_USE_NAMESPACE std::string tmp1
void initialize(double relaxivity, double TR, double flipangle)
ConvertToConcentrationViaT1CalcFunctor()
bool operator==(const ConvertToConcentrationViaT1CalcFunctor &other) const