PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
PlusFidLineFinder.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_LINE_FINDER_H
8 #define _FIDUCIAL_LINE_FINDER_H
9 
11 #include "PlusConfigure.h"
12 
13 class vtkXMLDataElement;
14 
23 class vtkPlusCalibrationExport PlusFidLineFinder
24 {
25 public:
27  virtual ~PlusFidLineFinder();
28 
30  void SetFrameSize(const FrameSizeType& frameSize);
31 
33  void SetCandidateFidValues(const std::vector<PlusFidDot>& value) { m_CandidateFidValues = value; };
34 
36  void SetDotsVector(const std::vector<PlusFidDot>& value) { m_DotsVector = value; };
37 
39  void SetPatterns(const std::vector<PlusFidPattern*>& value) { m_Patterns = value; };
40 
42  void SetApproximateSpacingMmPerPixel(double value) { m_ApproximateSpacingMmPerPixel = value; };
43 
45  void SetMinThetaDegrees(double angleDeg);
46 
48  void SetMaxThetaDegrees(double angleDeg);
49 
51  void SetCollinearPointsMaxDistanceFromLineMm(double value) { m_CollinearPointsMaxDistanceFromLineMm = value; };
52 
54  PlusStatus ReadConfiguration(vtkXMLDataElement* rootConfigElement);
55 
57  void FindLines();
58 
60  std::vector<std::vector<PlusFidLine>>& GetLinesVector();
61 
63  double GetMaxThetaRad() { return m_MaxThetaRad; };
64 
66  double GetMinThetaRad() { return m_MinThetaRad; };
67 
69  std::vector<PlusFidPattern*>& GetPatterns() { return m_Patterns; };
70 
72  std::vector<PlusNWire> GetNWires();
73 
74  void SetImageToPhantomTransform(double* matrixElements);
75 
77  void Clear();
78 
79 protected:
82  void ComputeParameters();
83 
85  void FindLinesNPoints();
86 
88  void FindLines2Points();
89 
91  static double SegmentLength(const PlusFidDot& dot1, const PlusFidDot& dot2);
92 
94  double ComputeDistancePointLine(const PlusFidDot& dot, const PlusFidLine& line);
95 
98  void ComputeLine(PlusFidLine& line);
99 
101  static double ComputeAngleRad(const PlusFidDot& dot1, const PlusFidDot& dot2);
102 
104  bool AcceptLine(PlusFidLine& line);
105 
107  bool AcceptAngleRad(double angleRad);
108 
109  //Accessors and mutators
110 
113  double* GetImageNormalVectorInPhantomFrameMaximumRotationAngleDeg() { return m_ImageNormalVectorInPhantomFrameMaximumRotationAngleDeg; };
114  void SetImageNormalVectorInPhantomFrameMaximumRotationAngleDeg(double* anglesDeg);
115 
117  double* GetImageToPhantomTransform() { return m_ImageToPhantomTransform; };
118 
119 protected:
120  FrameSizeType m_FrameSize;
122  double m_ImageNormalVectorInPhantomFrameMaximumRotationAngleDeg[6];
123  double m_ImageToPhantomTransform[16];
124 
125  // line length and line pair distance errors in percent - read from phantom definition
130 
131  std::vector<PlusFidDot> m_CandidateFidValues; // pointer to the fiducial candidates coordinates
132 
133  std::vector<PlusFidDot> m_DotsVector;
134  std::vector< std::vector<PlusFidLine> > m_LinesVector;
135 
136  std::vector<PlusFidPattern*> m_Patterns;
137 };
138 
139 #endif // _FIDUCIAL_LINE_FINDER_H
double m_MaxLinePairDistanceErrorPercent
double m_CollinearPointsMaxDistanceFromLineMm
const char int line
Definition: phidget22.h:2458
std::vector< PlusFidPattern * > & GetPatterns()
double m_ApproximateSpacingMmPerPixel
igsioStatus PlusStatus
Definition: PlusCommon.h:40
void SetPatterns(const std::vector< PlusFidPattern * > &value)
std::vector< PlusFidDot > m_CandidateFidValues
void SetCandidateFidValues(const std::vector< PlusFidDot > &value)
void SetDotsVector(const std::vector< PlusFidDot > &value)
const char const char * value
Definition: phidget22.h:5111
std::vector< PlusFidPattern * > m_Patterns
double * GetImageNormalVectorInPhantomFrameMaximumRotationAngleDeg()
void SetApproximateSpacingMmPerPixel(double value)
void SetCollinearPointsMaxDistanceFromLineMm(double value)
std::vector< PlusFidDot > m_DotsVector
std::vector< std::vector< PlusFidLine > > m_LinesVector