MeshlessBiharmonicMap.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2015-2016 Imperial College London
5  * Copyright 2015-2016 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_MeshlessBiharmonicMap_H
21 #define MIRTK_MeshlessBiharmonicMap_H
22 
23 #include "mirtk/MeshlessHarmonicMap.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Biharmonic map computed using the method of fundamental solutions (MFS)
31  *
32  * Xu et al. (2013). Biharmonic volumetric mapping using fundamental solutions.
33  * IEEE Transactions on Visualization and Computer Graphics, 19(5), 787–798.
34  */
36 {
37  mirtkObjectMacro(MeshlessBiharmonicMap);
38 
39 public:
40 
41  // ---------------------------------------------------------------------------
42  // Auxiliaries
43 
44  /// Biharmonic kernel function
45  ///
46  /// \param[in] d Distance of point to source point.
47  ///
48  /// \returns Biharmonic kernel function value.
49  static double B(double d);
50 
51  // ---------------------------------------------------------------------------
52  // Construction/Destruction
53 
54  /// Default constructor
56 
57  /// Copy constructor
59 
60  /// Assignment operator
62 
63  /// Initialize map after inputs and parameters are set
64  virtual void Initialize();
65 
66  /// Make deep copy of this volumetric map
67  virtual Mapping *NewCopy() const;
68 
69  /// Destructor
70  virtual ~MeshlessBiharmonicMap();
71 
72  // ---------------------------------------------------------------------------
73  // Evaluation
74 
75  // Import other overloads
77 
78  /// Evaluate map at a given point
79  ///
80  /// \param[out] v Map value.
81  /// \param[in] x Coordinate of point along x axis at which to evaluate map.
82  /// \param[in] y Coordinate of point along y axis at which to evaluate map.
83  /// \param[in] z Coordinate of point along z axis at which to evaluate map.
84  ///
85  /// \returns Whether input point is inside map domain.
86  virtual bool Evaluate(double *v, double x, double y, double z = 0) const;
87 
88  /// Evaluate map at a given point
89  ///
90  /// \param[in] x Coordinate of point along x axis at which to evaluate map.
91  /// \param[in] y Coordinate of point along y axis at which to evaluate map.
92  /// \param[in] z Coordinate of point along z axis at which to evaluate map.
93  /// \param[in] l Index of map value component.
94  ///
95  /// \returns The l-th component of the map value evaluated at the given point
96  /// or the \c OutsideValue when input point is outside the map domain.
97  virtual double Evaluate(double x, double y, double z = 0, int l = 0) const;
98 
99 };
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 // Inline definitions
103 ////////////////////////////////////////////////////////////////////////////////
104 
105 // -----------------------------------------------------------------------------
106 inline double MeshlessBiharmonicMap::B(double d)
107 {
108  return d / (8.0 * pi);
109 }
110 
111 
112 } // namespace mirtk
113 
114 #endif // MIRTK_MeshlessBiharmonicMap_H
MeshlessBiharmonicMap()
Default constructor.
virtual bool Evaluate(double *v, double x, double y, double z=0) const =0
MIRTK_Common_EXPORT const double pi
Constant value of .
virtual ~MeshlessBiharmonicMap()
Destructor.
virtual Mapping * NewCopy() const
Make deep copy of this volumetric map.
Definition: IOConfig.h:41
MeshlessBiharmonicMap & operator=(const MeshlessBiharmonicMap &)
Assignment operator.
virtual void Initialize()
Initialize map after inputs and parameters are set.
virtual bool Evaluate(double *v, double x, double y, double z=0) const