PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusAtracsysTracker.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 __vtkPlusAtracsysTracker_h
8 #define __vtkPlusAtracsysTracker_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 #include "vtkPlusDevice.h"
12 
13 #include <string>
14 
22 class vtkPlusDataCollectionExport vtkPlusAtracsysTracker : public vtkPlusDevice
23 {
24 public:
25  static vtkPlusAtracsysTracker* New();
27  void PrintSelf(ostream& os, vtkIndent indent);
28 
29  /* Get SDK version */
30  std::string GetSdkVersion();
31 
35  std::string GetCalibrationDate();
36 
37  /* Get device type */
38  std::string GetDeviceType();
39 
46  PlusStatus GetCamerasCalibration(
47  std::array<float, 10>& leftIntrinsic, std::array<float, 10>& rightIntrinsic,
48  std::array<float, 3>& rightPosition, std::array<float, 3>& rightOrientation);
49 
54  PlusStatus GetLoadedGeometries(std::map<int, std::vector<std::array<float, 3>>>& geometries);
55 
56  /* Device is a hardware tracker. */
57  virtual bool IsTracker() const { return true; }
58  virtual bool IsVirtual() const;
59 
61  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
62 
64  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* config);
65 
68 
71 
73  PlusStatus Probe();
74 
77 
79  PlusStatus PauseVirtualDevice();
80  PlusStatus UnpauseVirtualDevice();
81 
82 public:
83  // Commands
84  static const char* ATRACSYS_COMMAND_SET_FLAG;
85  static const char* ATRACSYS_COMMAND_LED_ENABLED;
86  static const char* ATRACSYS_COMMAND_LASER_ENABLED;
87  static const char* ATRACSYS_COMMAND_VIDEO_ENABLED;
88  static const char* ATRACSYS_COMMAND_SET_LED_RGBF; // F = LED flash frequency
89  static const char* ATRACSYS_COMMAND_ENABLE_TOOL;
90  static const char* ATRACSYS_COMMAND_ADD_TOOL;
91 
92  const std::map<std::string, std::string>& GetDeviceOptions() const;
93  PlusStatus GetOptionValue(const std::string& optionName, std::string& optionValue);
94 
95  // Command methods
96  // LED
97  PlusStatus SetLedEnabled(bool enabled);
98  PlusStatus SetUserLEDState(int red, int green, int blue, int frequency, bool enabled = true);
99  // Tools
100  PlusStatus SetToolEnabled(std::string toolId, bool enabled);
101  PlusStatus AddToolGeometry(std::string toolId, std::string geomString);
102  // Other
103  PlusStatus SetLaserEnabled(bool enabled);
104  PlusStatus SetVideoEnabled(bool enabled);
105 
106 protected:
109 
110  // helper to translate option names from Plus nomenclature to Atracsys' one
111  bool TranslateOptionName(const std::string& optionName, std::string& translatedOptionName);
112 
113 private: // Functions
115 
118 
121  std::vector<std::string> DisabledToolIds;
122 
123  class vtkInternal;
124  vtkInternal* Internal;
125 };
126 
127 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStopRecording()
static const char * ATRACSYS_COMMAND_SET_FLAG
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
static const char * ATRACSYS_COMMAND_VIDEO_ENABLED
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
static const char * ATRACSYS_COMMAND_ENABLE_TOOL
virtual std::string GetSdkVersion()
virtual PlusStatus Probe()
static const char * ATRACSYS_COMMAND_LED_ENABLED
virtual bool IsTracker() const
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus InternalStartRecording()
static const char * ATRACSYS_COMMAND_LASER_ENABLED
int enabled
Definition: phidget22.h:3369
static const char * ATRACSYS_COMMAND_SET_LED_RGBF
static const char * ATRACSYS_COMMAND_ADD_TOOL
virtual PlusStatus InternalDisconnect()
double frequency
Definition: phidget22.h:3246
virtual bool IsVirtual() const
virtual PlusStatus InternalUpdate()
static vtkPlusDevice * New()
Interface to the Atracsys trackers This class talks with a Atracsys Tracker over the sTk Passive Trac...