PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusStreamBufferItem.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 __StreamBufferItem_h
8 #define __StreamBufferItem_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 
12 // IGSIO includes
13 #include <igsioCommon.h>
14 
15 // VTK includes
16 #include <vtkSmartPointer.h>
17 
18 #include <vector>
19 
20 class vtkMatrix4x4;
21 class vtkPlusDevice;
22 class vtkPlusChannel;
23 class vtkPlusDataSource;
24 class vtkPlusDataSource;
26 
27 #ifdef _WIN32
28  typedef unsigned __int64 BufferItemUidType;
29 #else
30  typedef unsigned long long BufferItemUidType;
31 #endif
32 
38 class vtkPlusDataCollectionExport StreamBufferItem
39 {
40 public:
42  virtual ~StreamBufferItem();
43 
44  StreamBufferItem(const StreamBufferItem& dataItem);
45  StreamBufferItem& operator=(StreamBufferItem const& dataItem);
46 
48  double GetTimestamp(double localTimeOffsetSec) { return this->GetFilteredTimestamp(localTimeOffsetSec); }
49 
51  double GetFilteredTimestamp(double localTimeOffsetSec) { return this->FilteredTimeStamp + localTimeOffsetSec; }
52 
54  void SetFilteredTimestamp(double filteredTimestamp) { this->FilteredTimeStamp = filteredTimestamp; }
55 
57  double GetUnfilteredTimestamp(double localTimeOffsetSec) { return this->UnfilteredTimeStamp + localTimeOffsetSec; }
58 
60  void SetUnfilteredTimestamp(double unfilteredTimestamp) { this->UnfilteredTimeStamp = unfilteredTimestamp; }
61 
67  unsigned long GetIndex() { return this->Index; };
68  void SetIndex(unsigned long index) { this->Index = index; };
69 
71  BufferItemUidType GetUid() { return this->Uid; };
72  void SetUid(BufferItemUidType uid) { this->Uid = uid; };
73 
75  void SetFrameField(std::string fieldName, std::string fieldValue, igsioFrameFieldFlags flags = FRAMEFIELD_NONE);
76 
78  std::string GetFrameField(const std::string& fieldName) const;
80  igsioFieldMapType GetFrameFieldMap() {return this->FrameFields;}
82  PlusStatus DeleteFrameField(const char* fieldName);
83  PlusStatus DeleteFrameField(const std::string& fieldName);
84 
86  PlusStatus DeepCopy(StreamBufferItem* dataItem);
87 
88  igsioVideoFrame& GetFrame() { return this->Frame; };
89 
91  PlusStatus SetMatrix(vtkMatrix4x4* matrix);
93  PlusStatus GetMatrix(vtkMatrix4x4* outputMatrix);
94 
96  void SetStatus(ToolStatus status);
98  ToolStatus GetStatus() const;
99 
100  void SetValidTransformData(bool aValid) { ValidTransformData = aValid; }
101  bool HasValidTransformData() const { return ValidTransformData; }
102  bool HasValidFieldData() const;
103  bool HasValidVideoData() const
104  {
105  return Frame.IsImageValid();
106  }
107 
108 protected:
111 
113  unsigned long Index;
114 
117 
119  igsioFieldMapType FrameFields;
120 
122  igsioVideoFrame Frame;
123  vtkSmartPointer<vtkMatrix4x4> Matrix;
124  ToolStatus Status;
125 };
126 
127 #endif
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
igsioFieldMapType FrameFields
igsioStatus PlusStatus
Definition: PlusCommon.h:40
bool HasValidVideoData() const
void SetFilteredTimestamp(double filteredTimestamp)
void SetUid(BufferItemUidType uid)
void SetValidTransformData(bool aValid)
igsioFieldMapType GetFrameFieldMap()
double GetFilteredTimestamp(double localTimeOffsetSec)
vtkSmartPointer< vtkMatrix4x4 > Matrix
void SetIndex(unsigned long index)
unsigned long GetIndex()
igsioVideoFrame Frame
double GetUnfilteredTimestamp(double localTimeOffsetSec)
BufferItemUidType Uid
igsioVideoFrame & GetFrame()
const char int const char int flags
Definition: phidget22.h:2552
BufferItemUidType GetUid()
Contains an optional timestamped circular buffer containing the video images and a number of timestam...
void SetUnfilteredTimestamp(double unfilteredTimestamp)
unsigned long long BufferItemUidType
PlusStatus DeleteFrameField(vtkIGSIOTrackedFrameList *trackedFrameList, std::string fieldName)
bool HasValidTransformData() const
double GetTimestamp(double localTimeOffsetSec)
Interface to a 3D positioning tool, video source, or generalized data stream.