NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mitk::VideoTrackerMatching Class Reference

A class to match video frames to tracking frames, when reading recorded tracking data. More...

Inheritance diagram for mitk::VideoTrackerMatching:
Inheritance graph
[legend]
Collaboration diagram for mitk::VideoTrackerMatching:
Collaboration graph
[legend]

Public Member Functions

 mitkClassMacroItkParent (VideoTrackerMatching, itk::Object) static Pointer New()
 
void Initialise (std::string directory)
 Initialise the class by passing it a directory name. More...
 
cv::Mat GetTrackerMatrix (unsigned int FrameNumber, long long *TimingError=NULL, unsigned int TrackerIndex=0, int ReferenceIndex=-1)
 Return the tracking matrix for a given video frame number. More...
 
cv::Mat GetCameraTrackingMatrix (unsigned int FrameNumber, long long *TimingError=NULL, unsigned int TrackerIndex=0, std::vector< double > *Perturbation=NULL, int ReferenceIndex=-1)
 Return the tracking matrix multiplied by the camera to tracker matrix for a given video frame number. More...
 
cv::Mat GetVideoFrame (unsigned int FrameNumber, unsigned long long *TimingStamp=NULL)
 Returns a frame of video data (WARNING, not implemented, if you use this you will only get a 4x4 junk matrix back) and the time stamp for a given frame number. More...
 
unsigned long long GetVideoFrameTimeStamp (unsigned int FrameNumber)
 Returns the time stamp for a frame of video data. More...
 
bool IsReady ()
 returns state of m_Ready More...
 
virtual void SetFlipMatrices (bool _arg)
 Set a flag as to whether to flip matrices between left/right handed, default is right. More...
 
virtual void SetWriteTimingErrors (bool _arg)
 Set a flag as to whether to write out the timing errors. More...
 
virtual void SetHaltOnFrameSkip (bool _arg)
 Set a flag to determine what to do if a skipped frame is found, by default we halt. More...
 
virtual void SetInterpolateMatrices (bool _arg)
 Set a flag to determine whether we interpolate matrices or just use nearest neighbour. More...
 
virtual std::string GetFrameMap ()
 Set a flag to determine what to do if a skipped frame is found, by default we halt. More...
 
int GetNumberOfFrames ()
 Get the frame count. More...
 
void SetVideoLagMilliseconds (unsigned long long VideoLag, bool VideoLeadsTracking=false, int trackerIndex=-1)
 If the tracking data is ahead of the video data you can set a video lag in milliseconds to account for this. If the video is ahead of the tracking set argument 2 to true. More...
 
void SetCameraToTracker (cv::Mat, int trackerIndex=-1)
 set the camera to tracker matrix. if tracker index = -1 all camera to tracker matrices will be set with the same value More...
 
void SetCameraToTrackers (std::string filename)
 
unsigned int GetTrackingMatricesSize ()
 

Protected Member Functions

 VideoTrackerMatching ()
 
virtual ~VideoTrackerMatching ()
 
 VideoTrackerMatching (const VideoTrackerMatching &)
 
VideoTrackerMatchingoperator= (const VideoTrackerMatching &)
 
std::vector
< mitk::WorldPointsWithTimingError
ReadPointsInLensCSFile (std::string filename, int PointsPerFrame=1, std::vector< mitk::ProjectedPointPairsWithTimingError > *onScreenPoints=NULL)
 Reads a file that defines the position of a point fixed in world coordinates relative to the camera lens. [framenumber][pointID] [framenumber][pointID](left,right) More...
 

Protected Attributes

std::vector< unsigned intm_FrameNumbers
 
TimeStampsContainer m_VideoTimeStamps
 
bool m_Ready
 
bool m_FlipMatrices
 
bool m_WriteTimingErrors
 
bool m_InterpolateMatrices
 
std::string m_Directory
 

Detailed Description

A class to match video frames to tracking frames, when reading recorded tracking data.

Constructor & Destructor Documentation

mitk::VideoTrackerMatching::VideoTrackerMatching ( )
protected
mitk::VideoTrackerMatching::~VideoTrackerMatching ( )
protectedvirtual
mitk::VideoTrackerMatching::VideoTrackerMatching ( const VideoTrackerMatching )
protected

Member Function Documentation

cv::Mat mitk::VideoTrackerMatching::GetCameraTrackingMatrix ( unsigned int  FrameNumber,
long long *  TimingError = NULL,
unsigned int  TrackerIndex = 0,
std::vector< double > *  Perturbation = NULL,
int  ReferenceIndex = -1 
)

Return the tracking matrix multiplied by the camera to tracker matrix for a given video frame number.

virtual std::string mitk::VideoTrackerMatching::GetFrameMap ( )
virtual

Set a flag to determine what to do if a skipped frame is found, by default we halt.

int mitk::VideoTrackerMatching::GetNumberOfFrames ( )
inline

Get the frame count.

cv::Mat mitk::VideoTrackerMatching::GetTrackerMatrix ( unsigned int  FrameNumber,
long long *  TimingError = NULL,
unsigned int  TrackerIndex = 0,
int  ReferenceIndex = -1 
)

Return the tracking matrix for a given video frame number.

unsigned int mitk::VideoTrackerMatching::GetTrackingMatricesSize ( )
cv::Mat mitk::VideoTrackerMatching::GetVideoFrame ( unsigned int  FrameNumber,
unsigned long long *  TimingStamp = NULL 
)

Returns a frame of video data (WARNING, not implemented, if you use this you will only get a 4x4 junk matrix back) and the time stamp for a given frame number.

unsigned long long mitk::VideoTrackerMatching::GetVideoFrameTimeStamp ( unsigned int  FrameNumber)

Returns the time stamp for a frame of video data.

void mitk::VideoTrackerMatching::Initialise ( std::string  directory)

Initialise the class by passing it a directory name.

bool mitk::VideoTrackerMatching::IsReady ( )
inline

returns state of m_Ready

mitk::VideoTrackerMatching::mitkClassMacroItkParent ( VideoTrackerMatching  ,
itk::Object   
)
VideoTrackerMatching& mitk::VideoTrackerMatching::operator= ( const VideoTrackerMatching )
protected
std::vector< mitk::WorldPointsWithTimingError > mitk::VideoTrackerMatching::ReadPointsInLensCSFile ( std::string  filename,
int  PointsPerFrame = 1,
std::vector< mitk::ProjectedPointPairsWithTimingError > *  onScreenPoints = NULL 
)
protected

Reads a file that defines the position of a point fixed in world coordinates relative to the camera lens. [framenumber][pointID] [framenumber][pointID](left,right)

void mitk::VideoTrackerMatching::SetCameraToTracker ( cv::Mat  matrix,
int  trackerIndex = -1 
)

set the camera to tracker matrix. if tracker index = -1 all camera to tracker matrices will be set with the same value

void mitk::VideoTrackerMatching::SetCameraToTrackers ( std::string  filename)
virtual void mitk::VideoTrackerMatching::SetFlipMatrices ( bool  _arg)
virtual

Set a flag as to whether to flip matrices between left/right handed, default is right.

virtual void mitk::VideoTrackerMatching::SetHaltOnFrameSkip ( bool  _arg)
virtual

Set a flag to determine what to do if a skipped frame is found, by default we halt.

virtual void mitk::VideoTrackerMatching::SetInterpolateMatrices ( bool  _arg)
virtual

Set a flag to determine whether we interpolate matrices or just use nearest neighbour.

void mitk::VideoTrackerMatching::SetVideoLagMilliseconds ( unsigned long long  VideoLag,
bool  VideoLeadsTracking = false,
int  trackerIndex = -1 
)

If the tracking data is ahead of the video data you can set a video lag in milliseconds to account for this. If the video is ahead of the tracking set argument 2 to true.

virtual void mitk::VideoTrackerMatching::SetWriteTimingErrors ( bool  _arg)
virtual

Set a flag as to whether to write out the timing errors.

Member Data Documentation

std::string mitk::VideoTrackerMatching::m_Directory
protected
bool mitk::VideoTrackerMatching::m_FlipMatrices
protected
std::vector<unsigned int> mitk::VideoTrackerMatching::m_FrameNumbers
protected
bool mitk::VideoTrackerMatching::m_InterpolateMatrices
protected
bool mitk::VideoTrackerMatching::m_Ready
protected
TimeStampsContainer mitk::VideoTrackerMatching::m_VideoTimeStamps
protected
bool mitk::VideoTrackerMatching::m_WriteTimingErrors
protected

The documentation for this class was generated from the following files: