PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusSavedDataSource.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 __vtkPlusSavedDataSource_h
8 #define __vtkPlusSavedDataSource_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 
12 #include "vtkPlusDevice.h"
13 
14 class vtkPlusBuffer;
15 
16 class vtkPlusDataCollectionExport vtkPlusSavedDataSource;
17 
32 class vtkPlusDataCollectionExport vtkPlusSavedDataSource : public vtkPlusDevice
33 {
34 public:
36  void PrintSelf( ostream& os, vtkIndent indent );
37  static vtkPlusSavedDataSource* New();
38 
40  virtual PlusStatus ReadConfiguration( vtkXMLDataElement* config );
42  virtual PlusStatus WriteConfiguration( vtkXMLDataElement* config );
43 
45  vtkSetStringMacro( SequenceFile );
47  vtkGetStringMacro( SequenceFile );
48 
50  void SetLoopTimeRange( double loopStartTime, double loopStopTime );
51 
53  void GetLoopTimeRange( double& loopStartTime, double& loopStopTime );
54 
56  vtkGetMacro( RepeatEnabled, bool );
58  vtkSetMacro( RepeatEnabled, bool );
60  vtkBooleanMacro( RepeatEnabled, bool );
61 
63  vtkGetMacro( UseAllFrameFields, bool );
65  vtkSetMacro( UseAllFrameFields, bool );
67  vtkBooleanMacro( UseAllFrameFields, bool );
68 
70  vtkGetMacro( UseOriginalTimestamps, bool );
72  vtkSetMacro( UseOriginalTimestamps, bool );
74  vtkBooleanMacro( UseOriginalTimestamps, bool );
75 
77  vtkGetObjectMacro( LocalVideoBuffer, vtkPlusBuffer );
78 
79  virtual bool IsTracker() const;
80 
84  virtual PlusStatus NotifyConfigured();
85 
87  PlusStatus Probe();
88 
89 protected:
93  virtual ~vtkPlusSavedDataSource();
94 
96  virtual PlusStatus InternalConnect();
97 
99  virtual PlusStatus InternalConnectVideo( vtkIGSIOTrackedFrameList* savedDataBuffer );
100 
102  virtual PlusStatus InternalConnectTracker( vtkIGSIOTrackedFrameList* savedDataBuffer );
103 
105  virtual PlusStatus InternalDisconnect();
106 
109 
111  PlusStatus InternalUpdateCurrentTimestamp( BufferItemUidType frameToBeAddedUid, int frameToBeAddedLoopIndex );
112 
114  PlusStatus InternalUpdateOriginalTimestamp( BufferItemUidType frameToBeAddedUid, int frameToBeAddedLoopIndex );
115 
116  BufferItemUidType GetClosestFrameUidWithinTimeRange( double time_Local, double startTime_Local, double stopTime_Local );
117 
119  vtkPlusBuffer* GetLocalTrackerBuffer();
120 
122  vtkPlusDataSource* GetOutputDataSource();
123 
128  vtkPlusBuffer* GetLocalBuffer();
129 
130  void DeleteLocalBuffers();
131 
132 protected:
135 
138 
141 
148 
151 
154 
156  std::map<std::string, vtkPlusBuffer*> LocalTrackerBuffers;
157 
160 
163 
166 
169 
172 
175 
177  {
178  TRACKER_STREAM, /*< The device provides a tracker stream */
179  VIDEO_STREAM
180  };
181 
183 
184 private:
185  static vtkPlusSavedDataSource* Instance;
186  vtkPlusSavedDataSource( const vtkPlusSavedDataSource& ); // Not implemented.
187  void operator=( const vtkPlusSavedDataSource& ); // Not implemented.
188 };
189 
190 #endif
191 
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
virtual bool IsTracker() const
class vtkPlusDataCollectionExport vtkPlusSavedDataSource
BufferItemUidType LoopLastFrameUid
virtual PlusStatus Probe()
BufferItemUidType LoopFirstFrameUid
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
std::map< std::string, vtkPlusBuffer * > LocalTrackerBuffers
SimulatedStreamType SimulatedStream
Class for providing VTK video input interface from sequence fileAttributes:
BufferItemUidType LastAddedFrameUid
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
unsigned long long BufferItemUidType
virtual PlusStatus InternalUpdate()
static vtkPlusDevice * New()
Interface to a 3D positioning tool, video source, or generalized data stream.