Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkModelFitPlotDataHelper.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 mitkModelFitPlotDataHelper_h
14 #define mitkModelFitPlotDataHelper_h
15 
16 #include <vector>
17 
18 #include "mitkPoint.h"
19 #include "mitkPointSet.h"
20 #include "mitkModelBase.h"
21 #include "mitkWeakPointer.h"
22 #include "mitkCommon.h"
23 
24 #include "mitkModelFitInfo.h"
25 
26 #include "itkMapContainer.h"
27 
28 #include "MitkModelFitExports.h"
29 
30 namespace mitk
31 {
32 
33  class ModelParameterizerBase;
34  class Image;
35 
36  using PlotDataValues = std::vector<std::pair<double, double>>;
37 
39  class MITKMODELFIT_EXPORT PlotDataCurve : public ::itk::Object
40  {
41  public:
43  itkFactorylessNewMacro(Self);
44 
46 
47  virtual void SetValues(const ValuesType& _arg);
48  virtual void SetValues(ValuesType&& _arg);
49 
50  itkGetConstReferenceMacro(Values, ValuesType);
51  itkGetMacro(Values, ValuesType);
52 
53  PlotDataCurve& operator=(const PlotDataCurve& rhs);
54  PlotDataCurve& operator=(PlotDataCurve&& rhs) noexcept;
55 
56  void Reset();
57 
58  protected:
59  PlotDataCurve();
60  ~PlotDataCurve() override = default;
61 
62  private:
64  ValuesType m_Values;
65 
66  PlotDataCurve(const PlotDataCurve& other) = delete;
67  };
68 
70  using PlotDataCurveCollection = itk::MapContainer<std::string, PlotDataCurve::Pointer>;
71 
74  {
76  PlotDataCurveCollection::Pointer currentPositionPlots;
77 
78  using PositionalCurveCollection = std::pair<mitk::Point3D, PlotDataCurveCollection::Pointer>;
79  using PositionalCollectionMap = std::map<mitk::PointSet::PointIdentifier, PositionalCurveCollection>;
80 
83 
85  PlotDataCurveCollection::Pointer staticPlots;
86 
88  mitk::modelFit::ModelFitInfo::Pointer fitInfo;
89 
92  static const PlotDataCurve* GetSamplePlot(const PlotDataCurveCollection* coll);
93  static const PlotDataCurve* GetSignalPlot(const PlotDataCurveCollection* coll);
94  static const PlotDataCurve* GetInterpolatedSignalPlot(const PlotDataCurveCollection* coll);
95 
97  static std::string GetPositionalCollectionName(const PositionalCollectionMap::value_type& mapValue);
98 
99  const PlotDataCurveCollection* GetPositionalPlot(const mitk::Point3D& point) const;
100  const PlotDataCurveCollection* GetPositionalPlot(mitk::PointSet::PointIdentifier id) const;
101 
103  PlotDataValues::value_type GetXMinMax() const;
105  PlotDataValues::value_type GetYMinMax() const;
106 
108  };
109 
111  void CheckYMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max);
112 
114  void CheckXMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max);
115 
125  MITKMODELFIT_EXPORT PlotDataCurve::Pointer
126  GenerateModelSignalPlotData(const mitk::Point3D& position, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer = nullptr);
127 
136  MITKMODELFIT_EXPORT PlotDataCurveCollection::Pointer
138 
147  MITKMODELFIT_EXPORT PlotDataCurve::Pointer
148  GenerateImageSamplePlotData(const mitk::Point3D& position, const mitk::Image* image, const mitk::ModelBase::TimeGridType& timeGrid);
149 
154 
159 
164 
165 }
166 
167 #endif
mitk::PointSet::PointIdentifier
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:129
mitk::GenerateModelSignalPlotData
MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateModelSignalPlotData(const mitk::Point3D &position, const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::ModelBase::TimeGridType &timeGrid, mitk::ModelParameterizerBase *parameterizer=nullptr)
mitk::PlotDataCurveCollection
itk::MapContainer< std::string, PlotDataCurve::Pointer > PlotDataCurveCollection
Definition: mitkModelFitPlotDataHelper.h:70
mitk::ModelParameterizerBase
Definition: mitkModelParameterizerBase.h:36
MitkModelFitExports.h
mitk::MODEL_FIT_PLOT_SAMPLE_NAME
const MITKMODELFIT_EXPORT std::string MODEL_FIT_PLOT_SAMPLE_NAME()
mitk::modelFit::ModelFitInfo
Data class that stores all information about a modelfit that is relevant to the visualization and sto...
Definition: mitkModelFitInfo.h:36
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitkPoint.h
mitk::MODEL_FIT_PLOT_SIGNAL_NAME
const MITKMODELFIT_EXPORT std::string MODEL_FIT_PLOT_SIGNAL_NAME()
mitk::GenerateAdditionalModelFitPlotData
MITKMODELFIT_EXPORT PlotDataCurveCollection::Pointer GenerateAdditionalModelFitPlotData(const mitk::Point3D &position, const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::ModelBase::TimeGridType &timeGrid)
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::ModelFitPlotData::PositionalCurveCollection
std::pair< mitk::Point3D, PlotDataCurveCollection::Pointer > PositionalCurveCollection
Definition: mitkModelFitPlotDataHelper.h:78
MITKMODELFIT_EXPORT
#define MITKMODELFIT_EXPORT
Definition: MitkModelFitExports.h:15
mitkPointSet.h
mitkModelBase.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::PlotDataValues
std::vector< std::pair< double, double > > PlotDataValues
Definition: mitkModelFitPlotDataHelper.h:36
mitk::GenerateImageSamplePlotData
MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateImageSamplePlotData(const mitk::Point3D &position, const mitk::Image *image, const mitk::ModelBase::TimeGridType &timeGrid)
mitk::Point< ScalarType, 3 >
mitk::PlotDataCurve::ValuesType
PlotDataValues ValuesType
Definition: mitkModelFitPlotDataHelper.h:45
mitkModelFitInfo.h
mitk::ModelFitPlotData::positionalPlots
PositionalCollectionMap positionalPlots
Definition: mitkModelFitPlotDataHelper.h:82
mitkCommon.h
mitk::PlotDataCurve
Definition: mitkModelFitPlotDataHelper.h:39
mitk::CheckYMinMaxFromPlotDataValues
void CheckYMinMaxFromPlotDataValues(const PlotDataValues &data, double &min, double &max)
mitk::CheckXMinMaxFromPlotDataValues
void CheckXMinMaxFromPlotDataValues(const PlotDataValues &data, double &min, double &max)
mitk::MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME
const MITKMODELFIT_EXPORT std::string MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME()
mitk::ModelFitPlotData::fitInfo
mitk::modelFit::ModelFitInfo::Pointer fitInfo
Definition: mitkModelFitPlotDataHelper.h:88
mitk::ModelFitPlotData::PositionalCollectionMap
std::map< mitk::PointSet::PointIdentifier, PositionalCurveCollection > PositionalCollectionMap
Definition: mitkModelFitPlotDataHelper.h:79
mitkWeakPointer.h
mitk::ModelFitPlotData::currentPositionPlots
PlotDataCurveCollection::Pointer currentPositionPlots
Definition: mitkModelFitPlotDataHelper.h:76
mitk::ModelFitPlotData::staticPlots
PlotDataCurveCollection::Pointer staticPlots
Definition: mitkModelFitPlotDataHelper.h:85
itk::Image
class ITK_EXPORT Image
Definition: mitkGeometryClipImageFilter.h:25
mitk::ModelBase::TimeGridType
itk::Array< double > TimeGridType
Definition: mitkModelBase.h:62
mitk::ModelFitPlotData
Definition: mitkModelFitPlotDataHelper.h:73