Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkIGTLMeasurements.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 IGTLMeasurements_H_HEADER_INCLUDED_
14 #define IGTLMeasurements_H_HEADER_INCLUDED_
15 
16 // Microservices
17 #include <mitkServiceInterface.h>
18 #include <usServiceRegistration.h>
19 
20 #include "MitkOpenIGTLinkExports.h"
21 #include "itkObject.h"
22 #include "mitkCommon.h"
23 
24 namespace mitk {
25 
27  //* \brief Is a helper class to make measurments for latency and fps
28  //*
29  //* \ingroup OpenIGTLink
30  //*/
31  //class MITKOPENIGTLINK_EXPORT IGTLMeasurementsImplementation : public itk::Object
32  //{
33  //public:
34  // mitkClassMacroItkParent(IGTLMeasurementsImplementation, itk::Object);
35  // itkFactorylessNewMacro(Self)
36  // itkCloneMacro(Self)
37 
38  // typedef std::list<long long> MeasurementList;
39  // typedef std::map<unsigned int, MeasurementList> MeasurementPoints;
40 
41  // /**
42  // * \brief AddMeasurementPoint
43  // */
44  // void AddMeasurement(unsigned int measurementPoint);
45  // bool ExportData(std::string filename);
46 
47  // /**
48  // * \brief clears all measurements
49  // */
50  // void Reset();
51 
52  // void SetStarted(bool started);
53 
54  // void RegisterAsMicroservice();
55  // void UnRegisterMicroservice();
56  //protected:
57  // IGTLMeasurementsImplementation();
58  // ~IGTLMeasurementsImplementation();
59 
60  // /** \brief */
61  // MeasurementPoints m_MeasurementPoints;
62 
63  // bool m_IsStarted;
64 
65  // us::ServiceRegistration<Self> m_ServiceRegistration;
66  //};
67 
73  class MITKOPENIGTLINK_EXPORT IGTLMeasurements : public itk::Object
74  {
75  public:
77  static IGTLMeasurements* GetInstance();
78 
83  void AddMeasurement(unsigned int measurementPoint, unsigned int index, long long timestamp = 0);
84 
85 
89  bool ExportData(std::string filename);
90 
94  void Reset();
95 
96  void SetStarted(bool started);
97 
98  private:
99  // Only our module activator class should be able to instantiate
100  // a SingletonOneService object.
101  friend class IGTLModuleActivator;
102 
103  itkFactorylessNewMacro(Self)
104  //itkCloneMacro(Self)
105 
107  ~IGTLMeasurements() override;
108 
109  // Disable copy constructor and assignment operator.
111  IGTLMeasurements& operator=(const IGTLMeasurements&);
112 
113  //protected:
114  //IGTLMeasurementsImplementation::Pointer m_Measurements;
115 
116  typedef std::pair<long long, unsigned int> TimeStampIndexPair;
117  typedef std::list<TimeStampIndexPair> MeasurementList;
118  typedef std::map<unsigned int, MeasurementList> MeasurementPoints;
119 
120  MeasurementPoints m_MeasurementPoints;
121 
122  bool m_IsStarted;
123  };
124 } // namespace mitk
125 #endif /* MITKIGTLMeasurements_H_HEADER_INCLUDED_ */
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Is a helper class to make measurments for latency and fps.