EulerMethodWithDamping.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2015 Imperial College London
5  * Copyright 2013-2015 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_EulerMethodWithDamping_H
21 #define MIRTK_EulerMethodWithDamping_H
22 
23 #include "mirtk/EulerMethod.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Minimizes deformable surface model using Euler's method with momentum
31  *
32  * This method has for example been used in the following paper on which this
33  * implementation is also based on:
34  *
35  * Park et al. (2001), A non-self-intersecting adaptive deformable surface for
36  * complex boundary extraction from volumetric images,
37  * Computer & Graphics, 25, 421–440
38  *
39  * Another variant of an Euler method with momentum used by the FreeSurfer tools
40  * is implemented by EulerMethodWithMomentum.
41  */
43 {
45 
46  // ---------------------------------------------------------------------------
47  // Attributes
48 
49  /// Common mass of all nodes
50  mirtkPublicAttributeMacro(double, BodyMass);
51 
52  /// Damping coefficient
53  mirtkPublicAttributeMacro(double, DampingFactor);
54 
55  /// Copy attributes of this class from another instance
56  void CopyAttributes(const EulerMethodWithDamping &);
57 
58  // ---------------------------------------------------------------------------
59  // Construction/Destruction
60 public:
61 
62  /// Constructor
64 
65  /// Copy constructor
67 
68  /// Assignment operator
70 
71  /// Destructor
72  virtual ~EulerMethodWithDamping();
73 
74  // ---------------------------------------------------------------------------
75  // Parameters
77 
78  /// Set parameter value from string
79  virtual bool Set(const char *, const char *);
80 
81  /// Get parameters as key/value as string map
82  virtual ParameterList Parameter() const;
83 
84  // ---------------------------------------------------------------------------
85  // Execution
86 
87  /// Initialize optimization
88  ///
89  /// This member funtion is implicitly called by Run.
90  virtual void Initialize();
91 
92  /// Update node displacements
93  virtual void UpdateDisplacement();
94 
95 };
96 
97 
98 } // namespace mirtk
99 
100 #endif // MIRTK_EulerMethodWithDamping_H
EulerMethodWithDamping & operator=(const EulerMethodWithDamping &)
Assignment operator.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
Definition: Object.h:38
virtual ParameterList Parameter() const
Get parameters as key/value as string map.
virtual bool Set(const char *, const char *)
Set parameter value from string.
Definition: IOConfig.h:41
virtual ~EulerMethodWithDamping()
Destructor.
EulerMethodWithDamping(ObjectiveFunction *=NULL)
Constructor.
virtual ParameterList Parameter() const
Get parameters as key/value as string map.
Explicit Euler method with momentum for deformable surface models.
virtual void UpdateDisplacement()
Update node displacements.