CurvatureConstraint.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_CurvatureConstraint_H
21 #define MIRTK_CurvatureConstraint_H
22 
23 #include "mirtk/SurfaceConstraint.h"
24 
25 #include "mirtk/List.h"
26 #include "mirtk/Array.h"
27 
28 #include "vtkSmartPointer.h"
29 #include "vtkPoints.h"
30 
31 
32 namespace mirtk {
33 
34 
35 /**
36  * Surface bending / smoothness constraint
37  *
38  * This internal deformable surface force term is similar to the discrete
39  * Laplacian operator also used for iteratively smoothing surfaces (cf. the
40  * "tensile force" used by McInerney & Terzopoulos), but not identical.
41  *
42  * McInerney & Terzopoulos, Topology adaptive deformable surfaces for medical
43  * image volume segmentation. IEEE Transactions on Medical Imaging, 18(10),
44  * 840–850, doi:10.1109/42.811261 (1999)
45  *
46  * Lachaud and Montanvert, Deformable meshes with automated topology changes
47  * for coarse-to-fine three-dimensional surface extraction. Medical Image Analysis,
48  * 3(2), 187–207, doi:10.1016/S1361-8415(99)80012-7 (1999)
49  *
50  * Park et al., A non-self-intersecting adaptive deformable surface for
51  * complex boundary extraction from volumetric images, 25, 421–440 (2001).
52  */
54 {
55  mirtkEnergyTermMacro(CurvatureConstraint, EM_Curvature);
56 
57  // ---------------------------------------------------------------------------
58  // Attributes
59 
60 protected:
61 
62  /// Centroids of adjacent nodes
63  mirtkAttributeMacro(vtkSmartPointer<vtkPoints>, Centroids);
64 
65  /// Copy attributes of this class from another instance
66  void CopyAttributes(const CurvatureConstraint &);
67 
68  // ---------------------------------------------------------------------------
69  // Construction/Destruction
70 
71 public:
72 
73  /// Constructor
74  CurvatureConstraint(const char * = "", double = 1.0);
75 
76  /// Copy constructor
78 
79  /// Assignment operator
81 
82  /// Destructor
83  virtual ~CurvatureConstraint();
84 
85  // ---------------------------------------------------------------------------
86  // Evaluation
87 
88  /// Initialize internal force term
89  virtual void Initialize();
90 
91  /// Reinitialize internal force term after change of input topology
92  virtual void Reinitialize();
93 
94  /// Update internal force data structures
95  virtual void Update(bool);
96 
97 protected:
98 
99  /// Common (re-)initialization code of this class only (non-virtual function!)
100  void Init();
101 
102  /// Compute penalty for current transformation estimate
103  virtual double Evaluate();
104 
105  /// Compute internal force w.r.t. transformation parameters
106  virtual void EvaluateGradient(double *, double, double);
107 
108 };
109 
110 
111 } // namespace mirtk
112 
113 #endif // MIRTK_CurvatureConstraint_H
void CopyAttributes(const CurvatureConstraint &)
Copy attributes of this class from another instance.
virtual void EvaluateGradient(double *, double, double)
Compute internal force w.r.t. transformation parameters.
virtual double Evaluate()
Compute penalty for current transformation estimate.
CurvatureConstraint & operator=(const CurvatureConstraint &)
Assignment operator.
virtual void Update(bool)
Update internal force data structures.
mirtkAttributeMacro(vtkSmartPointer< vtkPoints >, Centroids)
Centroids of adjacent nodes.
CurvatureConstraint(const char *="", double=1.0)
Constructor.
Definition: IOConfig.h:41
Minimize curvature of point set surface.
Definition: EnergyMeasure.h:82
virtual void Initialize()
Initialize internal force term.
virtual ~CurvatureConstraint()
Destructor.
virtual void Reinitialize()
Reinitialize internal force term after change of input topology.
void Init()
Common (re-)initialization code of this class only (non-virtual function!)