Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
Medical Imaging Interaction Toolkit
mitkModelDataGenerationFunctor.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 
17  if (this->m_ModelParameterizer->GetDefaultTimeGrid().GetSize() == 0) {
18  itkExceptionMacro("Error. Cannot compute SignalCurve. No time grid is set "
19  "in parameterizer!");
20  }
21 
22  ModelParametersType parameters(value.size());
23 
24  for (ModelParametersType::SizeValueType i = 0; i < parameters.Size(); ++i) {
25  parameters[i] = value[i];
26  }
27 
28  ModelBase::Pointer model =
29  this->m_ModelParameterizer->GenerateParameterizedModel();
30  SignalType signal = model->GetSignal(parameters);
31 
32  OutputPixelVectorType result;
33 
34  for (SignalType::const_iterator pos = signal.begin(); pos != signal.end();
35  ++pos) {
36  result.push_back(*pos);
37  }
38 
39  return result;
40 };
41 
43  if (m_ModelParameterizer.IsNotNull()) {
44  return m_ModelParameterizer->GetDefaultTimeGrid().GetSize();
45  }
46 
47  return 0;
48 };
49 
52  if (m_ModelParameterizer.IsNotNull()) {
53  return m_ModelParameterizer->GetDefaultTimeGrid();
54  }
55 
56  return GridArrayType();
57 };
58 
itk::Array< double > GridArrayType
unsigned int GetNumberOfOutputs() const override
itk::Array< ModelBase::ParameterValueType > ModelParametersType
std::vector< InputImagePixelType > InputPixelVectorType
SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType &value) const override
std::vector< InputImagePixelType > OutputPixelVectorType