Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkDescriptivePharmacokineticBrixModelFactory.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 #include <mitkImageTimeSelector.h>
14 #include <mitkImageCast.h>
15 
19 
21 {
22 };
23 
25 {
26 };
27 
30 {
31  return DescriptivePharmacokineticBrixModelParameterizer::New()->GetDefaultInitialParameterization();
32 };
33 
36  const mitk::modelFit::ModelFitInfo* fit) const
37 {
39 
41  {
44 
47  modelParameterizer->SetTau(tau[0]);
48 
50  imageTimeSelector->SetInput(fit->inputImage);
51  imageTimeSelector->SetTimeNr(0);
52  imageTimeSelector->UpdateLargestPossibleRegion();
53 
54  mitk::DescriptivePharmacokineticBrixModelParameterizer::BaseImageType::Pointer baseImage;
55  mitk::CastToItkImage(imageTimeSelector->GetOutput(), baseImage);
56 
57  modelParameterizer->SetBaseImage(baseImage);
58 
59  result = modelParameterizer.GetPointer();
60  }
62  {
65 
68  modelParameterizer->SetTau(tau[0]);
69 
70  if (!fit->inputData.ValueExists("ROI"))
71  {
72  mitkThrow() <<
73  "Cannot generate parameterizer for fit of type ROIbased. Input data with the lable \"ROI\" is missing in fit.";
74  }
75 
77 
78  if (signal.empty())
79  {
80  mitkThrow() <<
81  "Cannot generate parameterizer for fit of type ROIbased. Input data with the lable \"ROI\" is invalid: No values available.";
82  }
83 
84  modelParameterizer->SetBaseValue(signal[0]);
85 
86  result = modelParameterizer.GetPointer();
87  }
88 
89  return result;
90 };
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo *fit) const override
ModelBase::StaticParameterValuesType ValueType
Type of the map value.
mitk::Image::Pointer inputImage
StaticParameterMap staticParamMap
bool ValueExists(const KeyType &key) const
Returns true if the list with the given name exists.
static const std::string FIT_TYPE_VALUE_ROIBASED()
#define mitkThrow()
const ValueType & Get(const std::string &name) const
Returns the values of the given variable name.
Data class that stores all information about a modelfit that is relevant to the visualization and sto...
void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage, itk::SmartPointer< ItkOutputImageType > &itkOutputImage)
Cast an mitk::Image to an itk::Image with a specific type.
ScalarListLookupTable inputData
static const std::string FIT_TYPE_VALUE_PIXELBASED()
const ValueType & GetTableValue(const KeyType &key) const
Returns the list with the given name.
ModelBaseType::ParametersType ParametersType
static Pointer New()