Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 mitkConvertToConcentrationTurboFlashFunctor_h
14 #define mitkConvertToConcentrationTurboFlashFunctor_h
15 
17 
18 namespace mitk {
19 
20  template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
22  {
23 
24  private:
25  double m_Trec;
26  double m_alpha;
27  double m_T10;
28 
29  public:
30  ConvertToConcentrationTurboFlashFunctor() : m_Trec(0), m_alpha(0), m_T10(0) {};
32 
33  void initialize(double relaxationtime, double relaxivity, double recoverytime)
34  {
35  m_Trec = recoverytime;
36  m_alpha = relaxivity;
37  m_T10 = relaxationtime;
38  }
39 
41  {
42  return !(*this == other);
43  }
45  {
46  return (this->m_Trec == other.m_Trec) && (this->m_alpha == other.m_alpha) && (this->m_T10 == other.m_T10);
47  }
48 
49  inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
50  {
51  TOutputpixel concentration(0);
52 
53 
54  //Only for TurboFLASH sequencen
55  if (baseline != 0 && ((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1)) > 0 )
56  {
57  concentration = -1 / (m_Trec * m_alpha) * log((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1));
58  }
59 
60 
61  return concentration;
62  }
63 
64 
65  };
66 
67 }
68 
69 #endif
MITKPHARMACOKINETICS_EXPORT
#define MITKPHARMACOKINETICS_EXPORT
Definition: MitkPharmacokineticsExports.h:15
mitk::ConvertToConcentrationTurboFlashFunctor::ConvertToConcentrationTurboFlashFunctor
ConvertToConcentrationTurboFlashFunctor()
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:30
mitk::ConvertToConcentrationTurboFlashFunctor::~ConvertToConcentrationTurboFlashFunctor
~ConvertToConcentrationTurboFlashFunctor()
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:31
MitkPharmacokineticsExports.h
mitk::ConvertToConcentrationTurboFlashFunctor
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:21
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ConvertToConcentrationTurboFlashFunctor::operator!=
bool operator!=(const ConvertToConcentrationTurboFlashFunctor &other) const
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:40
mitk::ConvertToConcentrationTurboFlashFunctor::operator()
TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline)
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:49
mitk::ConvertToConcentrationTurboFlashFunctor::operator==
bool operator==(const ConvertToConcentrationTurboFlashFunctor &other) const
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:44
mitk::ConvertToConcentrationTurboFlashFunctor::initialize
void initialize(double relaxationtime, double relaxivity, double recoverytime)
Definition: mitkConvertToConcentrationTurboFlashFunctor.h:33