PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusAgilentScopeTracker.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 __vtkPlusAgilentScopeTracker_h
8 #define __vtkPlusAgilentScopeTracker_h
9 
10 #include "vtkPlusDataCollectionExport.h"
11 #include "vtkPlusDevice.h"
12 
13 // Agilent type includes
14 #include <AgMD1FundamentalDataTypes.h>
15 #include <vpptype.h>
16 
17 // VTK includes
18 #include <vtkSmartPointer.h>
19 
20 class vtkMatrix;
21 
22 class vtkDoubleArray;
23 class vtkPlot;
24 class vtkView;
25 class vtkChartXY;
26 class vtkContextView;
27 
35 class vtkPlusDataCollectionExport vtkPlusAgilentScopeTracker : public vtkPlusDevice
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
42  virtual bool IsTracker() const { return true; }
43 
47  PlusStatus Probe();
48 
51 
53  virtual PlusStatus ReadConfiguration(vtkXMLDataElement* config);
54 
56  virtual PlusStatus WriteConfiguration(vtkXMLDataElement* config);
57 
59  virtual PlusStatus NotifyConfigured();
60 
61  vtkSetMacro(SampleFrequencyHz, ViReal64);
62  vtkGetMacro(SampleFrequencyHz, ViReal64);
63 
64  vtkSetMacro(DelayTimeSec, ViReal64);
65  vtkGetMacro(DelayTimeSec, ViReal64);
66 
67  vtkSetMacro(SampleCountPerAcquisition, ViInt32);
68  vtkGetMacro(SampleCountPerAcquisition, ViInt32);
69 
70  vtkSetMacro(FullScale, ViReal64);
71  vtkGetMacro(FullScale, ViReal64);
72 
73  vtkSetMacro(Offset, ViReal64);
74  vtkGetMacro(Offset, ViReal64);
75 
76  vtkSetMacro(Bandwidth, ViInt32);
77  vtkGetMacro(Bandwidth, ViInt32);
78 
79  vtkSetMacro(TrigCoupling, ViInt32);
80  vtkGetMacro(TrigCoupling, ViInt32);
81 
82  vtkSetMacro(Slope, ViInt32);
83  vtkGetMacro(Slope, ViInt32);
84 
85  vtkSetMacro(Level, ViReal64);
86  vtkGetMacro(Level, ViReal64);
87 
88  vtkSetMacro(SpeedOfSound, ViInt32);
89  vtkGetMacro(SpeedOfSound, ViInt32);
90 
91  vtkSetMacro(KernelSize, ViInt32);
92  vtkGetMacro(KernelSize, ViInt32);
93 
94  vtkSetMacro(MinPeakDistance, ViInt32);
95  vtkGetMacro(MinPeakDistance, ViInt32);
96 
97 protected:
99  virtual ~vtkPlusAgilentScopeTracker();
100 
102  virtual PlusStatus InternalConnect();
104  virtual PlusStatus InternalDisconnect();
105 
107  unsigned long LastFrameNumber;
108 
109  // Agilent scope details
111  ViStatus Status;
112  ViChar ResourceName[16]; // Resource string
113  ViChar OptionString[32]; // No options necessary
114  ViSession InstrumentID; // Instrument handle
115 
116  // Configuration parameters
117  ViInt32 SpeedOfSound; // m/s
120  ViReal64 DelayTimeSec;
122  ViInt32 SegmentCountPerAcquisition; // Currently fixed to 1, as we only support single segment acquisition
123  ViReal64 FullScale;
124  ViReal64 Offset;
125  ViInt32 Coupling; // Currently fixed to 3
126  ViInt32 Bandwidth;
127  ViInt32 TrigCoupling;
128  ViInt32 Slope;
129  ViReal64 Level; // In % of vertical full scale when using internal trigger
131 
132  vtkSmartPointer<vtkMatrix4x4> FirstPeakToNeedleTip;
133  vtkSmartPointer<vtkMatrix4x4> SecondPeakToNeedleTip;
134  vtkSmartPointer<vtkMatrix4x4> ThirdPeakToNeedleTip;
135 
136  // 1D signal is packaged into an image with data type int16
137  vtkSmartPointer<vtkImageData> SignalImage;
138 
139  // Data reading members
140  AqReadParameters ReadParameters;
141  AqDataDescriptor DataDescription;
142  AqSegmentDescriptor SegmentDescription;
143 
144  // Data buffer for data that is read
145  ViInt16* DataArray;
146  ViInt16* EnvelopeArray;
147 
148  // Envelope detection via a moving average filter
149  ViReal64* HannWindow;
150  ViInt32 KernelSize; // an odd integer
151 
152  // Peak detection
153  ViInt32* PeakIdxArray;
154  std::vector<std::pair<ViInt16, ViInt32>> PeakEntries;
155 
156 private:
158  void operator=(const vtkPlusAgilentScopeTracker&);
159 };
160 
161 #endif
virtual void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
unsigned long LastFrameNumber
Index of the last frame number.
Abstract interface for tracker and video devices.
Definition: vtkPlusDevice.h:60
vtkSmartPointer< vtkMatrix4x4 > FirstPeakToNeedleTip
vtkSmartPointer< vtkImageData > SignalImage
virtual PlusStatus InternalConnect()
igsioStatus PlusStatus
Definition: PlusCommon.h:40
Interface class for Agilent oscilloscope devices.
std::vector< std::pair< ViInt16, ViInt32 > > PeakEntries
virtual PlusStatus Probe()
virtual PlusStatus ReadConfiguration(vtkXMLDataElement *)
virtual PlusStatus WriteConfiguration(vtkXMLDataElement *)
vtkSmartPointer< vtkMatrix4x4 > SecondPeakToNeedleTip
virtual PlusStatus NotifyConfigured()
virtual PlusStatus InternalDisconnect()
vtkSmartPointer< vtkMatrix4x4 > ThirdPeakToNeedleTip
virtual PlusStatus InternalUpdate()
static vtkPlusDevice * New()