NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
mitkTrackingAndTimeStampsContainer.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef mitkTrackingAndTimeStampsContainer_h
16 #define mitkTrackingAndTimeStampsContainer_h
17 
18 #include "niftkOpenCVUtilsExports.h"
20 
21 namespace mitk
22 {
23 
32 class NIFTKOPENCVUTILS_EXPORT TrackingAndTimeStampsContainer
33 {
34 public:
35 
39  void Clear();
40 
45  int LoadFromDirectory(const std::string& dirName, const bool& haltOnMatrixReadFail);
46 
50  int SaveToDirectory(const std::string& dirName);
51 
57  void Insert(const TimeStampsContainer::TimeStamp& timeStamp, const cv::Matx44d& matrix);
58 
62  TimeStampsContainer::TimeStamp GetTimeStamp(std::vector<TimeStampsContainer::TimeStamp>::size_type frameNumber) const;
63 
67  cv::Matx44d GetMatrix(std::vector<TimeStampsContainer::TimeStamp>::size_type frameNumber) const;
68 
72  std::vector<TimeStampsContainer::TimeStamp>::size_type GetSize() const;
73 
77  std::vector<TimeStampsContainer::TimeStamp>::size_type GetFrameNumber(const TimeStampsContainer::TimeStamp& timeStamp) const;
78 
82  TimeStampsContainer::TimeStamp GetNearestTimeStamp(const TimeStampsContainer::TimeStamp& timeStamp, long long *delta = NULL ) const;
83 
89  cv::Matx44d InterpolateMatrix(const TimeStampsContainer::TimeStamp& timeStamp,
90  long long& minError, bool& inBounds);
91 
97  cv::Matx44d GetNearestMatrix(const TimeStampsContainer::TimeStamp& timeStamp,
98  long long& error, bool& inBounds);
99 
100 private:
101 
102  mitk::TimeStampsContainer m_TimeStamps;
103  std::vector<cv::Matx44d> m_TrackingMatrices;
104  bool m_HaltOnMatrixReadError;
105 
106 };
107 
108 } // end namespace
109 
110 #endif
unsigned long long TimeStamp
Definition: mitkTimeStampsContainer.h:34
Definition: ReceptorMemberCommandTest.cxx:25
Contains a matched vector of timestamps, and 4x4 tracking Matrices.
Definition: mitkTrackingAndTimeStampsContainer.h:32
GLuint GLenum matrix
Definition: glew.h:12775
Helper class that contains a vector of timestamps, that are assumed to be strictly increasing...
Definition: mitkTimeStampsContainer.h:30
GLsizei const GLcharARB ** string
Definition: glew.h:5194