Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkAreaUnderTheCurveDescriptionParameter.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 
13 
15 
16 const std::string mitk::AreaUnderTheCurveDescriptionParameter::PARAMETER_NAME = "AreaUnderCurve";
17 
19 {
20 }
21 
23 {
24 }
25 
27 {
29  return result;
30 }
31 
33 {
36  auto steps = grid.GetSize();
37 
38  for (CurveGridType::size_type i = 0; i < steps - 1; ++i)
39  {
40  double deltaX = grid(i + 1) - grid(i);
41  double deltaY = curve(i + 1) - curve(i);
42  double Yi = curve(i);
43 
44  double intI = 1 / 2 * deltaX * deltaY + Yi * deltaX;
45 
46  auc += std::abs(intI);
47 
48  }
49  results.push_back(auc);
50  return results;
51 }
DescriptionParameterNamesType GetDescriptionParameterName() const override
std::vector< CurveDescriptionParameterResultType > DescriptionParameterResultsType
std::vector< CurveDescriptionParameterNameType > DescriptionParameterNamesType
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType &curve, const CurveGridType &grid) const override