Medical Imaging Interaction Toolkit  2021.10.99-9c07a326
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 __MITK_MODEL_FIT_PLOT_DATA_HELPER_H_
14 #define __MITK_MODEL_FIT_PLOT_DATA_HELPER_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
MITKMODELFIT_EXPORT PlotDataCurveCollection::Pointer GenerateAdditionalModelFitPlotData(const mitk::Point3D &position, const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::ModelBase::TimeGridType &timeGrid)
DataCollection - Class to facilitate loading/accessing structured data.
itk::Array< double > TimeGridType
Definition: mitkModelBase.h:62
#define MITKMODELFIT_EXPORT
DataType::PointIdentifier PointIdentifier
Definition: mitkPointSet.h:129
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME()
class ITK_EXPORT Image
MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateModelSignalPlotData(const mitk::Point3D &position, const mitk::modelFit::ModelFitInfo *fitInfo, const mitk::ModelBase::TimeGridType &timeGrid, mitk::ModelParameterizerBase *parameterizer=nullptr)
std::vector< std::pair< double, double > > PlotDataValues
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
Image class for storing images.
Definition: mitkImage.h:69
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SIGNAL_NAME()
std::pair< mitk::Point3D, PlotDataCurveCollection::Pointer > PositionalCurveCollection
void CheckXMinMaxFromPlotDataValues(const PlotDataValues &data, double &min, double &max)
Data class that stores all information about a modelfit that is relevant to the visualization and sto...
void CheckYMinMaxFromPlotDataValues(const PlotDataValues &data, double &min, double &max)
mitk::modelFit::ModelFitInfo::Pointer fitInfo
std::map< mitk::PointSet::PointIdentifier, PositionalCurveCollection > PositionalCollectionMap
itk::MapContainer< std::string, PlotDataCurve::Pointer > PlotDataCurveCollection
MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateImageSamplePlotData(const mitk::Point3D &position, const mitk::Image *image, const mitk::ModelBase::TimeGridType &timeGrid)
PositionalCollectionMap positionalPlots
PlotDataCurveCollection::Pointer currentPositionPlots
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SAMPLE_NAME()
PlotDataCurveCollection::Pointer staticPlots