Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 mitkROIBasedParameterFitImageGenerator_h
14 #define mitkROIBasedParameterFitImageGenerator_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
mitkParameterFitImageGeneratorBase.h
mitk::ParameterFitImageGeneratorBase::ModelBaseType
ModelBase ModelBaseType
Definition: mitkParameterFitImageGeneratorBase.h:41
mitk::ROIBasedParameterFitImageGenerator
Definition: mitkROIBasedParameterFitImageGenerator.h:41
mitk::ModelBase::ModelResultType
ModelTraitsInterface::ModelResultType ModelResultType
Definition: mitkModelBase.h:55
mitkImage.h
mitk::ModelParameterizerBase
Definition: mitkModelParameterizerBase.h:36
MitkModelFitExports.h
mitk::ParameterFitImageGeneratorBase::ParameterImagePixelType
ScalarType ParameterImagePixelType
Definition: mitkParameterFitImageGeneratorBase.h:39
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitk::ROIBasedParameterFitImageGenerator::TimeGridType
ModelBaseType::TimeGridType TimeGridType
Definition: mitkROIBasedParameterFitImageGenerator.h:59
MITKMODELFIT_EXPORT
#define MITKMODELFIT_EXPORT
Definition: MitkModelFitExports.h:15
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ParameterFitImageGeneratorBase::ParameterNamesType
ModelBaseType::ParameterNamesType ParameterNamesType
Definition: mitkParameterFitImageGeneratorBase.h:43
mitk::ParameterFitImageGeneratorBase::ParameterNameType
ModelBaseType::ParameterNameType ParameterNameType
Definition: mitkParameterFitImageGeneratorBase.h:42
mitk::ROIBasedParameterFitImageGenerator::FunctorValueArrayType
std::vector< ParameterImagePixelType > FunctorValueArrayType
Definition: mitkROIBasedParameterFitImageGenerator.h:49
mitk::ParameterFitImageGeneratorBase
Definition: mitkParameterFitImageGeneratorBase.h:34
mitkModelFitFunctorBase.h
mitk::ModelFitFunctorBase
Definition: mitkModelFitFunctorBase.h:30
mitk::ROIBasedParameterFitImageGenerator::SignalType
ModelBaseType::ModelResultType SignalType
Definition: mitkROIBasedParameterFitImageGenerator.h:60
mitkModelParameterizerBase.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::ModelBase::TimeGridType
itk::Array< double > TimeGridType
Definition: mitkModelBase.h:62
mitk::ParameterFitImageGeneratorBase::ParameterImageMapType
std::map< ParameterNameType, Image::Pointer > ParameterImageMapType
Definition: mitkParameterFitImageGeneratorBase.h:45
mitk::ROIBasedParameterFitImageGenerator::ROIBasedParameterFitImageGenerator
ROIBasedParameterFitImageGenerator()
Definition: mitkROIBasedParameterFitImageGenerator.h:88
mitk::ModelBase
Base class for (dynamic) models. A model can be used to calculate its signal given the discrete time ...
Definition: mitkModelBase.h:47
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20