NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
mitkTwoTrackerMatching.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 mitkTwoTrackerMatching_h
16 #define mitkTwoTrackerMatching_h
17 
18 #include "niftkOpenCVExports.h"
19 #include <cv.h>
20 #include <itkObject.h>
21 #include <itkObjectFactory.h>
22 #include <mitkCommon.h>
23 #include "mitkTrackingMatrices.h"
25 
26 namespace mitk
27 {
28 
32 class NIFTKOPENCV_EXPORT TwoTrackerMatching : public itk::Object
33 {
34 public:
35  mitkClassMacroItkParent ( TwoTrackerMatching, itk::Object)
36  itkNewMacro (TwoTrackerMatching)
37 
38 
41  void Initialise (std::string directory1, std::string directory2);
42 
46  cv::Mat GetTrackerMatrix ( unsigned int index, long long * TimingError = NULL, unsigned int TrackerIndex = 0 );
47 
51  bool IsReady ()
52  {
53  return m_Ready;
54  }
55 
60  {
61  return m_FrameNumbers.size();
62  }
63 
69  void SetLagMilliseconds(unsigned long long Lag, bool LagIsNegative =false);
70 
71  void FlipMats1 ();
72  void FlipMats2 ();
73 
74 protected:
76  virtual ~TwoTrackerMatching();
77 
78  TwoTrackerMatching(const TwoTrackerMatching&); // Purposefully not implemented.
79  TwoTrackerMatching& operator=(const TwoTrackerMatching&); // Purposefully not implemented.
80 
81  std::vector<unsigned int> m_FrameNumbers;
84  bool m_Ready;
87 
88  TrackingMatrices m_TrackingMatrices11; // The tracking matrices in directory 1
89  TrackingMatrices m_TrackingMatrices22; // The tracking matrices in directory 2
90  TrackingMatrices m_TrackingMatrices12; // The tracking matrices in directory 2 corresponding with the timestamps in directory 1
91  TrackingMatrices m_TrackingMatrices21; // The tracking matrices in directory 1 corresponding with the timestamps in directory 2
92 
93 private:
94 
95  void ConvertMatrices(const TrackingAndTimeStampsContainer& container1, TrackingMatrices& container2);
96  void LookupMatrices(const TrackingAndTimeStampsContainer& container1,
97  const TrackingAndTimeStampsContainer& container2,
98  TrackingMatrices& outputContainer);
99  bool CheckTimingErrorStats();
100  void CreateLookUps();
101 
102  unsigned long long m_Lag; // The delay between tracker1 and tracker2
103  bool m_LagIsNegative; // Controls the direction of lag
104 
105  bool m_FlipMat1; // flip matrices in directory1
106  bool m_FlipMat2; // flip matrices in directory2
107 
108 };
109 
110 
111 } // namespace
112 
113 
114 #endif // niftkTwoTrackerMatching_h
std::string m_Directory1
Definition: mitkTwoTrackerMatching.h:85
Definition: mitkTrackingMatrices.h:24
TrackingAndTimeStampsContainer m_TimeStampsContainer2
Definition: mitkTwoTrackerMatching.h:83
int GetNumberOfFrames()
Get the frame count.
Definition: mitkTwoTrackerMatching.h:59
A class to match two sets of time stamped data currently for reading recorded tracking data...
Definition: mitkTwoTrackerMatching.h:32
std::string m_Directory2
Definition: mitkTwoTrackerMatching.h:86
bool IsReady()
returns state of m_Ready
Definition: mitkTwoTrackerMatching.h:51
Definition: ReceptorMemberCommandTest.cxx:25
std::vector< unsigned int > m_FrameNumbers
Definition: mitkTwoTrackerMatching.h:81
TrackingMatrices m_TrackingMatrices22
Definition: mitkTwoTrackerMatching.h:89
bool m_Ready
Definition: mitkTwoTrackerMatching.h:84
TrackingMatrices m_TrackingMatrices12
Definition: mitkTwoTrackerMatching.h:90
#define NIFTKOPENCV_EXPORT
Definition: niftkSequentialCpuQds.h:27
TrackingMatrices m_TrackingMatrices11
Definition: mitkTwoTrackerMatching.h:88
Contains a matched vector of timestamps, and 4x4 tracking Matrices.
Definition: mitkTrackingAndTimeStampsContainer.h:32
GLuint index
Definition: glew.h:1798
TrackingMatrices m_TrackingMatrices21
Definition: mitkTwoTrackerMatching.h:91
TrackingAndTimeStampsContainer m_TimeStampsContainer1
Definition: mitkTwoTrackerMatching.h:82
GLsizei const GLcharARB ** string
Definition: glew.h:5194