14 #ifndef __vtkPlusDataBuffer_h 15 #define __vtkPlusDataBuffer_h 18 #include "igsioCommon.h" 19 #include "PlusConfigure.h" 20 #include "vtkPlusDataCollectionExport.h" 27 #include <vtkObject.h> 39 READ_FILTERED_AND_UNFILTERED_TIMESTAMPS = 0,
41 READ_FILTERED_IGNORE_UNFILTERED_TIMESTAMPS
54 virtual void PrintSelf(ostream& os, vtkIndent indent)
VTK_OVERRIDE;
62 virtual int GetBufferSize();
71 virtual PlusStatus AddItem(vtkImageData* frame,
72 US_IMAGE_ORIENTATION usImageOrientation,
73 US_IMAGE_TYPE imageType,
75 const std::array<int, 3>& clipRectangleOrigin,
76 const std::array<int, 3>& clipRectangleSize,
77 double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
78 double filteredTimestamp = UNDEFINED_TIMESTAMP,
79 const igsioFieldMapType* customFields = NULL);
87 virtual PlusStatus AddItem(
const igsioVideoFrame* frame,
89 const std::array<int, 3>& clipRectangleOrigin,
90 const std::array<int, 3>& clipRectangleSize,
91 double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
92 double filteredTimestamp = UNDEFINED_TIMESTAMP,
93 const igsioFieldMapType* customFields = NULL);
103 virtual PlusStatus AddItem(
void* imageDataPtr,
104 US_IMAGE_ORIENTATION usImageOrientation,
105 const FrameSizeType& inputFrameSizeInPx,
107 unsigned int numberOfScalarComponents,
108 US_IMAGE_TYPE imageType,
109 int numberOfBytesToSkip,
111 const std::array<int, 3>& clipRectangleOrigin,
112 const std::array<int, 3>& clipRectangleSize,
113 double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
114 double filteredTimestamp = UNDEFINED_TIMESTAMP,
115 const igsioFieldMapType* customFields = NULL,
116 vtkStreamingVolumeFrame* encodedFrame = NULL);
127 virtual PlusStatus AddItem(
void* imageDataPtr,
128 const FrameSizeType& frameSize,
129 unsigned int frameSizeInBytes,
130 US_IMAGE_TYPE imageType,
132 double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
133 double filteredTimestamp = UNDEFINED_TIMESTAMP,
134 const igsioFieldMapType* customFields = NULL);
142 virtual PlusStatus AddItem(
const igsioFieldMapType& fields,
144 double unfilteredTimestamp = UNDEFINED_TIMESTAMP,
145 double filteredTimestamp = UNDEFINED_TIMESTAMP);
152 PlusStatus AddTimeStampedItem(vtkMatrix4x4* matrix, ToolStatus status,
unsigned long frameNumber,
double unfilteredTimestamp,
double filteredTimestamp = UNDEFINED_TIMESTAMP,
const igsioFieldMapType* customFields = NULL);
159 return this->GetStreamBufferItem(this->GetLatestItemUidInBuffer(), bufferItem);
164 return this->GetStreamBufferItem(this->GetOldestItemUidInBuffer(), bufferItem);
171 virtual ItemStatus GetLatestTimeStamp(
double& latestTimestamp);
174 virtual ItemStatus GetOldestTimeStamp(
double& oldestTimestamp);
180 virtual bool GetLatestItemHasValidVideoData();
183 virtual bool GetLatestItemHasValidTransformData();
186 virtual bool GetLatestItemHasValidFieldData();
195 ItemStatus GetBufferIndexFromTime(
const double time,
int& bufferIndex);
200 return this->StreamBuffer->GetOldestItemUidInBuffer();
204 return this->StreamBuffer->GetLatestItemUidInBuffer();
208 return this->StreamBuffer->GetItemUidFromTime(
time, uid);
212 virtual void SetLocalTimeOffsetSec(
double offsetSec);
214 virtual double GetLocalTimeOffsetSec();
219 return this->StreamBuffer->GetNumberOfItems();
229 virtual double GetFrameRate(
bool ideal =
false,
double* framePeriodStdevSecPtr = NULL)
231 return this->StreamBuffer->GetFrameRate(ideal, framePeriodStdevSecPtr);
235 vtkSetMacro(MaxAllowedTimeDifference,
double);
237 vtkGetMacro(MaxAllowedTimeDifference,
double);
247 PlusStatus CopyTransformFromTrackedFrameList(vtkIGSIOTrackedFrameList* sourceTrackedFrameList, TIMESTAMP_FILTERING_OPTION timestampFiltering, igsioTransformName& transformName);
254 virtual void Clear();
257 virtual void SetAveragedItemsForFiltering(
int averagedItemsForFiltering);
259 virtual int GetAveragedItemsForFiltering();
262 virtual void SetStartTime(
double startTime);
264 virtual double GetStartTime();
267 virtual PlusStatus GetTimeStampReportTable(vtkTable* timeStampReportTable);
270 void SetTimeStampReporting(
bool enable);
272 bool GetTimeStampReporting();
275 PlusStatus SetFrameSize(
unsigned int x,
unsigned int y,
unsigned int z,
bool allocateFrames =
true);
277 PlusStatus SetFrameSize(
const FrameSizeType& frameSize,
bool allocateFrames =
true);
279 virtual FrameSizeType GetFrameSize()
const;
280 virtual PlusStatus GetFrameSize(
unsigned int& _arg1,
unsigned int& _arg2,
unsigned int& _arg3)
const;
288 PlusStatus SetNumberOfScalarComponents(
unsigned int numberOfScalarComponents);
290 vtkGetMacro(NumberOfScalarComponents,
unsigned int);
293 PlusStatus SetImageType(US_IMAGE_TYPE imageType);
295 vtkGetMacro(ImageType, US_IMAGE_TYPE);
298 PlusStatus SetImageOrientation(US_IMAGE_ORIENTATION imageOrientation);
300 vtkGetMacro(ImageOrientation, US_IMAGE_ORIENTATION);
303 int GetNumberOfBytesPerScalar();
309 int GetNumberOfBytesPerPixel();
312 PlusStatus CopyImagesFromTrackedFrameList(vtkIGSIOTrackedFrameList* sourceTrackedFrameList, TIMESTAMP_FILTERING_OPTION timestampFiltering,
bool copyFrameFields);
315 virtual PlusStatus WriteToSequenceFile(
const char* filename,
bool useCompression =
false);
317 vtkGetStringMacro(DescriptiveName);
318 vtkSetStringMacro(DescriptiveName);
331 virtual bool CheckFrameFormat(
const FrameSizeType& frameSizeInPx,
igsioCommon::VTKScalarPixelType pixelType, US_IMAGE_TYPE imgType,
int numberOfScalarComponents);
TIMESTAMP_FILTERING_OPTION
virtual ItemStatus GetOldestStreamBufferItem(StreamBufferItem *bufferItem)
DataItemTemporalInterpolationType
Abstract interface for tracker and video devices.
virtual ItemStatus GetItemUidFromTime(double time, BufferItemUidType &uid)
This class stores an fixed number of timestamped items. It provides element retrieval based on timest...
US_IMAGE_ORIENTATION ImageOrientation
vtkPlusTimestampedCircularBuffer StreamItemCircularBuffer
double MaxAllowedTimeDifference
virtual BufferItemUidType GetLatestItemUidInBuffer()
virtual int GetNumberOfItems()
virtual double GetFrameRate(bool ideal=false, double *framePeriodStdevSecPtr=NULL)
unsigned int NumberOfScalarComponents
const char const char * value
StreamItemCircularBuffer * StreamBuffer
igsioCommon::VTKScalarPixelType PixelType
Direction vectors of rods y
virtual BufferItemUidType GetOldestItemUidInBuffer()
unsigned long long BufferItemUidType
virtual ItemStatus GetLatestStreamBufferItem(StreamBufferItem *bufferItem)