PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusDataCollector.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusDataCollector_h
8 #define __vtkPlusDataCollector_h
9 
10 // Local includes
11 #include "igsioCommon.h"
12 #include "vtkPlusDataCollectionExport.h"
13 #include "vtkPlusDevice.h"
14 
15 // VTK includes
16 #include <vtkObject.h>
17 
18 //class igsioTrackedFrame;
19 class vtkPlusChannel;
21 //class vtkIGSIOTrackedFrameList;
22 class vtkXMLDataElement;
23 
32 class vtkPlusDataCollectionExport vtkPlusDataCollector : public vtkObject
33 {
34 public:
35  static vtkPlusDataCollector* New();
36  vtkTypeMacro(vtkPlusDataCollector, vtkObject);
37  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
38 
42  PlusStatus ReadConfiguration(vtkXMLDataElement* aConfig);
43  PlusStatus ReadConfiguration(const std::string& fileName);
47  PlusStatus WriteConfiguration(vtkXMLDataElement* aConfig);
48 
52  void SetDeviceFactory(vtkSmartPointer<vtkPlusDeviceFactory> factory);
56  vtkPlusDeviceFactory& GetDeviceFactory();
57 
63  PlusStatus Start();
64 
68  PlusStatus Stop();
69 
73  PlusStatus Connect();
74 
80  PlusStatus Disconnect();
81 
86  virtual PlusStatus SetLoopTimes();
87 
92  PlusStatus AddDevice(vtkPlusDevice* aDevice);
93 
99  PlusStatus GetDevice(vtkPlusDevice*& aDevice, const std::string& aDeviceId) const;
100 
106  PlusStatus GetChannel(vtkPlusChannel*& aChannel, const std::string& aChannelId) const;
107  PlusStatus GetFirstChannel(vtkPlusChannel*& aChannel) const;
108 
112  DeviceCollectionConstIterator GetDeviceConstIteratorBegin() const;
113  DeviceCollectionConstIterator GetDeviceConstIteratorEnd() const;
114 
120  PlusStatus DumpBuffersToDirectory(const char* aDirectory);
121 
127  PlusStatus GetTrackingData(vtkPlusChannel* aRequestedChannel, double& aTimestampFrom, vtkIGSIOTrackedFrameList* aTrackedFrameList);
128 
134  virtual PlusStatus GetVideoData(vtkPlusChannel* aRequestedChannel, double& aTimestamp, vtkIGSIOTrackedFrameList* aTrackedFrameList);
135 
136  /*
137  * Functions to manage the currently active stream mixers
138  */
139  PlusStatus GetDevices(DeviceCollection& OutVector) const;
140 
141  /*
142  Identify if the device is started or not
143  */
144  bool GetStarted() const;
145  bool IsStarted() const { return this->GetStarted(); }
146 
147  /*
148  Is the system connected?
149  */
150  bool GetConnected() const;
151 
153  vtkSetMacro(StartupDelaySec, double);
155  vtkGetMacro(StartupDelaySec, double);
156 
157 protected:
159  virtual ~vtkPlusDataCollector();
160 
163 
164  vtkSmartPointer<vtkPlusDeviceFactory> DeviceFactory;
165 
167 
168  bool Connected;
169  bool Started;
170 
171 private:
173  void operator=(const vtkPlusDataCollector&);
174 };
175 
176 #endif
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
std::vector< vtkPlusDevice * >::const_iterator DeviceCollectionConstIterator
Definition: vtkPlusDevice.h:48
vtkSmartPointer< vtkPlusDeviceFactory > DeviceFactory
igsioStatus PlusStatus
Definition: PlusCommon.h:40
std::vector< vtkPlusDevice * > DeviceCollection
Definition: vtkPlusDevice.h:46
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
Manages devices that record image or positional data.
Factory class of supported devices.
Contains an optional timestamped circular buffer containing the video images and a number of timestam...