NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkIGIDataSourceI.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef niftkIGIDataSourceI_h
16 #define niftkIGIDataSourceI_h
17 
18 #include "niftkIGIDataSourcesExports.h"
19 #include <niftkIGIDataType.h>
20 
21 #include <mitkCommon.h>
22 #include <itkVersion.h>
23 #include <itkObject.h>
24 #include <itkObjectFactoryBase.h>
25 
26 #include <QMap>
27 #include <QString>
28 #include <QVariant>
29 
30 namespace niftk
31 {
32 
33 typedef QMap<QString, QVariant> IGIDataSourceProperties;
34 
47 struct NIFTKIGIDATASOURCES_EXPORT IGIDataItemInfo
48 {
50  {
51  m_Name = "Unknown";
52  m_IsLate = false;
53  m_LagInMilliseconds = 0;
54  m_FramesPerSecond = 0;
55  }
56 
57  QString m_Name;
58  bool m_IsLate;
59  unsigned int m_LagInMilliseconds;
61 };
62 
63 
70 class NIFTKIGIDATASOURCES_EXPORT IGIDataSourceI : public itk::Object
71 {
72 
73 public:
74 
75  mitkClassMacroItkParent(IGIDataSourceI, itk::Object)
76 
77 
83  virtual QString GetName() const = 0;
84 
91  virtual QString GetFactoryName() const = 0;
92 
100  virtual QString GetStatus() const = 0;
101 
105  virtual QString GetDescription() const = 0;
106 
114  virtual void StartPlayback(niftk::IGIDataType::IGITimeType firstTimeStamp,
115  niftk::IGIDataType::IGITimeType lastTimeStamp) = 0;
116 
121  virtual void StopPlayback() = 0;
122 
129  virtual void PlaybackData(niftk::IGIDataType::IGITimeType requestedTimeStamp) = 0;
130 
134  virtual void SetRecordingLocation(const QString& pathName) = 0;
135 
139  virtual QString GetRecordingLocation() const = 0;
140 
149  virtual void SetPlaybackSourceName(const QString& sourceName) = 0;
150  virtual QString GetPlaybackSourceName() const = 0;
151 
162  virtual void StartRecording() = 0;
163 
168  virtual void StopRecording() = 0;
169 
175  virtual void SetShouldUpdate(bool shouldUpdate) = 0;
176 
180  virtual bool GetShouldUpdate() const = 0;
181 
190  virtual std::vector<IGIDataItemInfo> Update(const niftk::IGIDataType::IGITimeType& time) = 0;
191 
202  virtual bool ProbeRecordedData(niftk::IGIDataType::IGITimeType* firstTimeStampInStore,
203  niftk::IGIDataType::IGITimeType* lastTimeStampInStore) = 0;
204 
208  virtual void SetProperties(const IGIDataSourceProperties& properties) = 0;
209 
213  virtual IGIDataSourceProperties GetProperties() const = 0;
214 
215 protected:
216 
217  IGIDataSourceI();
218  virtual ~IGIDataSourceI();
219 
220 private:
221 
222  IGIDataSourceI(const IGIDataSourceI&); // deliberately not implemented
223  IGIDataSourceI& operator=(const IGIDataSourceI&); // deliberately not implemented
224 };
225 
226 } // end namespace
227 
228 #endif
Interface for an IGI Data Source (e.g. video feed, ultrasound feed, tracker feed).
Definition: niftkIGIDataSourceI.h:70
IGIDataItemInfo()
Definition: niftkIGIDataSourceI.h:49
QString m_Name
Definition: niftkIGIDataSourceI.h:57
SystemTimeServiceI::TimeType IGITimeType
Definition: niftkIGIDataType.h:39
bool m_IsLate
Definition: niftkIGIDataSourceI.h:58
QMap< QString, QVariant > IGIDataSourceProperties
Definition: niftkIGIDataSourceI.h:33
Info class to describe current state, so that GUI can display status.
Definition: niftkIGIDataSourceI.h:47
bool ProbeRecordedData(const QString &path, const QString &fileExtension, niftk::IGIDataType::IGITimeType *firstTimeStampInStore, niftk::IGIDataType::IGITimeType *lastTimeStampInStore)
Returns the minimum and maximum timestamped of all files under the specified path, with the specified fileExtension, that look like they are timestamped.
Definition: niftkIGIDataSourceUtils.cxx:194
unsigned int m_LagInMilliseconds
Definition: niftkIGIDataSourceI.h:59
Definition: niftkExceptionObject.h:21
float m_FramesPerSecond
Definition: niftkIGIDataSourceI.h:60