Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkConvertT2ConcentrationFunctor.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 mitkConvertT2ConcentrationFunctor_h
14 #define mitkConvertT2ConcentrationFunctor_h
15 
17 
18 namespace mitk {
19 
20  template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
22  {
23 
24  public:
25  ConvertT2ConcentrationFunctor(): m_k(0.0), m_TE(0.0) {} ;
27 
28  void initialize(double factor, double TE)
29  {
30 
31  this->m_k = factor;
32  this->m_TE = TE;
33  }
34 
35  bool operator!=( const ConvertT2ConcentrationFunctor & other)const
36  {
37  return !(*this == other);
38  }
39  bool operator==( const ConvertT2ConcentrationFunctor & other) const
40  {
41  return (this->m_k == other.m_k && this->m_TE == other.m_TE);
42  }
43 
44  inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
45  {
46  double concentration = 0.0;
47  if(value !=0 && baseline != 0)
48  {
49  concentration = (-1.) * (this->m_k / this->m_TE) * log(static_cast<double>(value) / baseline);
50 
51  }
52  return static_cast<TOutputpixel>(concentration);
53  }
54 
55  private:
56  double m_k;
57  double m_TE;
58 
59  };
60 
61 }
62 #endif
mitk::ConvertT2ConcentrationFunctor::operator!=
bool operator!=(const ConvertT2ConcentrationFunctor &other) const
Definition: mitkConvertT2ConcentrationFunctor.h:35
MITKPHARMACOKINETICS_EXPORT
#define MITKPHARMACOKINETICS_EXPORT
Definition: MitkPharmacokineticsExports.h:15
mitk::ConvertT2ConcentrationFunctor::operator==
bool operator==(const ConvertT2ConcentrationFunctor &other) const
Definition: mitkConvertT2ConcentrationFunctor.h:39
mitk::ConvertT2ConcentrationFunctor::operator()
TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline)
Definition: mitkConvertT2ConcentrationFunctor.h:44
mitk::ConvertT2ConcentrationFunctor::~ConvertT2ConcentrationFunctor
~ConvertT2ConcentrationFunctor()
Definition: mitkConvertT2ConcentrationFunctor.h:26
MitkPharmacokineticsExports.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ConvertT2ConcentrationFunctor::initialize
void initialize(double factor, double TE)
Definition: mitkConvertT2ConcentrationFunctor.h:28
mitk::ConvertT2ConcentrationFunctor
Definition: mitkConvertT2ConcentrationFunctor.h:21
mitk::ConvertT2ConcentrationFunctor::ConvertT2ConcentrationFunctor
ConvertT2ConcentrationFunctor()
Definition: mitkConvertT2ConcentrationFunctor.h:25