Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkAreaUnderFirstMomentDescriptionParameter.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::AreaUnderFirstMomentDescriptionParameter::PARAMETER_NAME = "AreaUnderFirstMoment";
16 
18 {
19 }
20 
22 {
23 }
24 
26 {
28  return result;
29 }
30 
32 {
35  auto steps = grid.GetSize();
36 
37  for (CurveGridType::size_type i = 0; i < steps - 1; ++i)
38  {
39  double deltaX = grid(i + 1) - grid(i);
40  double deltaY = curve(i + 1)*grid(i + 1) - curve(i)*grid(i);
41  double Yi = curve(i)*grid(i);
42 
43  double intI = 1 / 2 * deltaX * deltaY + Yi * deltaX;
44 
45  aumc += std::abs(intI);
46 
47  }
48  results.push_back(aumc);
49  return results;
50 }
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType &curve, const CurveGridType &grid) const override
DescriptionParameterNamesType GetDescriptionParameterName() const override
std::vector< CurveDescriptionParameterResultType > DescriptionParameterResultsType
std::vector< CurveDescriptionParameterNameType > DescriptionParameterNamesType