Medical Imaging Interaction Toolkit  2018.4.99-b7f3afaa
Medical Imaging Interaction Toolkit
mitkConvertToConcentrationTurboFlashFunctor.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
14 #define MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
15 
17 
18 namespace mitk {
19 
20  template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
22  {
23 
24  public:
25  ConvertToConcentrationTurboFlashFunctor() : m_Trec(0), m_alpha(0), m_T10(0) {};
27 
28  void initialize(double relaxationtime, double relaxivity, double recoverytime)
29  {
30  m_Trec = relaxationtime;
31  m_alpha = relaxivity;
32  m_T10 = recoverytime;
33  }
34 
36  {
37  return !(*this == other);
38  }
40  {
41  return (this->m_Trec == other.m_Trec) && (this->m_alpha == other.m_alpha) && (this->m_T10 == other.m_T10);
42  }
43 
44  inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
45  {
46  TOutputpixel concentration(0);
47 
48 
49  //Only for TurboFLASH sequencen
50  if (baseline != 0 && ((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1)) > 0 )
51  {
52  concentration = -1 / (m_Trec * m_alpha) * log((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1));
53  }
54 
55 
56  return concentration;
57  }
58 
59  private:
60  double m_Trec;
61  double m_alpha;
62  double m_T10;
63  };
64 
65 }
66 
67 #endif // MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
#define MITKPHARMACOKINETICS_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
float relaxivity(0)
bool operator==(const ConvertToConcentrationTurboFlashFunctor &other) const
TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline)
void initialize(double relaxationtime, double relaxivity, double recoverytime)
bool operator!=(const ConvertToConcentrationTurboFlashFunctor &other) const