-
Notifications
You must be signed in to change notification settings - Fork 6
/
pctMostLikelyPathFunction.h
88 lines (70 loc) · 2.82 KB
/
pctMostLikelyPathFunction.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef __pctMostLikelyPathFunction_h
#define __pctMostLikelyPathFunction_h
#include <itkNumericTraits.h>
#include <vector>
#include <itkImageBase.h>
//#define MLP_TIMING
#ifdef MLP_TIMING
# include <itkTimeProbe.h>
#endif
namespace pct
{
/** \class MostLikelyPathFunction
* \brief Base class for computing the most likely path of a proton.
*
* \ingroup Functions
*/
template <class TCoordRep = double>
class ITK_EXPORT MostLikelyPathFunction :
public itk::LightObject
{
public:
/** Standard class typedefs. */
typedef MostLikelyPathFunction Self;
typedef itk::LightObject Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Useful defines. */
typedef itk::Vector<TCoordRep, 3> 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)
{
itkGenericExceptionMacro("This version of the Init method not implemented for derived class.");
}
/** Init the mlp parameters from the input and output directions and positions, and energies. */
virtual void Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut, double eIn, double eOut)
{
itkGenericExceptionMacro("This version of the Init method not implemented for derived class.");
}
/** 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)
{
itkGenericExceptionMacro("Not implemented in the derived class.");
}
/** Evaluate the coordinates (x,y) at depth z. */
virtual void Evaluate( const TCoordRep z, TCoordRep &x, TCoordRep&y, TCoordRep &dx, TCoordRep&dy )
{
itkGenericExceptionMacro("Not implemented in the derived class.");
}
/** Vectorised version of the above method. Implement dummy in derived class if not applicable for the type of MLP */
// NK: maybe explicit <double> should be replaced with <TCoordRep>
virtual void Evaluate( std::vector<double> u, std::vector<double> &x, std::vector<double> &y )
{
itkGenericExceptionMacro("Not implemented in the derived class.");
}
bool m_CanBeVectorised = false;
#ifdef MLP_TIMING
/** Print timing information */
virtual void PrintTiming(std::ostream& os){}
#endif
protected:
/// Constructor
MostLikelyPathFunction(){}
/// Destructor
~MostLikelyPathFunction(){}
private:
MostLikelyPathFunction( const Self& ); //purposely not implemented
void operator=( const Self& ); //purposely not implemented
};
} // namespace pct
#endif