Medical Imaging Interaction Toolkit  2018.4.99-87d68d9f
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
14 #define MITKCONVERTT2CONCENTRATIONFUNCTOR
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  TOutputpixel concentration(0);
47  if(value !=0 && baseline != 0)
48  {
49  concentration = this->m_k / this->m_TE * log((double)(value- baseline)) ;
50  }
51  return concentration;
52  }
53 
54  private:
55  double m_k;
56  double m_TE;
57 
58  };
59 
60 }
61 #endif // MITKCONVERTT2CONCENTRATIONFUNCTOR
62 
bool operator!=(const ConvertT2ConcentrationFunctor &other) const
bool operator==(const ConvertT2ConcentrationFunctor &other) const
#define MITKPHARMACOKINETICS_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
TOutputpixel operator()(const TInputPixel1 &value, const TInputPixel2 &baseline)