PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusSonixVideoSource.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 /*=========================================================================
8 The following copyright notice is applicable to parts of this file:
9 Copyright (c) 2008, Queen's University, Kingston, Ontario, Canada
10 All rights reserved.
11 Authors include: Danielle Pace
12 (Robarts Research Institute and The University of Western Ontario)
13 Siddharth Vikal (Queen's University, Kingston, Ontario, Canada)
14 =========================================================================*/
15 
16 #ifndef __vtkPlusSonixVideoSource_h
17 #define __vtkPlusSonixVideoSource_h
18 
19 #include "PlusConfigure.h"
20 #include "ulterius.h"
21 #include "vtkPlusDataCollectionExport.h"
22 #include "vtkPlusUsDevice.h"
23 
24 class uDataDesc;
25 enum uData;
26 
50 class vtkPlusDataCollectionExport vtkPlusSonixVideoSource : public vtkPlusUsDevice
51 {
52 private:
53  class Plus_uTGC : public uTGC
54  {
55  public:
57  std::vector<int> toVector();
59  void fromVector(const std::vector<int> input);
61  std::string toString(char separator = ' ');
63  void fromString(const std::string& input, char separator = ' ');
64  };
65 
66 public:
67  static vtkPlusSonixVideoSource* New();
69  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
70 
72  virtual std::string GetSdkVersion();
73 
75  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
76 
78  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* config);
79 
81  vtkSetStringMacro(SonixIP);
83  vtkGetStringMacro(SonixIP);
84 
86  PlusStatus SetFrequencyDevice(double aFrequency);
88  PlusStatus GetFrequencyDevice(double& aFrequency);
89 
91  PlusStatus SetDepthDevice(int aDepth);
93  PlusStatus GetDepthDevice(int& aDepth);
94 
96  PlusStatus SetGainDevice(int aGain);
98  PlusStatus GetGainDevice(int& aGain);
99 
101  PlusStatus SetDynRangeDevice(int aDynRange);
103  PlusStatus GetDynRangeDevice(int& aDynRange);
104 
106  PlusStatus SetZoomDevice(int aZoom);
108  PlusStatus GetZoomDevice(int& aZoom);
109 
111  PlusStatus SetSectorDevice(int aSector);
113  PlusStatus GetSectorDevice(int& aSector);
114 
116  PlusStatus SetTimeGainCompensationDevice(int tgc[8]);
118  PlusStatus SetTimeGainCompensationDevice(const Plus_uTGC& tgc);
120  PlusStatus GetTimeGainCompensationDevice(int tgc[8]);
122  PlusStatus GetTimeGainCompensationDevice(Plus_uTGC& tgc);
123 
125  PlusStatus GetSoundVelocityDevice(float& soundVelocity);
127  PlusStatus SetSoundVelocityDevice(float _arg);
128 
130  PlusStatus SetCompressionStatus(int aCompressionStatus);
132  PlusStatus GetCompressionStatus(int& aCompressionStatus);
133 
135  PlusStatus SetTimeout(int aTimeout);
136 
160  PlusStatus SetAcquisitionDataTypeDevice(int aAcquisitionDataType);
162  PlusStatus GetAcquisitionDataTypeDevice(int& acquisitionDataType);
163 
196  PlusStatus SetImagingModeDevice(int mode);
198  PlusStatus GetImagingModeDevice(int& mode);
199 
204  vtkSetMacro(ConnectionSetupDelayMs, int);
206  vtkGetMacro(ConnectionSetupDelayMs, int);
207 
211  vtkSetMacro(SharedMemoryStatus, int);
213  vtkGetMacro(SharedMemoryStatus, int);
214 
216  PlusStatus GetDisplayedFrameRateDevice(int& aFrameRate);
217 
219  PlusStatus SetRFDecimationDevice(int decimation);
220 
222  PlusStatus SetPPFilterDevice(int filterIndex);
223 
225  PlusStatus SetFrameRateLimitDevice(int frLimit);
226 
228  PlusStatus PrintListOfImagingParametersFromDevice();
229 
231  virtual PlusStatus NotifyConfigured();
232 
233  virtual bool IsTracker() const { return false; }
234 
236  vtkSetMacro(AutoClipEnabled, bool);
237  vtkGetMacro(AutoClipEnabled, bool);
238 
240  vtkSetMacro(ImageGeometryOutputEnabled, bool);
241  vtkGetMacro(ImageGeometryOutputEnabled, bool);
242 
243 protected:
245  virtual PlusStatus InternalConnect();
246 
248  virtual PlusStatus InternalDisconnect();
249 
255 
258 
260  std::string GetLastUlteriusError();
261 
263 
269  {
270  RF_UNKNOWN = -1,
271  RF_ACQ_B_ONLY = 0,
272  RF_ACQ_RF_ONLY = 1,
273  RF_ACQ_B_AND_RF = 2,
274  RF_ACQ_CHRF_ONLY = 3,
275  RF_ACQ_B_AND_CHRF = 4
276  };
278  PlusStatus SetRfAcquisitionModeDevice(RfAcquisitionModeType mode);
280  PlusStatus GetRfAcquisitionModeDevice(RfAcquisitionModeType& mode);
281 
283  PlusStatus AddFrameToBuffer(void* data, int type, int sz, bool cine, int frmnum);
284 
285  PlusStatus SetParamValueDevice(char* paramId, int paramValue, int& validatedParamValue);
286  PlusStatus SetParamValueDevice(char* paramId, Plus_uTGC& paramValue, Plus_uTGC& validatedParamValue);
287  PlusStatus GetParamValueDevice(char* paramId, int& paramValue, int& validatedParamValue);
288  PlusStatus GetParamValueDevice(char* paramId, Plus_uTGC& paramValue, Plus_uTGC& validatedParamValue);
289 
290  bool HasDataType( uData aValue );
291  bool WantDataType( uData aValue );
292  PlusStatus ConfigureVideoSource( uData aValue );
293 
298  virtual PlusStatus GetRequestedImagingDataTypeFromSources(int& requestedImagingDataType);
299 
301  void UpdateImagingParametersFromDevice();
302 
305 
306 protected:
308  virtual ~vtkPlusSonixVideoSource();
309 
310  ulterius* Ult;
315  int Timeout;
319 
323  std::map<std::string, bool> ChangedImagingParameters;
324 
325  char* SonixIP;
335 
336 private:
337  static bool vtkPlusSonixVideoSourceNewFrameCallback(void* data, int type, int sz, bool cine, int frmnum);
338  static bool vtkPlusSonixVideoSourceParamCallback(void* paramId, int ptX, int ptY);
339  static vtkPlusSonixVideoSource* ActiveSonixDevice;
340  vtkPlusSonixVideoSource(const vtkPlusSonixVideoSource&); // Not implemented.
341  void operator=(const vtkPlusSonixVideoSource&); // Not implemented.
342 };
343 
344 #endif
const uint32_t * data
Definition: phidget22.h:3971
virtual PlusStatus InternalStopRecording()
Phidget_MeshMode mode
Definition: phidget22.h:1332
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
RfAcquisitionModeType
Defines RF acquisition mode types (0=B only, 1=RF only, 2=B and RF, 3=ChRF, 4=B and ChRF)
RfAcquisitionModeType RfAcquisitionMode
virtual std::string GetSdkVersion()
#define VTK_OVERRIDE
Definition: PlusCommon.h:49
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
std::map< std::string, bool > ChangedImagingParameters
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual PlusStatus InternalStartRecording()
static vtkPlusUsDevice * New()
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual bool IsTracker() const
VTK interface for video input from Ultrasonix machine.
virtual PlusStatus InternalApplyImagingParameterChange()
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
Abstract interface for ultrasound video devices.