Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
Medical Imaging Interaction Toolkit
mitkMeanResidenceTimeDescriptionParameter.cpp
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 
14 
15 const std::string mitk::MeanResidenceTimeDescriptionParameter::PARAMETER_NAME = "MeanResidenceTime";
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
28  return result;
29 }
30 
32 {
37 
38  auto steps = grid.GetSize();
39 
40  for (CurveGridType::size_type i = 0; i < steps - 1; ++i)
41  {
42  double deltaX = grid(i + 1) - grid(i);
43 
44  double deltaY1 = curve(i + 1)*grid(i + 1) - curve(i)*grid(i);
45  double Y1 = curve(i)*grid(i);
46  double intI1 = 1 / 2 * deltaX * deltaY1 + Y1 * deltaX;
47  aumc += std::abs(intI1);
48 
49 
50  double deltaY2 = curve(i + 1) - curve(i);
51  double Y2 = curve(i);
52  double intI2 = 1 / 2 * deltaX * deltaY2 + Y2 * deltaX;
53  auc += std::abs(intI2);
54 
55 
56  }
57  if(auc != 0)
58  {
59  mrt = aumc/auc;
60  }
61  results.push_back(mrt);
62  return results;
63 }
DescriptionParameterNamesType GetDescriptionParameterName() const override
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType &curve, const CurveGridType &grid) const override
std::vector< CurveDescriptionParameterResultType > DescriptionParameterResultsType
std::vector< CurveDescriptionParameterNameType > DescriptionParameterNamesType