NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
mitkPickPointsOnStereoVideo.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 mitkPickPointsOnStereoVideo_h
16 #define mitkPickPointsOnStereoVideo_h
17 
18 #include "niftkOpenCVExports.h"
19 #include <string>
20 #include <itkObject.h>
21 #include <itkObjectFactory.h>
22 #include <mitkCommon.h>
23 #include <cv.h>
24 #include <highgui.h>
26 
27 namespace mitk {
28 
41 class NIFTKOPENCV_EXPORT PickPointsOnStereoVideo : public itk::Object
42 {
43 
44 public:
45 
46  mitkClassMacroItkParent(PickPointsOnStereoVideo, itk::Object)
47  itkNewMacro(PickPointsOnStereoVideo)
48 
49 
54  void Initialise (std::string directory);
59  void Project(mitk::VideoTrackerMatching::Pointer matcher);
60 
66  void SetMatcherCameraToTracker(mitk::VideoTrackerMatching::Pointer matcher);
67 
68  itkSetMacro ( TrackerIndex, int);
69  itkSetMacro ( ReferenceIndex, int);
70  itkSetMacro ( AllowableTimingError, long long);
71  itkSetMacro ( OrderedPoints, bool);
72  itkSetMacro ( PickingLine, bool);
73  itkSetMacro ( AskOverWrite, bool);
74  itkSetMacro ( HaltOnVideoReadFail, bool);
75  itkSetMacro ( WriteAnnotatedImages, bool);
76  itkSetMacro ( HalfImageWidth, bool);
77  itkSetMacro ( Frequency, unsigned int);
78 
79  itkGetMacro ( InitOK, bool);
80  itkGetMacro ( ProjectOK, bool);
81  itkGetMacro ( WorldToLeftCameraMatrices, std::vector < cv::Mat > );
82 
83 protected:
84 
86  virtual ~PickPointsOnStereoVideo();
87 
88  PickPointsOnStereoVideo(const PickPointsOnStereoVideo&); // Purposefully not implemented.
89  PickPointsOnStereoVideo& operator=(const PickPointsOnStereoVideo&); // Purposefully not implemented.
90 
91 private:
92  std::string m_VideoIn; //the video in file
93  std::string m_Directory; //the directory containing the data
94  std::string m_OutDirectory; //the directory to save to
95 
96  int m_TrackerIndex; //the tracker index to use for frame matching
97  int m_ReferenceIndex; //the reference index to use for frame matching, not used by default
98 
99  bool m_InitOK;
100  bool m_ProjectOK;
101  bool m_OrderedPoints; //picked points can be ordered or unordered
102  bool m_PickingLine; //if true we are picking a line defined by a vector of points
103  bool m_AskOverWrite; //if true, we will ask if you want to overwrite existing results
104  bool m_HaltOnVideoReadFail; //halt if video read fail
105  bool m_WriteAnnotatedImages; //halt if video read fail
106  bool m_HalfImageWidth; //halves the image width used for point picking, useful for small screens
107 
108  unsigned int m_StartFrame; //you can exclude some frames at the start
109  unsigned int m_EndFrame; // and at the end
110  unsigned int m_Frequency; // the sample rate (process every m_Frequency frame)
111 
112  //the dimensions of the video screen in pixels
113  double m_VideoWidth;
114  double m_VideoHeight;
115 
116  std::vector < cv::Mat > m_WorldToLeftCameraMatrices; // the saved camera positions
117 
118  cv::VideoCapture* m_Capture;
119 
120  long long m_AllowableTimingError; // the maximum permisable timing error when setting points or calculating projection errors;
121 
122 }; // end class
123 
124 } // end namespace
125 
126 #endif
Definition: ReceptorMemberCommandTest.cxx:25
Takes an input video file and tracking data. The video is split into right and left channels...
Definition: mitkPickPointsOnStereoVideo.h:41
#define NIFTKOPENCV_EXPORT
Definition: niftkSequentialCpuQds.h:27
GLsizei const GLcharARB ** string
Definition: glew.h:5194