Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkModelFitInfoSignalGenerationFunctor.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 
18 {
19  return this->Compute(currentIndex);
20 };
21 
24  {
25  if (this->m_ModelParameterizer->GetDefaultTimeGrid().GetSize() == 0)
26  {
27  itkExceptionMacro("Error. Cannot compute SignalCurve. No time grid is set in parameterizer!");
28  }
29 
30  ModelBase::Pointer model = this->m_ModelParameterizer->GenerateParameterizedModel(currentIndex);
31 
32  auto params = this->CompileModelParameters(currentIndex, model);
33 
34  SignalType signal = model->GetSignal(params);
35 
36  OutputPixelVectorType result;
37 
38  for (SignalType::const_iterator pos = signal.begin(); pos!= signal.end(); ++pos)
39  {
40  result.push_back(*pos);
41  }
42 
43  return result;
44  };
45 
48 {
49  auto paramMap = mitk::ExtractParameterValueMapFromModelFit(m_FitInfo, currentIndex);
50  return mitk::ConvertParameterMapToParameterVector(paramMap, model);
51 };
52 
53 unsigned int
55  {
56  if (m_ModelParameterizer.IsNotNull())
57  {
58  return m_ModelParameterizer->GetDefaultTimeGrid().GetSize();
59  }
60 
61  return 0;
62  };
63 
66  {
67  if (m_ModelParameterizer.IsNotNull())
68  {
69  return m_ModelParameterizer->GetDefaultTimeGrid();
70  }
71 
72  return GridArrayType();
73  };
74 
76 {};
78 {};
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:47
ModelTraitsInterface::ParametersType ParametersType
Definition: mitkModelBase.h:59
MITKMODELFIT_EXPORT ModelTraitsInterface::ParametersType ConvertParameterMapToParameterVector(const ParameterValueMapType &valueMap, const ModelTraitsInterface *pTraitInterface)
std::vector< InputImagePixelType > OutputPixelVectorType
MITKMODELFIT_EXPORT ParameterValueMapType ExtractParameterValueMapFromModelFit(const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::Point3D &position)
IndexedValueFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType &value, const IndexType &currentIndex) const override
virtual ModelBase::ParametersType CompileModelParameters(const IndexType &currentIndex, const ModelBase *model) const
std::vector< InputImagePixelType > InputPixelVectorType