PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusCapistranoVideoSource.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 __vtkPlusCapistranoVideoSource_h
8 #define __vtkPlusCapistranoVideoSource_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 #include "vtkPlusUsDevice.h"
13 
23 class vtkPlusDataCollectionExport vtkPlusCapistranoVideoSource: public vtkPlusUsDevice
24 {
25 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30  static const char* CAPISTRANO_SET_WOBBLE_RATE;
31  static const char* CAPISTRANO_GET_WOBBLE_RATE;
34  static const char* CAPISTRANO_FREEZE_PROBE;
35  static const char* CAPISTRANO_IS_PROBE_FROZEN;
38  static const char* CAPISTRANO_SET_MIS_MODE;
39  static const char* CAPISTRANO_GET_MIS_MODE;
40  static const char* CAPISTRANO_SET_MIS_PULSE_PERIOD;
41  static const char* CAPISTRANO_GET_MIS_PULSE_PERIOD;
42  static const char* CAPISTRANO_SET_SWEEP_ANGLE;
43  static const char* CAPISTRANO_GET_SWEEP_ANGLE;
46  static const char* CAPISTRANO_SET_SAMPLE_FREQUENCY;
47  static const char* CAPISTRANO_GET_SAMPLE_FREQUENCY;
48  static const char* CAPISTRANO_SET_SERVO_GAIN;
49  static const char* CAPISTRANO_GET_SERVO_GAIN;
50  static const char* CAPISTRANO_SET_POSITION_SCALE;
51  static const char* CAPISTRANO_GET_POSITION_SCALE;
52 
54  bool IsTracker() const override
55  {
56  return false;
57  }
58 
60  PlusStatus ReadConfiguration(vtkXMLDataElement* config) override;
61 
63  PlusStatus WriteConfiguration(vtkXMLDataElement* config) override;
64 
66  PlusStatus NotifyConfigured() override;
67 
69  std::string GetSdkVersion() override;
70 
72  PlusStatus GetHardwareVersion(int& HardwareVersion);
73 
75  PlusStatus GetHighPassFilter(int& HighPassFilter);
76 
78  PlusStatus GetLowPassFilter(int& LowPassFilter);
79 
80  /* Update Speed of Sound */
81  PlusStatus GetProbeVelocityDevice(float& aVel);
82 
83  /* Set the speed of sound of US probe */
84  PlusStatus SetSoundVelocity(float ss);
85 
86  /* Set the scan directional mode of US probe */
87  PlusStatus SetBidirectionalMode(bool mode);
88 
89  /* Get the scan directional mode of US probe */
90  bool GetBidirectionalMode();
91 
92  /* Set the size of cinebuffer of US probe */
93  PlusStatus SetCineBuffers(int cinebuffer);
94 
95  /* Set the sample frequency of US probe */
96  PlusStatus SetSampleFrequency(float sf);
97 
98  /* Set the pulser frequency of US probe */
99  PlusStatus SetPulseFrequency(float pf);
100 
101  /* Set the desired probe speed in Hz.
102  * The resulting probe speed will be approximately the value specified. */
103  PlusStatus SetWobbleRate(unsigned char wobbleRate);
104 
105  /* Probe speed in Hz */
106  unsigned char GetWobbleRate();
107 
108  /* Set the jitter compensation value for the probe servo */
109  PlusStatus SetJitterCompensation(unsigned char jitterComp);
110 
111  /* Jitter compensation value for the probe servo */
112  unsigned char GetJitterCompensation();
113 
114  /* Set the position scale value for the probe servo */
115  PlusStatus SetPositionScale(unsigned char scale);
116 
117  /* Position scale value for the probe servo */
118  unsigned char GetPositionScale();
119 
120  /* Set the desired probe scan angle (in radians) */
121  PlusStatus SetSweepAngle(float sweepAngle);
122 
123  /* Probe scan angle (in radians) */
124  float GetSweepAngle();
125 
126  /* Set the gain value for the probe servo */
127  PlusStatus SetServoGain(unsigned char servoGain);
128 
129  /* Gain value for the probe servo */
130  unsigned char GetServoGain();
131 
132  /* State is the desired overscan multiplier.
133  * Overscan is done in 6.25% steps from 6.25% to 50% (three-bit number).
134  * As such, the valid values are 0…7 which correspond to 6.25%, 12.5%, …, 43.75%, 50%. */
135  PlusStatus SetOverscan(int state);
136 
137  /* Overscan multiplier. Overscan is done in 6.25% steps from 6.25% to 50% (three-bit number).
138  * As such, the valid values are 0…7 which correspond to 6.25%, 12.5%, …, 43.75%, 50%. */
139  int GetOverscan();
140 
141  /* Sets the desired probe servo derivative compensation */
142  PlusStatus SetDerivativeCompensation(unsigned char derivativeCompensation);
143 
144  /* Probe servo derivative compensation */
145  unsigned char GetDerivativeCompensation();
146 
147  /* Set the pulser voltage of US probe. Valid range is from 0.0 to 100.0. Values outside the range will be clipped to this range. */
148  PlusStatus SetPulseVoltage(float pv);
149 
150  /* Get the pulser voltage of US probe */
151  float GetPulseVoltage();
152 
153  /* Set the scan depth of US probe */
154  PlusStatus SetScanDepth(float sd);
155 
156  /* Set the interpolation of B-Mode image */
157  PlusStatus SetInterpolate(bool interpolate);
158 
159  /* Set the average mode of US B-Mode image */
160  PlusStatus SetAverageMode(bool averagemode);
161 
162  /* Set the view option of US B-Mode image */
163  PlusStatus SetBModeViewOption(unsigned int bmodeviewoption);
164 
165  /* Set the size of US B-mode image */
166  PlusStatus SetImageSize(const FrameSizeType& imageSize);
167 
168  /* Set the Intensity (Brightness) of US B-mode image */
169  PlusStatus SetIntensity(double value);
170 
171  /* Set the Contrast of US B-mode image */
172  PlusStatus SetContrast(double value);
173 
174  /* Set the zoom factor. */
175  PlusStatus SetZoomFactor(double zoomfactor);
176 
177  /* Set the zoom factor on the US Device. */
178  PlusStatus SetDisplayZoomDevice(double zoom);
179 
180  /* Set the LUT Center of US B-mode image */
181  PlusStatus SetLutCenter(double lutcenter);
182 
183  /* Set the LUT Window of US B-mode image */
184  PlusStatus SetLutWindow(double lutwindow);
185 
186  /* Set the gain in percent */
187  PlusStatus SetGainPercent(double gainPercent[3]);
188 
189  /* Set the gain in percent in the device */
190  PlusStatus SetGainPercentDevice(double gainPercent[3]);
191 
192  /* Set the probe depth on US Device in mm */
193  PlusStatus SetDepthMmDevice(float depthMm);
194 
195  /* Set the probe depth in mm */
196  PlusStatus SetDepthMm(float depthMm);
197 
200 
202  vtkSetVector3Macro(CurrentPixelSpacingMm, double);
203 
205  vtkGetVector3Macro(CurrentPixelSpacingMm, double);
206 
208  PlusStatus FreezeDevice(bool freeze);
209 
211  bool IsFrozen();
212 
218  PlusStatus SetMISMode(bool mode);
219 
220  /* Get the MIS Mode state. Only implemented with Capistrano SDK 2019.2 and newer. */
221  PlusStatus GetMISMode(bool& MISMode);
222 
228  PlusStatus SetMISPulsePeriod(unsigned int val);
229 
231  PlusStatus GetMISPulsePeriod(unsigned int& PulsePeriod);
232 
234  bool IsBoardAttached();
235 
236 protected:
239 
242 
244  PlusStatus InternalConnect() override;
245 
247  PlusStatus InternalDisconnect() override;
248 
251 
254 
256  PlusStatus InitializeCapistranoVideoSource();
257 
260 
262  PlusStatus InitializeCapistranoProbe();
263 
264  /* Set up US Probe with ID */
265  PlusStatus SetupProbe(int probeID = 0);
266 
268  PlusStatus InitializeImageWindow();
269 
271  PlusStatus InitializeLUT();
272 
274  PlusStatus InitializeTGC();
275 
277  PlusStatus WaitForFrame();
278 
279  /* Set the boolean value to use US parameters from XML file */
280  PlusStatus SetUpdateParameters(bool b);
281 
282  /* Update US parameters (US probe/B-Mode parameters) */
283  PlusStatus UpdateUSParameters();
284 
285  /* Update US probe parameters */
286  PlusStatus UpdateUSProbeParameters();
287 
288  /* Update US B-Mode parameters */
289  PlusStatus UpdateUSBModeParameters();
290 
291  /* Calculate US Image Display */
292  PlusStatus CalculateDisplay();
293 
294  /* Calculate US Image Display with a given B-Mode view option */
295  PlusStatus CalculateDisplay(unsigned int option);
296 
297  /* Update US Scan depth */
298  PlusStatus UpdateDepthMode();
299 
300  /* Update US Scan depth with a given clockdivider */
301  PlusStatus UpdateDepthMode(int clockdivider);
302 
303  /* Update US Sample frequency */
304  PlusStatus GetSampleFrequencyDevice(float& aFreq);
305 
307  PlusStatus GetProbeNameDevice(std::string& probeName);
308 
311  class vtkInternal;
312  vtkInternal* Internal;
313 
314  bool Initialized = false;
315  bool Frozen;
317  bool MISMode;
318  unsigned int PulsePeriod;
323  int ProbeID;
327  unsigned char PositionScale;
331  double LutCenter;
332  double LutWindow;
333 
334  igsioFieldMapType CustomFields;
335 
336 private:
338  void operator=(const vtkPlusCapistranoVideoSource&); // Not implemented
339 };
340 
341 #endif
virtual PlusStatus InternalStopRecording()
static const char * CAPISTRANO_SET_SAMPLE_FREQUENCY
static const char * CAPISTRANO_GET_JITTER_COMPENSATION
Phidget_MeshMode mode
Definition: phidget22.h:1332
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
virtual std::string GetSdkVersion()
static const char * CAPISTRANO_SET_BIDIRECTIONAL_MODE
static const char * CAPISTRANO_SET_MIS_PULSE_PERIOD
Initial rotation matrix b
Definition: algo3.m:25
static const char * CAPISTRANO_SET_DERIVATIVE_COMPENSATION
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStartRecording()
static vtkPlusUsDevice * New()
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
int * state
Definition: phidget22.h:3207
const char const char * value
Definition: phidget22.h:5111
static const char * CAPISTRANO_GET_MIS_PULSE_PERIOD
static const char * CAPISTRANO_GET_BIDIRECTIONAL_MODE
virtual PlusStatus InternalApplyImagingParameterChange()
virtual PlusStatus NotifyConfigured()
Class for acquiring ultrasound images from Capistrano Labs USB ultrasound systems.
virtual PlusStatus InternalDisconnect()
static const char * CAPISTRANO_GET_SAMPLE_FREQUENCY
Abstract interface for ultrasound video devices.
static const char * CAPISTRANO_SET_JITTER_COMPENSATION
virtual PlusStatus InternalUpdate()
static const char * CAPISTRANO_GET_DERIVATIVE_COMPENSATION