forked from RTKConsortium/PCT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpctThirdOrderPolynomialMLPFunction.h
65 lines (48 loc) · 2.2 KB
/
pctThirdOrderPolynomialMLPFunction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef __pctThirdOrderPolynomialMLPFunction_h
#define __pctThirdOrderPolynomialMLPFunction_h
#include "pctMostLikelyPathFunction.h"
namespace pct
{
/** \class ThirdOrderPolynomialMLPFunction
* \brief Fit a third order polynomial given input and output direction and position.
*
* \ingroup Functions
*/
template <class TCoordRep = double>
class ITK_EXPORT ThirdOrderPolynomialMLPFunction :
public MostLikelyPathFunction<TCoordRep>
{
public:
/** Standard class typedefs. */
typedef ThirdOrderPolynomialMLPFunction Self;
typedef MostLikelyPathFunction<TCoordRep> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Useful defines. */
typedef typename Superclass::VectorType VectorType;
/** Init the mlp parameters from the input and output directions and positions. */
virtual void Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
/** Init with additional parameters to consider tracker uncertainties */
virtual void InitUncertain(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut, double dEntry, double dExit, double m_TrackerResolution, double m_TrackerPairSpacing, double m_MaterialBudget) override;
/** Evaluate the coordinates (x,y) at depth z. */
virtual void Evaluate( const TCoordRep z, TCoordRep &x, TCoordRep&y, TCoordRep &dx, TCoordRep&dy ) override;
// vectorised version:
virtual void Evaluate( std::vector<double> u, std::vector<double> &x, std::vector<double> &y ) override;
protected:
/// Constructor
ThirdOrderPolynomialMLPFunction(){}
/// Destructor
~ThirdOrderPolynomialMLPFunction(){}
private:
ThirdOrderPolynomialMLPFunction( const Self& ); //purposely not implemented
void operator=( const Self& ); //purposely not implemented
// Polynomial parameters in each direction
TCoordRep ax, bx, cx, dx;
TCoordRep ay, by, cy, dy;
TCoordRep zoffset;
};
} // namespace pct
#include "pctThirdOrderPolynomialMLPFunction.txx"
#endif