PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusBrachyTracker.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 __vtkPlusBrachyTracker_h
8 #define __vtkPlusBrachyTracker_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 
12 #include "PlusBrachyStepper.h"
13 #include "PlusConfigure.h"
14 #include "vtkPlusDevice.h"
15 
24 class vtkPlusDataCollectionExport vtkPlusBrachyTracker : public vtkPlusDevice
25 {
26 public:
27 
30  {
31  PROBEHOME_TO_PROBE_TRANSFORM = 0,
34  NUMBER_OF_BRACHY_TOOLS
35  };
36 
39  {
40  ROW_PROBE_POSITION = 0,
41  ROW_PROBE_ROTATION = 1,
42  ROW_TEMPLATE_POSITION = 2
43  };
44 
45  static vtkPlusBrachyTracker* New();
47  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
51 
54 
56  virtual PlusStatus NotifyConfigured();
57 
59  PlusStatus Probe();
60 
62  PlusStatus ResetStepper();
63 
65  PlusStatus InitializeStepper(std::string& calibMsg);
66 
68  virtual PlusStatus GetTrackedFrame(double timestamp, igsioTrackedFrame* aTrackedFrame);
69 
71  PlusStatus GetStepperEncoderValues(BufferItemUidType uid, double& probePosition, double& probeRotation, double& templatePosition, ToolStatus& status);
72 
74  PlusStatus GetLatestStepperEncoderValues(double& probePosition, double& probeRotation, double& templatePosition, ToolStatus& status);
75 
77  PlusStatus GetStepperEncoderValues(double timestamp, double& probePosition, double& probeRotation, double& templatePosition, ToolStatus& status);
78 
80  PlusStatus GetProbeHomeToProbeTransform(BufferItemUidType uid, vtkMatrix4x4* probeHomeToProbeMatrix, ToolStatus& status);
81 
83  PlusStatus GetProbeHomeToProbeTransform(double timestamp, vtkMatrix4x4* probeHomeToProbeMatrix, ToolStatus& status);
84 
86  PlusStatus GetTemplateHomeToTemplateTransform(BufferItemUidType uid, vtkMatrix4x4* templateHomeToTemplateMatrix, ToolStatus& status);
87 
89  PlusStatus GetTemplateHomeToTemplateTransform(double timestamp, vtkMatrix4x4* templateHomeToTemplateMatrix, ToolStatus& status);
90 
92  PlusStatus GetRawEncoderValuesTransform(BufferItemUidType uid, vtkMatrix4x4* rawEncoderValuesTransform, ToolStatus& status);
93 
95  PlusStatus GetRawEncoderValuesTransform(double timestamp, vtkMatrix4x4* rawEncoderValuesTransform, ToolStatus& status);
96 
97  virtual bool IsTracker() const { return true; }
98 
100  vtkGetStringMacro(ModelVersion);
101 
103  vtkGetStringMacro(ModelNumber);
104 
106  vtkGetStringMacro(ModelSerialNumber);
107 
109  vtkSetMacro(SerialPort, unsigned long);
110 
112  vtkGetMacro(SerialPort, unsigned long);
113 
115  vtkSetMacro(BaudRate, unsigned long);
116 
118  vtkGetMacro(BaudRate, unsigned long);
119 
121  vtkGetStringMacro(CalibrationAlgorithmVersion);
122 
124  vtkSetStringMacro(CalibrationAlgorithmVersion);
125 
127  vtkGetStringMacro(CalibrationDate);
128 
130  vtkSetStringMacro(CalibrationDate);
131 
133  vtkSetVector3Macro(ProbeTranslationAxisOrientation, double);
134 
136  vtkGetVector3Macro(ProbeTranslationAxisOrientation, double);
137 
139  vtkSetVector3Macro(ProbeRotationAxisOrientation, double);
140 
142  vtkGetVector3Macro(ProbeRotationAxisOrientation, double);
143 
145  vtkSetVector3Macro(TemplateTranslationAxisOrientation, double);
146 
148  vtkGetVector3Macro(TemplateTranslationAxisOrientation, double);
149 
151  vtkSetMacro(ProbeRotationEncoderScale, double);
152 
154  vtkGetMacro(ProbeRotationEncoderScale, double);
155 
157  vtkSetMacro(CompensationEnabled, bool);
158 
160  vtkGetMacro(CompensationEnabled, bool);
161 
163  vtkBooleanMacro(CompensationEnabled, bool);
164 
169  PlusBrachyStepper::BRACHY_STEPPER_TYPE GetBrachyStepperType() { return this->BrachyStepperType; }
170 
173 
175  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
176 
178  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* config);
179 
180 protected:
183 
184  std::string GetBrachyToolSourceId(BRACHY_STEPPER_TOOL tool);
185 
187  vtkSetStringMacro(ModelVersion);
188 
190  vtkSetStringMacro(ModelNumber);
191 
193  vtkSetStringMacro(ModelSerialNumber);
194 
201 
204 
206  PlusStatus InitBrachyTracker();
207 
209 
211 
213  char* ModelNumber;
215 
216  unsigned long SerialPort;
217  unsigned long BaudRate;
218 
219  //========== Stepper calibration ==================
220 
223 
226 
229 
231  double ProbeTranslationAxisOrientation[3];
232 
234  double ProbeRotationAxisOrientation[3];
235 
237  double TemplateTranslationAxisOrientation[3];
238 
241 
242 private:
244  void operator=(const vtkPlusBrachyTracker&);
245 };
246 
247 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStopRecording()
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
PlusBrachyStepper::BRACHY_STEPPER_TYPE BrachyStepperType
double * timestamp
Definition: phidget22.h:3432
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
PlusBrachyStepper::BRACHY_STEPPER_TYPE GetBrachyStepperType()
virtual PlusStatus Probe()
virtual bool IsTracker() const
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
Interface to brachytherapy steppers.
virtual PlusStatus InternalStartRecording()
virtual PlusStatus NotifyConfigured()
PlusBrachyStepper * Device
virtual PlusStatus InternalDisconnect()
unsigned long long BufferItemUidType
virtual PlusStatus InternalUpdate()
static vtkPlusDevice * New()