PlusLib
2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
|
#include <src/PlusDataCollection/vtkPlusBuffer.h>
Public Types | |
enum | DataItemTemporalInterpolationType { EXACT_TIME, INTERPOLATED, CLOSEST_TIME } |
typedef vtkObject | Superclass |
enum | TIMESTAMP_FILTERING_OPTION { READ_FILTERED_AND_UNFILTERED_TIMESTAMPS = 0, READ_UNFILTERED_COMPUTE_FILTERED_TIMESTAMPS, READ_FILTERED_IGNORE_UNFILTERED_TIMESTAMPS } |
Public Member Functions | |
virtual PlusStatus | AddItem (vtkImageData *frame, US_IMAGE_ORIENTATION usImageOrientation, US_IMAGE_TYPE imageType, long frameNumber, const std::array< int, 3 > &clipRectangleOrigin, const std::array< int, 3 > &clipRectangleSize, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL) |
virtual PlusStatus | AddItem (const igsioVideoFrame *frame, long frameNumber, const std::array< int, 3 > &clipRectangleOrigin, const std::array< int, 3 > &clipRectangleSize, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL) |
virtual PlusStatus | AddItem (void *imageDataPtr, US_IMAGE_ORIENTATION usImageOrientation, const FrameSizeType &inputFrameSizeInPx, igsioCommon::VTKScalarPixelType pixelType, unsigned int numberOfScalarComponents, US_IMAGE_TYPE imageType, int numberOfBytesToSkip, long frameNumber, const std::array< int, 3 > &clipRectangleOrigin, const std::array< int, 3 > &clipRectangleSize, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL, vtkStreamingVolumeFrame *encodedFrame=NULL) |
virtual PlusStatus | AddItem (void *imageDataPtr, const FrameSizeType &frameSize, unsigned int frameSizeInBytes, US_IMAGE_TYPE imageType, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL) |
virtual PlusStatus | AddItem (const igsioFieldMapType &fields, long frameNumber, double unfilteredTimestamp=UNDEFINED_TIMESTAMP, double filteredTimestamp=UNDEFINED_TIMESTAMP) |
PlusStatus | AddTimeStampedItem (vtkMatrix4x4 *matrix, ToolStatus status, unsigned long frameNumber, double unfilteredTimestamp, double filteredTimestamp=UNDEFINED_TIMESTAMP, const igsioFieldMapType *customFields=NULL) |
virtual void | Clear () |
PlusStatus | CopyImagesFromTrackedFrameList (vtkIGSIOTrackedFrameList *sourceTrackedFrameList, TIMESTAMP_FILTERING_OPTION timestampFiltering, bool copyFrameFields) |
PlusStatus | CopyTransformFromTrackedFrameList (vtkIGSIOTrackedFrameList *sourceTrackedFrameList, TIMESTAMP_FILTERING_OPTION timestampFiltering, igsioTransformName &transformName) |
virtual void | DeepCopy (vtkPlusBuffer *buffer) |
virtual int | GetAveragedItemsForFiltering () |
ItemStatus | GetBufferIndexFromTime (const double time, int &bufferIndex) |
virtual int | GetBufferSize () |
virtual const char * | GetClassName () |
virtual char * | GetDescriptiveName () |
virtual double | GetFrameRate (bool ideal=false, double *framePeriodStdevSecPtr=NULL) |
virtual FrameSizeType | GetFrameSize () const |
virtual PlusStatus | GetFrameSize (unsigned int &_arg1, unsigned int &_arg2, unsigned int &_arg3) const |
virtual US_IMAGE_ORIENTATION | GetImageOrientation () |
virtual US_IMAGE_TYPE | GetImageType () |
virtual ItemStatus | GetIndex (const BufferItemUidType uid, unsigned long &index) |
virtual ItemStatus | GetItemUidFromTime (double time, BufferItemUidType &uid) |
virtual bool | GetLatestItemHasValidFieldData () |
virtual bool | GetLatestItemHasValidTransformData () |
virtual bool | GetLatestItemHasValidVideoData () |
virtual BufferItemUidType | GetLatestItemUidInBuffer () |
virtual ItemStatus | GetLatestStreamBufferItem (StreamBufferItem *bufferItem) |
virtual ItemStatus | GetLatestTimeStamp (double &latestTimestamp) |
virtual double | GetLocalTimeOffsetSec () |
virtual double | GetMaxAllowedTimeDifference () |
int | GetNumberOfBytesPerPixel () |
int | GetNumberOfBytesPerScalar () |
virtual int | GetNumberOfItems () |
virtual unsigned int | GetNumberOfScalarComponents () |
virtual BufferItemUidType | GetOldestItemUidInBuffer () |
virtual ItemStatus | GetOldestStreamBufferItem (StreamBufferItem *bufferItem) |
virtual ItemStatus | GetOldestTimeStamp (double &oldestTimestamp) |
virtual igsioCommon::VTKScalarPixelType | GetPixelType () |
virtual double | GetStartTime () |
virtual ItemStatus | GetStreamBufferItem (BufferItemUidType uid, StreamBufferItem *bufferItem) |
virtual ItemStatus | GetStreamBufferItemFromTime (double time, StreamBufferItem *bufferItem, DataItemTemporalInterpolationType interpolation) |
virtual ItemStatus | GetTimeStamp (BufferItemUidType uid, double ×tamp) |
bool | GetTimeStampReporting () |
virtual PlusStatus | GetTimeStampReportTable (vtkTable *timeStampReportTable) |
virtual int | IsA (const char *type) |
virtual PlusStatus | ModifyBufferItemFrameField (BufferItemUidType uid, const std::string &key, const std::string &value) |
virtual void | PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE |
virtual void | SetAveragedItemsForFiltering (int averagedItemsForFiltering) |
virtual PlusStatus | SetBufferSize (int n) |
virtual void | SetDescriptiveName (const char *) |
PlusStatus | SetFrameSize (unsigned int x, unsigned int y, unsigned int z, bool allocateFrames=true) |
PlusStatus | SetFrameSize (const FrameSizeType &frameSize, bool allocateFrames=true) |
PlusStatus | SetImageOrientation (US_IMAGE_ORIENTATION imageOrientation) |
PlusStatus | SetImageType (US_IMAGE_TYPE imageType) |
virtual void | SetLocalTimeOffsetSec (double offsetSec) |
virtual void | SetMaxAllowedTimeDifference (double) |
PlusStatus | SetNumberOfScalarComponents (unsigned int numberOfScalarComponents) |
PlusStatus | SetPixelType (igsioCommon::VTKScalarPixelType pixelType) |
virtual void | SetStartTime (double startTime) |
void | SetTimeStampReporting (bool enable) |
virtual PlusStatus | WriteToSequenceFile (const char *filename, bool useCompression=false) |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkPlusBuffer * | New () |
static vtkPlusBuffer * | SafeDownCast (vtkObject *o) |
Protected Types | |
typedef vtkPlusTimestampedCircularBuffer | StreamItemCircularBuffer |
Protected Member Functions | |
virtual PlusStatus | AllocateMemoryForFrames () |
virtual bool | CheckFrameFormat (const FrameSizeType &frameSizeInPx, igsioCommon::VTKScalarPixelType pixelType, US_IMAGE_TYPE imgType, int numberOfScalarComponents) |
virtual ItemStatus | GetInterpolatedStreamBufferItemFromTime (double time, StreamBufferItem *bufferItem) |
PlusStatus | GetPrevNextBufferItemFromTime (double time, StreamBufferItem &itemA, StreamBufferItem &itemB) |
virtual ItemStatus | GetStreamBufferItemFromClosestTime (double time, StreamBufferItem *bufferItem) |
virtual ItemStatus | GetStreamBufferItemFromExactTime (double time, StreamBufferItem *bufferItem) |
vtkPlusBuffer () | |
~vtkPlusBuffer () | |
Protected Attributes | |
char * | DescriptiveName |
FrameSizeType | FrameSize |
US_IMAGE_ORIENTATION | ImageOrientation |
US_IMAGE_TYPE | ImageType |
double | MaxAllowedTimeDifference |
unsigned int | NumberOfScalarComponents |
igsioCommon::VTKScalarPixelType | PixelType |
StreamItemCircularBuffer * | StreamBuffer |
Definition at line 34 of file vtkPlusBuffer.h.
|
protected |
Definition at line 365 of file vtkPlusBuffer.h.
typedef vtkObject vtkPlusBuffer::Superclass |
Definition at line 53 of file vtkPlusBuffer.h.
Tracker item temporal interpolation type
Definition at line 45 of file vtkPlusBuffer.h.
Enumerator | |
---|---|
READ_FILTERED_AND_UNFILTERED_TIMESTAMPS | |
READ_UNFILTERED_COMPUTE_FILTERED_TIMESTAMPS | |
READ_FILTERED_IGNORE_UNFILTERED_TIMESTAMPS |
Definition at line 37 of file vtkPlusBuffer.h.
|
protected |
Definition at line 79 of file vtkPlusBuffer.cxx.
|
protected |
Definition at line 99 of file vtkPlusBuffer.cxx.
|
virtual |
Add a frame plus a timestamp to the buffer with frame index. If the timestamp is less than or equal to the previous timestamp, or if the frame's format doesn't match the buffer's frame format, then the frame is not added to the buffer. If a clip rectangle is defined then only that portion of the frame is extracted.
Definition at line 227 of file vtkPlusBuffer.cxx.
|
virtual |
Add a frame plus a timestamp to the buffer with frame index. If the timestamp is less than or equal to the previous timestamp, or if the frame's format doesn't match the buffer's frame format, then the frame is not added to the buffer. If a clip rectangle is defined then only that portion of the frame is extracted.
Definition at line 267 of file vtkPlusBuffer.cxx.
|
virtual |
Add a frame plus a timestamp to the buffer with frame index. Additionally an optional field name&value can be added, which will be saved as a custom field of the added item. If the timestamp is less than or equal to the previous timestamp, or if the frame's format doesn't match the buffer's frame format, then the frame is not added to the buffer. If a clip rectangle is defined then only that portion of the image is extracted.
Definition at line 389 of file vtkPlusBuffer.cxx.
|
virtual |
Add a frame plus a timestamp to the buffer with frame index. Additionally an optional field name&value can be added, which will be saved as a custom field of the added item. If the timestamp is less than or equal to the previous timestamp, or if the frame's size doesn't match the frame size of the buffer, then the frame is not added. This overload is only used for storing compressed or variable frame size entries
Definition at line 540 of file vtkPlusBuffer.cxx.
|
virtual |
Add custom fields to the new item If the timestamp is less than or equal to the previous timestamp, or if the frame's format doesn't match the buffer's frame format, then the frame is not added to the buffer.
Definition at line 321 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::AddTimeStampedItem | ( | vtkMatrix4x4 * | matrix, |
ToolStatus | status, | ||
unsigned long | frameNumber, | ||
double | unfilteredTimestamp, | ||
double | filteredTimestamp = UNDEFINED_TIMESTAMP , |
||
const igsioFieldMapType * | customFields = NULL |
||
) |
Add a matrix plus status to the list, with an exactly known timestamp value (e.g., provided by a high-precision hardware timer). If the timestamp is less than or equal to the previous timestamp, then nothing will be done. If filteredTimestamp argument is undefined then the filtered timestamp will be computed from the input unfiltered timestamp.
Definition at line 631 of file vtkPlusBuffer.cxx.
|
protectedvirtual |
Update video buffer by setting the frame format for each frame
Definition at line 127 of file vtkPlusBuffer.cxx.
|
protectedvirtual |
Compares frame format with new frame imaging parameters.
Definition at line 192 of file vtkPlusBuffer.cxx.
|
virtual |
Clear buffer (set the buffer pointer to the first element)
Definition at line 811 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::CopyImagesFromTrackedFrameList | ( | vtkIGSIOTrackedFrameList * | sourceTrackedFrameList, |
TIMESTAMP_FILTERING_OPTION | timestampFiltering, | ||
bool | copyFrameFields | ||
) |
Copy images from a tracked frame buffer. It is useful when data is stored in a metafile and the data is needed as a vtkPlusDataBuffer.
Definition at line 910 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::CopyTransformFromTrackedFrameList | ( | vtkIGSIOTrackedFrameList * | sourceTrackedFrameList, |
TIMESTAMP_FILTERING_OPTION | timestampFiltering, | ||
igsioTransformName & | transformName | ||
) |
Copy a specified transform to a tracker buffer. It is useful when tracking-only data is stored in a metafile (with dummy image data), which is read by a sequence metafile reader, and the result is needed as a vtkPlusDataBuffer. If useFilteredTimestamps is true, then the filtered timestamps that are stored in the buffer will be copied to the tracker buffer. If useFilteredTimestamps is false, then only unfiltered timestamps will be copied to the tracker buffer and the tracker buffer will compute the filtered timestamps.
Definition at line 1504 of file vtkPlusBuffer.cxx.
|
virtual |
Make this buffer into a copy of another buffer. You should Lock both of the buffers before doing this.
Definition at line 794 of file vtkPlusBuffer.cxx.
|
virtual |
Definition at line 742 of file vtkPlusBuffer.cxx.
ItemStatus vtkPlusBuffer::GetBufferIndexFromTime | ( | const double | time, |
int & | bufferIndex | ||
) |
Given a timestamp, compute the nearest buffer index This assumes that the times monotonically increase
Definition at line 730 of file vtkPlusBuffer.cxx.
|
virtual |
Get the size of the buffer
Definition at line 159 of file vtkPlusBuffer.cxx.
|
virtual |
|
virtual |
|
inlinevirtual |
Get the frame rate from the buffer based on the number of frames in the buffer and the elapsed time. Ideal frame rate shows the mean of the frame periods in the buffer based on the frame number difference (aka the device frame rate). If framePeriodStdevSecPtr is not null, then the standard deviation of the frame period is computed as well (in seconds) and stored at the specified address.
Definition at line 229 of file vtkPlusBuffer.h.
|
virtual |
Get the frame size in pixel
Definition at line 1645 of file vtkPlusBuffer.cxx.
|
virtual |
Definition at line 1635 of file vtkPlusBuffer.cxx.
|
virtual |
Get the image orientation (MF, MN, ...)
|
virtual |
Get the image type (B-mode, RF, ...)
|
virtual |
Get the index assigned by the data acquisition system (usually a counter) from the buffer by frame UID.
Definition at line 723 of file vtkPlusBuffer.cxx.
|
protectedvirtual |
Interpolate the matrix for the given timestamp from the two nearest transforms in the buffer. The rotation is interpolated with SLERP interpolation, and the position is interpolated with linear interpolation. The flags correspond to the closest element.
Definition at line 1365 of file vtkPlusBuffer.cxx.
|
inlinevirtual |
Definition at line 206 of file vtkPlusBuffer.h.
|
virtual |
Returns true if the latest item contains valid field data
Definition at line 1663 of file vtkPlusBuffer.cxx.
|
virtual |
Returns true if the latest item contains valid transform data
Definition at line 1657 of file vtkPlusBuffer.cxx.
|
virtual |
Returns true if the latest item contains valid video data
Definition at line 1651 of file vtkPlusBuffer.cxx.
|
inlinevirtual |
Definition at line 202 of file vtkPlusBuffer.h.
|
inlinevirtual |
Get the most recent frame from the buffer
Definition at line 157 of file vtkPlusBuffer.h.
|
virtual |
Get latest timestamp in the buffer
Definition at line 705 of file vtkPlusBuffer.cxx.
|
virtual |
Get the local time offset in seconds (global = local + offset)
Definition at line 153 of file vtkPlusBuffer.cxx.
|
virtual |
Get maximum allowed time difference in seconds between the desired and the closest valid timestamp
int vtkPlusBuffer::GetNumberOfBytesPerPixel | ( | ) |
Get the number of bytes per pixel It is the number of bytes per scalar multiplied by the number of scalar components.
Definition at line 904 of file vtkPlusBuffer.cxx.
int vtkPlusBuffer::GetNumberOfBytesPerScalar | ( | ) |
Get the number of bytes per scalar component
Definition at line 898 of file vtkPlusBuffer.cxx.
|
inlinevirtual |
Get the number of items in the buffer
Definition at line 217 of file vtkPlusBuffer.h.
|
virtual |
Get the number of scalar components
|
inlinevirtual |
Get buffer item unique ID
Definition at line 198 of file vtkPlusBuffer.h.
|
inlinevirtual |
Get the oldest frame from buffer
Definition at line 162 of file vtkPlusBuffer.h.
|
virtual |
Get oldest timestamp in the buffer
Definition at line 711 of file vtkPlusBuffer.cxx.
|
virtual |
Get the pixel type
|
protected |
Returns the two buffer items that are closest previous and next buffer items relative to the specified time. itemA is the closest item
Definition at line 1160 of file vtkPlusBuffer.cxx.
|
virtual |
Get recording start time
Definition at line 754 of file vtkPlusBuffer.cxx.
|
virtual |
Get a frame with the specified frame uid from the buffer
Definition at line 766 of file vtkPlusBuffer.cxx.
|
protectedvirtual |
Get tracker buffer item from the closest timestamp
Definition at line 1327 of file vtkPlusBuffer.cxx.
|
protectedvirtual |
Get tracker buffer item from an exact timestamp
Definition at line 1306 of file vtkPlusBuffer.cxx.
|
virtual |
Get a frame that was acquired at the specified time from buffer
Definition at line 1277 of file vtkPlusBuffer.cxx.
|
virtual |
Get buffer item timestamp
Definition at line 717 of file vtkPlusBuffer.cxx.
bool vtkPlusBuffer::GetTimeStampReporting | ( | ) |
If TimeStampReporting is enabled then all filtered and unfiltered timestamp values will be saved in a table for diagnostic purposes.
Definition at line 1152 of file vtkPlusBuffer.cxx.
|
virtual |
Get the table report of the timestamped buffer
Definition at line 760 of file vtkPlusBuffer.cxx.
|
virtual |
|
static |
|
virtual |
Definition at line 1294 of file vtkPlusBuffer.cxx.
|
static |
|
virtual |
Definition at line 111 of file vtkPlusBuffer.cxx.
|
static |
|
virtual |
Set number of items used for timestamp filtering (with LSQR mimimizer)
Definition at line 736 of file vtkPlusBuffer.cxx.
|
virtual |
Set the size of the buffer, i.e. the maximum number of video frames that it will hold. The default is 30.
Definition at line 165 of file vtkPlusBuffer.cxx.
|
virtual |
PlusStatus vtkPlusBuffer::SetFrameSize | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | z, | ||
bool | allocateFrames = true |
||
) |
Set the frame size in pixel
Definition at line 817 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::SetFrameSize | ( | const FrameSizeType & | frameSize, |
bool | allocateFrames = true |
||
) |
Set the frame size in pixel
Definition at line 840 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::SetImageOrientation | ( | US_IMAGE_ORIENTATION | imageOrientation | ) |
Set the image orientation (MF, MN, ...). Does not reorder the pixels.
Definition at line 882 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::SetImageType | ( | US_IMAGE_TYPE | imageType | ) |
Set the image type. Does not convert the pixel values.
Definition at line 870 of file vtkPlusBuffer.cxx.
|
virtual |
Set the local time offset in seconds (global = local + offset)
Definition at line 147 of file vtkPlusBuffer.cxx.
|
virtual |
Set maximum allowed time difference in seconds between the desired and the closest valid timestamp
PlusStatus vtkPlusBuffer::SetNumberOfScalarComponents | ( | unsigned int | numberOfScalarComponents | ) |
Set the number of scalar components
Definition at line 858 of file vtkPlusBuffer.cxx.
PlusStatus vtkPlusBuffer::SetPixelType | ( | igsioCommon::VTKScalarPixelType | pixelType | ) |
Set the pixel type
Definition at line 846 of file vtkPlusBuffer.cxx.
|
virtual |
Set recording start time
Definition at line 748 of file vtkPlusBuffer.cxx.
void vtkPlusBuffer::SetTimeStampReporting | ( | bool | enable | ) |
If TimeStampReporting is enabled then all filtered and unfiltered timestamp values will be saved in a table for diagnostic purposes.
Definition at line 1146 of file vtkPlusBuffer.cxx.
|
virtual |
Dump the current state of the video buffer to metafile
Definition at line 1077 of file vtkPlusBuffer.cxx.
|
protected |
Definition at line 372 of file vtkPlusBuffer.h.
|
protected |
Image frame size in pixel
Definition at line 351 of file vtkPlusBuffer.h.
|
protected |
Image orientation (MF, MN, ...)
Definition at line 363 of file vtkPlusBuffer.h.
|
protected |
Image type (B-Mode, RF, ...)
Definition at line 360 of file vtkPlusBuffer.h.
|
protected |
Maximum allowed time difference in seconds between the desired and the closest valid timestamp
Definition at line 370 of file vtkPlusBuffer.h.
|
protected |
Number of scalar components
Definition at line 357 of file vtkPlusBuffer.h.
|
protected |
Image pixel type
Definition at line 354 of file vtkPlusBuffer.h.
|
protected |
Timestamped circular buffer that stores the last N frames
Definition at line 367 of file vtkPlusBuffer.h.