PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusIntuitiveDaVinciTracker.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 __vtkPlusIntuitiveDaVinciTracker_h
8 #define __vtkPlusIntuitiveDaVinciTracker_h
9 
10 // Local includes
11 #include "vtkPlusDataCollectionExport.h"
12 #include "vtkPlusDevice.h"
13 
14 // VTK includes
15 #include <vtkObjectFactory.h>
16 
17 // Intuitive includes
18 #include "IntuitiveDaVinci.h"
19 #include <isi_api.h>
20 
21 class vtkMatrix4x4;
22 class IntuitiveDaVinci;
24 
26 {
27  void ISICALLBACK streamCB(void* userdata);
28  void ISICALLBACK eventCB(ISI_MANIP_INDEX mid, ISI_EVENT_ID event_id, ISI_INT args[ISI_NUM_EVENT_ARGS], void* userdata);
29 };
30 
31 /* This class talks with the da Vinci Surgical System. */
32 class vtkPlusDataCollectionExport vtkPlusIntuitiveDaVinciTracker : public vtkPlusDevice
33 {
34 public:
37  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
38 
40  virtual std::string GetSdkVersion();
41 
42  virtual bool IsTracker() const { return true; }
43 
45  virtual PlusStatus Probe();
46 
48  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* rootConfigElement);
49 
51  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* rootConfigElement);
52 
53  IntuitiveDaVinci* GetDaVinci() const;
54 
55  vtkSetStdStringMacro(IpAddr);
56  vtkGetStdStringMacro(IpAddr);
57 
58  vtkSetMacro(Port, unsigned int);
59  vtkGetMacro(Port, unsigned int);
60 
61  vtkSetStdStringMacro(Password);
62  vtkGetStdStringMacro(Password);
63 
64 protected:
67 
69  virtual PlusStatus InternalConnect();
70 
73 
76 
79 
80 protected:
83 
86 
87  unsigned int FrameNumber;
88 
89 #ifdef USE_DAVINCI_TIMESTAMPS
90  double TrackerTimeToSystemTimeSec; // time_System = time_Tracker + TrackerTimeToSystemTimeSec
91  bool TrackerTimeToSystemTimeComputed; // the time offset is always computed when the first frame is received after start tracking
92 #endif
93 
94  std::string IpAddr;
95  unsigned int Port;
96  std::string Password;
97 
98 private:
100  void operator=(const vtkPlusIntuitiveDaVinciTracker&);
101 
102  void StreamCallback(void);
103 
104  friend void vtkPlusIntuitiveDaVinciTrackerUtilities::streamCB(void* userData);
105  friend void vtkPlusIntuitiveDaVinciTrackerUtilities::eventCB(ISI_MANIP_INDEX mid, ISI_EVENT_ID event_id, ISI_INT args[ISI_NUM_EVENT_ARGS], void* userdata);
106 
107  ISI_MANIP_INDEX getManipIndexFromName(const std::string& toolName);
108  void setVtkMatrixFromISITransform(vtkMatrix4x4& vtkMatrix, ISI_TRANSFORM* isiMatrix);
109 
110  static const int CONNECT_RETRY_DELAY_SEC = 1.0;
111  static const int MAX_ATTEMPTS = 5;
112 };
113 
114 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStopRecording()
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
void ISICALLBACK eventCB(ISI_MANIP_INDEX mid, ISI_EVENT_ID event_id, ISI_INT args[ISI_NUM_EVENT_ARGS], void *userdata)
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
static const int CONNECT_RETRY_DELAY_SEC
virtual std::string GetSdkVersion()
virtual PlusStatus Probe()
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual PlusStatus InternalStartRecording()
virtual PlusStatus InternalDisconnect()
static vtkPlusDevice * New()