UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-05-20)
usNeedleModelPolynomial.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Author:
29  * Jason Chevrie
30  *
31  *****************************************************************************/
32 
33 #ifndef __usNeedleModelPolynomial_h_
34 #define __usNeedleModelPolynomial_h_
35 
36 #include <iostream>
37 
38 #include <visp3/core/vpColVector.h>
39 
40 #include <visp3/ustk_core/usPolynomialCurve3D.h>
41 #include <visp3/ustk_needle_modeling/usNeedleModelBaseTip.h>
42 
44 {
45 public:
46  enum class NeedlePreset : int {
47  BiopsyNeedle,
48  BiopsyCannula,
49  AbayazidRRM13,
50  MisraRSRO10_PlastisolA,
51  RoesthuisAM12,
52  SteelSoftTissue
53  };
54 
55 protected:
57 
61 
62 public:
64 
67  virtual ~usNeedleModelPolynomial();
69 
70  virtual usNeedleModelPolynomial *clone() const { return new usNeedleModelPolynomial(*this); } // Polymorph copy method
71 
73 
74  void loadPreset(const NeedlePreset preset);
75 
77 
79 
80  void setOuterDiameter(double diameter);
81  double getOuterDiameter() const;
82 
83  void setInsideDiameter(double diameter);
84  double getInsideDiameter() const;
85 
86  void setNeedleYoungModulus(double E);
87  double getNeedleYoungModulus() const;
88 
89  double getEI() const;
90 
92 
93  void init();
94 
96 
98 
99  vpColVector getNeedlePoint(double l) const;
100  vpColVector getNeedleDirection(double l) const;
101  double getDistanceFromPoint(const vpColVector &P, double start = 0, double stop = -1, double threshold = 1e-5) const;
102 
104 
105  double getBendingEnergy() const;
106 
108 
109  vpColVector getBaseStaticTorsor() const;
110 
112 
113  double getCurvatureFromNeedleShape(double start, double end, vpColVector &center3D, vpColVector &direction3D) const;
114 
116 
118  friend VISP_EXPORT std::ostream &operator<<(std::ostream &s, const usNeedleModelPolynomial &needle);
119  friend VISP_EXPORT std::istream &operator>>(std::istream &s, usNeedleModelPolynomial &needle);
121  friend VISP_EXPORT std::ostream &operator<<=(std::ostream &s, const usNeedleModelPolynomial &needle);
122  friend VISP_EXPORT std::istream &operator>>=(std::istream &s, usNeedleModelPolynomial &needle);
123 };
124 
125 VISP_EXPORT std::ostream &operator<<(std::ostream &s, const usNeedleModelPolynomial &needle);
126 VISP_EXPORT std::istream &operator>>(std::istream &s, usNeedleModelPolynomial &needle);
127 
128 VISP_EXPORT std::ostream &operator<<=(std::ostream &s, const usNeedleModelPolynomial &needle);
129 VISP_EXPORT std::istream &operator>>=(std::istream &s, usNeedleModelPolynomial &needle);
130 
131 #endif // __usNeedleModelPolynomial_h
friend VISP_EXPORT std::ostream & operator<<=(std::ostream &s, const usNeedleModelBaseTip &needle)
Binary.
friend VISP_EXPORT std::istream & operator>>=(std::istream &s, usNeedleModelBaseTip &needle)
friend VISP_EXPORT std::ostream & operator<<(std::ostream &s, const usNeedleModelBaseTip &needle)
Data saving.
friend VISP_EXPORT std::istream & operator>>(std::istream &s, usNeedleModelBaseTip &needle)
virtual usNeedleModelBaseTip & operator=(const usNeedleModelBaseTip &needle)
virtual usNeedleModelPolynomial * clone() const
double m_outerDiameter
Needle parameters.