Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitkPixelBasedParameterFitImageGenerator.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 mitkPixelBasedParameterFitImageGenerator_h
14 #define mitkPixelBasedParameterFitImageGenerator_h
15 
16 #include <map>
17 
18 #include <mitkImage.h>
19 
23 
24 #include "MitkModelFitExports.h"
25 
26 namespace mitk
27 {
28 
41 {
42 public:
44 
45  itkNewMacro(Self);
46 
48  typedef std::vector<ParameterImagePixelType> FunctorValueArrayType;
49 
51 
53 
57 
58  itkSetObjectMacro(DynamicImage, Image);
59  itkGetConstObjectMacro(DynamicImage, Image);
60 
61  itkSetObjectMacro(Mask, Image);
62  itkGetConstObjectMacro(Mask, Image);
63 
64  itkSetObjectMacro(FitFunctor, FitFunctorType);
65  itkGetObjectMacro(FitFunctor, FitFunctorType);
66 
67  itkSetObjectMacro(ModelParameterizer, ParameterizerType);
68  itkGetObjectMacro(ModelParameterizer, ParameterizerType);
69 
70  itkSetMacro(TimeGridByParameterizer, bool);
71  itkGetMacro(TimeGridByParameterizer, bool);
72  itkBooleanMacro(TimeGridByParameterizer);
73 
74  double GetProgress() const override;
75 
76  ParameterNamesType GetParameterNames() const override;
77 
78  ParameterNamesType GetDerivedParameterNames() const override;
79 
80  ParameterNamesType GetCriterionNames() const override;
81 
82  ParameterNamesType GetEvaluationParameterNames() const override;
83 
84 protected:
85  PixelBasedParameterFitImageGenerator() : m_Progress(0), m_TimeGridByParameterizer(false)
86  {
87  m_InternalMask = nullptr;
88  m_Mask = nullptr;
89  m_DynamicImage = nullptr;
90  };
91 
92  ~PixelBasedParameterFitImageGenerator() override = default;
93 
94  template <typename TPixel, unsigned int VDim>
95  void DoParameterFit(itk::Image<TPixel, VDim>* image);
96 
97  template <typename TPixel, unsigned int VDim>
98  void DoPrepareMask(itk::Image<TPixel, VDim>* image);
99 
100  void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject);
101 
102  bool HasOutdatedResult() const override;
103  void CheckValidInputs() const override;
104  void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override;
105 
106 private:
107  Image::Pointer m_DynamicImage;
108  Image::Pointer m_Mask;
109 
110  typedef itk::Image<unsigned char, 3> InternalMaskType;
111  InternalMaskType::Pointer m_InternalMask;
112 
113  FitFunctorType::Pointer m_FitFunctor;
114 
115  ParameterizerType::Pointer m_ModelParameterizer;
116 
117  ParameterImageMapType m_TempResultMap;
118  ParameterImageMapType m_TempDerivedResultMap;
119  ParameterImageMapType m_TempEvaluationResultMap;
120  ParameterImageMapType m_TempCriterionResultMap;
121 
122  double m_Progress;
125  bool m_TimeGridByParameterizer;
126 };
127 
128 }
129 
130 #endif
mitkParameterFitImageGeneratorBase.h
mitk::PixelBasedParameterFitImageGenerator::ParameterNameType
ParameterFitImageGeneratorBase::ParameterNameType ParameterNameType
Definition: mitkPixelBasedParameterFitImageGenerator.h:55
mitk::PixelBasedParameterFitImageGenerator::ParameterizerType
ModelParameterizerBase ParameterizerType
Definition: mitkPixelBasedParameterFitImageGenerator.h:52
mitkImage.h
mitk::ModelParameterizerBase
Definition: mitkModelParameterizerBase.h:36
mitk::PixelBasedParameterFitImageGenerator::ParameterImageMapType
ParameterFitImageGeneratorBase::ParameterImageMapType ParameterImageMapType
Definition: mitkPixelBasedParameterFitImageGenerator.h:56
MitkModelFitExports.h
mitk::PixelBasedParameterFitImageGenerator
Definition: mitkPixelBasedParameterFitImageGenerator.h:40
mitk::PixelBasedParameterFitImageGenerator::ModelBaseType
ParameterFitImageGeneratorBase::ModelBaseType ModelBaseType
Definition: mitkPixelBasedParameterFitImageGenerator.h:54
mitk::PixelBasedParameterFitImageGenerator::FunctorValueArrayType
std::vector< ParameterImagePixelType > FunctorValueArrayType
Definition: mitkPixelBasedParameterFitImageGenerator.h:48
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
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::PixelBasedParameterFitImageGenerator::PixelBasedParameterFitImageGenerator
PixelBasedParameterFitImageGenerator()
Definition: mitkPixelBasedParameterFitImageGenerator.h:85
mitk::PixelBasedParameterFitImageGenerator::ParameterImagePixelType
ScalarType ParameterImagePixelType
Definition: mitkPixelBasedParameterFitImageGenerator.h:45
mitk::ParameterFitImageGeneratorBase
Definition: mitkParameterFitImageGeneratorBase.h:34
mitkModelFitFunctorBase.h
mitk::ModelFitFunctorBase
Definition: mitkModelFitFunctorBase.h:30
mitk::PixelBasedParameterFitImageGenerator::FitFunctorType
ModelFitFunctorBase FitFunctorType
Definition: mitkPixelBasedParameterFitImageGenerator.h:50
mitkModelParameterizerBase.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::ParameterFitImageGeneratorBase::ParameterImageMapType
std::map< ParameterNameType, Image::Pointer > ParameterImageMapType
Definition: mitkParameterFitImageGeneratorBase.h:45
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