PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusOvrvisionProVideoSource.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2  Program: Plus
3  Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4  See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusOvrvisionProVideoSource_h
8 #define __vtkPlusOvrvisionProVideoSource_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 #include "vtkPlusDevice.h"
12 
13 // OvrvisionPro SDK includes
14 #include <ovrvision_pro.h>
15 
16 // OpenCV includes
17 #include <opencv2/core/mat.hpp>
18 
24 class vtkPlusDataCollectionExport vtkPlusOvrvisionProVideoSource : public vtkPlusDevice
25 {
26 public:
29  void PrintSelf(ostream& os, vtkIndent indent);
30 
31  virtual bool IsTracker() const
32  {
33  return false;
34  }
35 
37  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
39  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* config);
40 
42  virtual PlusStatus NotifyConfigured();
43 
44  vtkGetStdStringMacro(LeftEyeDataSourceName);
45  vtkGetStdStringMacro(RightEyeDataSourceName);
46  vtkGetStdStringMacro(ProcessingModeName);
47  vtkGetStdStringMacro(Vendor);
48 
49  std::array<unsigned int, 2> GetResolution() const;
50  vtkGetMacro(Framerate, int);
51  vtkGetMacro(CameraSync, bool);
52  vtkSetMacro(Exposure, int);
53 
54 protected:
55  vtkSetStdStringMacro(LeftEyeDataSourceName);
56  vtkSetStdStringMacro(RightEyeDataSourceName);
57  vtkSetStdStringMacro(ProcessingModeName);
58  vtkSetStdStringMacro(Vendor);
59 
60  vtkSetMacro(CameraSync, bool);
61  vtkGetMacro(Exposure, int);
62 
64  virtual PlusStatus InternalConnect();
65 
68 
70  virtual PlusStatus InternalUpdate();
71 
72  void ConfigureProcessingMode();
73 
74  static std::string CamPropToString(OVR::Camprop format);
75  static OVR::Camprop StringToCamProp(const std::string& format);
76 
77 protected:
80 
81 protected:
82  // Requested capture format
83  OVR::OvrvisionPro OvrvisionProHandle;
84  OVR::Camprop RequestedFormat;
85  OVR::ROI RegionOfInterest;
86  OVR::Camqt ProcessingMode;
87  bool CameraSync;
88 
89  // Cache variables from the config file
90  std::array<unsigned int, 2> Resolution;
91  int Framerate;
92  std::string ProcessingModeName;
94  std::string Vendor;
95  int Exposure;
96 
97  // Record which data source corresponds to which eye
98  std::string LeftEyeDataSourceName;
100 
103 
104 #if defined(PLUS_USE_OPENCL)
105  cv::UMat LeftImageCL;
106  cv::UMat RightImageCL;
107 #endif
108 
109  cv::Mat LeftImage;
110  cv::Mat RightImage;
113 
114 private:
115  static vtkPlusOvrvisionProVideoSource* ActiveDevice;
117  void operator=(const vtkPlusOvrvisionProVideoSource&); // Not implemented.
118 };
119 
120 #endif
std::array< unsigned int, 2 > Resolution
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
virtual PlusStatus InternalUpdate()
static vtkPlusDevice * New()
Interface to a 3D positioning tool, video source, or generalized data stream.