Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
Medical Imaging Interaction Toolkit
mitkROIBasedParameterFitImageGenerator.h
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 #ifndef __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
14 #define __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
15 
16 #include <map>
17 
18 #include <mitkImage.h>
19 
23 
24 #include "MitkModelFitExports.h"
25 
26 namespace mitk
27 {
28 
42 {
43 public:
45 
46  itkNewMacro(Self);
47 
49  using FunctorValueArrayType = std::vector<ParameterImagePixelType>;
50 
52 
54 
58 
61 
62  itkSetObjectMacro(Mask, Image);
63  itkGetConstObjectMacro(Mask, Image);
64 
65  itkGetConstReferenceMacro(Signal, SignalType);
66  itkSetMacro(Signal, SignalType);
67 
68  itkGetConstReferenceMacro(TimeGrid, TimeGridType);
69  itkSetMacro(TimeGrid, TimeGridType);
70 
71  itkSetObjectMacro(FitFunctor, FitFunctorType);
72  itkGetObjectMacro(FitFunctor, FitFunctorType);
73 
74  itkSetObjectMacro(ModelParameterizer, ParameterizerType);
75  itkGetObjectMacro(ModelParameterizer, ParameterizerType);
76 
77  double GetProgress() const override;
78 
79  ParameterNamesType GetParameterNames() const override;
80 
81  ParameterNamesType GetDerivedParameterNames() const override;
82 
83  ParameterNamesType GetCriterionNames() const override;
84 
85  ParameterNamesType GetEvaluationParameterNames() const override;
86 
87 protected:
89  {
90  m_Mask = nullptr;
91  };
92 
93  ~ROIBasedParameterFitImageGenerator() override = default;
94 
95  template <typename TPixel, unsigned int VDim>
96  void DoImageGeneration(itk::Image<TPixel, VDim>* image, double value);
97 
98  void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject);
99 
100  bool HasOutdatedResult() const override;
101  void CheckValidInputs() const override;
102  void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override;
103 
104 private:
105  Image::Pointer m_Mask;
106  SignalType m_Signal;
107  TimeGridType m_TimeGrid;
108 
109  FitFunctorType::Pointer m_FitFunctor;
110 
111  Image::Pointer m_TempResultImage;
112 
113  ParameterizerType::Pointer m_ModelParameterizer;
114 
115  double m_Progress;
116 };
117 
118 }
119 
120 #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:47
double ScalarType
ModelBaseType::ParameterNamesType ParameterNamesType
DataCollection - Class to facilitate loading/accessing structured data.
itk::Array< double > TimeGridType
Definition: mitkModelBase.h:62
#define MITKMODELFIT_EXPORT
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
Image class for storing images.
Definition: mitkImage.h:69
ModelTraitsInterface::ModelResultType ModelResultType
Definition: mitkModelBase.h:55
std::map< ParameterNameType, Image::Pointer > ParameterImageMapType
std::vector< ParameterImagePixelType > FunctorValueArrayType