Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef IGTLMeasurements_H_HEADER_INCLUDED_
18 #define IGTLMeasurements_H_HEADER_INCLUDED_
19 
20 // Microservices
21 #include <mitkServiceInterface.h>
22 #include <usServiceRegistration.h>
23 
24 #include "MitkOpenIGTLinkExports.h"
25 #include "itkObject.h"
26 #include "mitkCommon.h"
27 
28 namespace mitk {
29 
31  //* \brief Is a helper class to make measurments for latency and fps
32  //*
33  //* \ingroup OpenIGTLink
34  //*/
35  //class MITKOPENIGTLINK_EXPORT IGTLMeasurementsImplementation : public itk::Object
36  //{
37  //public:
38  // mitkClassMacroItkParent(IGTLMeasurementsImplementation, itk::Object);
39  // itkFactorylessNewMacro(Self)
40  // itkCloneMacro(Self)
41 
42  // typedef std::list<long long> MeasurementList;
43  // typedef std::map<unsigned int, MeasurementList> MeasurementPoints;
44 
45  // /**
46  // * \brief AddMeasurementPoint
47  // */
48  // void AddMeasurement(unsigned int measurementPoint);
49  // bool ExportData(std::string filename);
50 
51  // /**
52  // * \brief clears all measurements
53  // */
54  // void Reset();
55 
56  // void SetStarted(bool started);
57 
58  // void RegisterAsMicroservice();
59  // void UnRegisterMicroservice();
60  //protected:
61  // IGTLMeasurementsImplementation();
62  // ~IGTLMeasurementsImplementation();
63 
64  // /** \brief */
65  // MeasurementPoints m_MeasurementPoints;
66 
67  // bool m_IsStarted;
68 
69  // us::ServiceRegistration<Self> m_ServiceRegistration;
70  //};
71 
77  class MITKOPENIGTLINK_EXPORT IGTLMeasurements : public itk::Object
78  {
79  public:
81  static IGTLMeasurements* GetInstance();
82 
87  void AddMeasurement(unsigned int measurementPoint, unsigned int index, long long timestamp = 0);
88 
89 
93  bool ExportData(std::string filename);
94 
98  void Reset();
99 
100  void SetStarted(bool started);
101 
102  private:
103  // Only our module activator class should be able to instantiate
104  // a SingletonOneService object.
105  friend class IGTLModuleActivator;
106 
107  itkFactorylessNewMacro(Self)
108  //itkCloneMacro(Self)
109 
111  ~IGTLMeasurements();
112 
113  // Disable copy constructor and assignment operator.
114  IGTLMeasurements(const IGTLMeasurements&);
115  IGTLMeasurements& operator=(const IGTLMeasurements&);
116 
117  //protected:
118  //IGTLMeasurementsImplementation::Pointer m_Measurements;
119 
120  typedef std::pair<long long, unsigned int> TimeStampIndexPair;
121  typedef std::list<TimeStampIndexPair> MeasurementList;
122  typedef std::map<unsigned int, MeasurementList> MeasurementPoints;
123 
124  MeasurementPoints m_MeasurementPoints;
125 
126  bool m_IsStarted;
127  };
128 } // namespace mitk
129 #endif /* MITKIGTLMeasurements_H_HEADER_INCLUDED_ */
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string filename
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Is a helper class to make measurments for latency and fps.