Medical Imaging Interaction Toolkit  2026.06.00
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 
35  template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
37  {
38 
39  public:
40  ConvertT2ConcentrationFunctor(): m_k(0.0), m_TE(0.0) {} ;
42 
46  void initialize(double factor, double TE)
47  {
48 
49  this->m_k = factor;
50  this->m_TE = TE;
51  }
52 
54  bool operator!=( const ConvertT2ConcentrationFunctor & other)const
55  {
56  return !(*this == other);
57  }
59  bool operator==( const ConvertT2ConcentrationFunctor & other) const
60  {
61  return (this->m_k == other.m_k && this->m_TE == other.m_TE);
62  }
63 
68  inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
69  {
70  double concentration = 0.0;
71  if(value !=0 && baseline != 0)
72  {
73  concentration = (-1.) * (this->m_k / this->m_TE) * log(static_cast<double>(value) / baseline);
74 
75  }
76  return static_cast<TOutputpixel>(concentration);
77  }
78 
79  private:
80  double m_k;
81  double m_TE;
82 
83  };
84 
85 }
86 #endif
#define MITKPHARMACOKINETICS_EXPORT
Binary functor that converts T2-weighted MR signal values to contrast agent concentration.
TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline)
Computes concentration from signal and baseline pixel values.
bool operator!=(const ConvertT2ConcentrationFunctor &other) const
Inequality comparison operator.
void initialize(double factor, double TE)
Initializes the functor with the required MR sequence parameters.
bool operator==(const ConvertT2ConcentrationFunctor &other) const
Equality comparison operator.
Find image slices visible on a given plane.