PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusFidPatternRecognitionCommon.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 _FIDUCIAL_ALGORITHM_COMMON_H
8 #define _FIDUCIAL_ALGORITHM_COMMON_H
9 
10 #include "vtkPlusCalibrationExport.h"
11 
12 #include <vector>
13 #include <string>
14 
22 class vtkPlusCalibrationExport PlusFidDot
23 {
24 public:
26  static bool IntensityLessThan(const PlusFidDot& dot1, const PlusFidDot& dot2);
27 
29  static bool PositionLessThan(std::vector<PlusFidDot>::iterator b1, std::vector<PlusFidDot>::iterator b2);
30 
32  void SetX(double value);
33 
35  double GetX() const;
36 
38  void SetY(double value);
39 
41  double GetY() const;
42 
44  void SetDotIntensity(double value);
45 
47  double GetDotIntensity() const;
48 
50  double GetDistanceFrom(PlusFidDot& d);
51 
53  bool operator== (const PlusFidDot& data) const;
54 
55 protected:
56  double m_X;
57  double m_Y;
59 };
60 
61 //-----------------------------------------------------------------------------
69 class vtkPlusCalibrationExport PlusFidLine
70 {
71 public:
73  static bool lessThan(const PlusFidLine& line1, const PlusFidLine& line2);
74 
76  static bool compareLines(const PlusFidLine& line1, const PlusFidLine& line2);
77 
79  static double ComputeAngleRad(const PlusFidLine& line1);
80 
82  static double ComputeAngleRad(const PlusFidLine& line1, const PlusFidLine& line2);
83 
88  void SetPoint(int aIndex, int aValue);
89 
91  int GetPoint(int aIndex) const;
92 
94  unsigned int GetNumberOfPoints() const;
95 
97  void SetIntensity(double value);
98 
100  double GetIntensity() const;
101 
103  void SetLength(double value);
104 
106  double GetLength() const { return Length; };
107 
109  void SetDirectionVector(int aIndex, double aValue);
110 
112  const double* GetDirectionVector() const;
113 
115  void SetStartPointIndex(int index);
116 
118  int GetStartPointIndex() const;
119 
121  void SetEndPointIndex(int index);
122 
124  int GetEndPointIndex() const;
125 
127  void ResizePoints(int aNewSize);
128 
130  void AddPoint(int aPoint);
131 
132 protected:
134  std::vector<int> Points;
135  double Intensity;
136  double Length;
137  double DirectionVector[2];
142 };
143 
144 //-----------------------------------------------------------------------------
150 class vtkPlusCalibrationExport PlusFidWire
151 {
152 public:
153  void SetName(const std::string& aName);
154  std::string GetName() const;
155 
156  double EndPointFront[3];
157  double EndPointBack[3];
158 
159 protected:
160  std::string Name;
161 };
162 
163 //-----------------------------------------------------------------------------
171 class vtkPlusCalibrationExport PlusFidPattern
172 {
173 public:
174  virtual ~PlusFidPattern();
175 
176  const std::vector<PlusFidWire>& GetWires() const;
177  const std::vector<double>& GetDistanceToOriginMm() const;
178  const std::vector<double>& GetDistanceToOriginToleranceMm() const;
179 
180  void AddWire(const PlusFidWire& wire);
181  void AddDistanceToOriginElementMm(double aElement);
182  void SetDistanceToOriginElementMm(int index, double aElement);
183  void AddDistanceToOriginToleranceElementMm(double aElement);
184  void SetDistanceToOriginToleranceElementMm(int index, double aElement);
185 
186 protected:
187  std::vector<PlusFidWire> Wires;
189  std::vector<double> DistanceToOriginMm;
191  std::vector<double> DistanceToOriginToleranceMm;
192 };
193 
194 //-----------------------------------------------------------------------------
201 class vtkPlusCalibrationExport PlusNWire : public PlusFidPattern
202 {
203 public:
204  virtual ~PlusNWire();
205 
206  double IntersectPosW12[3];
207  double IntersectPosW32[3];
208 };
209 
210 //-----------------------------------------------------------------------------
217 class vtkPlusCalibrationExport PlusCoplanarParallelWires : public PlusFidPattern
218 {
219 public:
220  virtual ~PlusCoplanarParallelWires();
221 };
222 
223 //-----------------------------------------------------------------------------
229 class vtkPlusCalibrationExport PlusPatternRecognitionResult
230 {
231 public:
233 
235  void Clear();
236 
238  void SetDotsFound(bool value);
239 
241  bool GetDotsFound();
242 
244  void SetFoundDotsCoordinateValue(std::vector< std::vector<double> > value);
245 
247  std::vector< std::vector<double> >& GetFoundDotsCoordinateValue();
248 
250  void SetIntensity(double value) { Intensity = value; };
251 
253  double GetIntensity() const { return Intensity; };
254 
256  void SetNumDots(double value) { NumDots = value; };
257 
259  double GetNumDots() const { return NumDots; };
260 
262  void SetCandidateFidValues(std::vector<PlusFidDot> value);
263 
265  const std::vector<PlusFidDot>& GetCandidateFidValues() const;
266 
267 protected:
269  std::vector< std::vector<double> > FoundDotsCoordinateValue;
270 
272  std::vector<PlusFidDot> CandidateFidValues;
273 
275  bool DotsFound;
276 
281  double Intensity;
282 
284  double NumDots;
285 };
286 
287 #endif //_FIDUCIAL_ALGORITHM_COMMON_H
std::vector< std::vector< double > > FoundDotsCoordinateValue
const uint32_t * data
Definition: phidget22.h:3971
std::vector< double > DistanceToOriginToleranceMm
These tolerances are in mm.
std::vector< PlusFidWire > Wires
std::vector< double > DistanceToOriginMm
These distances are in mm.
int StartPointIndex
index of start point of the line, all the other line points are towards the positive m_DirectionVecto...
int EndPointIndex
Index of the endpoint of the line.
const char const char * value
Definition: phidget22.h:5111