MeanCurvatureConstraint.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2016 Imperial College London
5  * Copyright 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_MeanCurvatureConstraint_H
21 #define MIRTK_MeanCurvatureConstraint_H
22 
23 #include "mirtk/SurfaceConstraint.h"
24 
25 #include "vtkSmartPointer.h"
26 #include "vtkDataArray.h"
27 
28 
29 namespace mirtk {
30 
31 
32 /**
33  * Mean curvature smoothness term
34  */
36 {
37  mirtkEnergyTermMacro(MeanCurvatureConstraint, EM_MeanCurvature);
38 
39  // ---------------------------------------------------------------------------
40  // Attributes
41 
42  /// Maximum absolute mean curvature
43  mirtkAttributeMacro(double, MaxMeanCurvature);
44 
45  /// Copy attributes of this class from another instance
46  void CopyAttributes(const MeanCurvatureConstraint &);
47 
48  // ---------------------------------------------------------------------------
49  // Construction/Destruction
50 
51 public:
52 
53  /// Constructor
54  MeanCurvatureConstraint(const char * = "", double = 1.0);
55 
56  /// Copy constructor
58 
59  /// Assignment operator
61 
62  /// Destructor
63  virtual ~MeanCurvatureConstraint();
64 
65  // ---------------------------------------------------------------------------
66  // Evaluation
67 
68  /// Initialize force term once input and parameters have been set
69  virtual void Initialize();
70 
71  /// Update internal force data structures
72  virtual void Update(bool);
73 
74 protected:
75 
76  /// Evaluate energy of internal force term
77  virtual double Evaluate();
78 
79  /// Evaluate internal force w.r.t. transformation parameters or surface nodes
80  virtual void EvaluateGradient(double *, double, double);
81 
82 };
83 
84 
85 } // namespace mirtk
86 
87 #endif // MIRTK_MeanCurvatureConstraint_H
virtual void Update(bool)
Update internal force data structures.
MeanCurvatureConstraint(const char *="", double=1.0)
Constructor.
MeanCurvatureConstraint & operator=(const MeanCurvatureConstraint &)
Assignment operator.
virtual void Initialize()
Initialize force term once input and parameters have been set.
virtual void EvaluateGradient(double *, double, double)
Evaluate internal force w.r.t. transformation parameters or surface nodes.
Definition: IOConfig.h:41
virtual ~MeanCurvatureConstraint()
Destructor.
Mean curvature constraint.
Definition: EnergyMeasure.h:85
virtual double Evaluate()
Evaluate energy of internal force term.