ExternalForce.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_ExternalForce_H
21 #define MIRTK_ExternalForce_H
22 
23 #include "mirtk/PointSetForce.h"
24 
25 #include "mirtk/ExternalForceTerm.h"
26 #include "mirtk/RegisteredImage.h"
27 
28 
29 namespace mirtk {
30 
31 
32 /**
33  * Base class for external point set force terms
34  *
35  * Subclasses implement in particular external forces for deformable surface
36  * models such as inflation/balloon forces and intensity edge forces.
37  */
39 {
40  mirtkAbstractMacro(ExternalForce);
41 
42  // ---------------------------------------------------------------------------
43  // Types
44 public:
45 
46  /// Type of input image voxel values
48 
49  /// Non-abstract base type of input image
51 
52  // ---------------------------------------------------------------------------
53  // Attributes
54 private:
55 
56  /// (Transformed) reference image
57  mirtkPublicAggregateMacro(RegisteredImage, Image);
58 
59  // ---------------------------------------------------------------------------
60  // Construction/Destruction
61 protected:
62 
63  /// Constructor
64  ExternalForce(const char * = "", double = 1.0);
65 
66  /// Copy constructor
68 
69  /// Assignment operator
71 
72  /// Copy attributes of this class from another instance
73  void CopyAttributes(const ExternalForce &);
74 
75 public:
76 
77  /// Instantiate specified external force
78  static ExternalForce *New(ExternalForceTerm, const char * = "", double = 1.0);
79 
80  /// Destructor
81  virtual ~ExternalForce();
82 
83  // ---------------------------------------------------------------------------
84  // Initialization
85 public:
86 
87  /// Initialize external force once input and parameters have been set
88  virtual void Initialize();
89 
90  // ---------------------------------------------------------------------------
91  // Evaluation
92 
93  /// Update moving input points and internal state of external force term
94  virtual void Update(bool = true);
95 
96 protected:
97 
98  /// Evaluate external force term
99  virtual double Evaluate();
100 
101 };
102 
103 
104 } // namespace mirtk
105 
106 #endif // MIRTK_ExternalForce_H
virtual ~ExternalForce()
Destructor.
static ExternalForce * New(ExternalForceTerm, const char *="", double=1.0)
Instantiate specified external force.
void CopyAttributes(const ExternalForce &)
Copy attributes of this class from another instance.
ExternalForce(const char *="", double=1.0)
Constructor.
GenericImage< VoxelType > ImageType
Non-abstract base type of input image.
Definition: ExternalForce.h:50
Definition: IOConfig.h:41
ExternalForce & operator=(const ExternalForce &)
Assignment operator.
double VoxelType
Definition: BaseImage.h:770
virtual double Evaluate()
Evaluate external force term.
RegisteredImage::VoxelType VoxelType
Type of input image voxel values.
Definition: ExternalForce.h:47
virtual void Initialize()
Initialize external force once input and parameters have been set.
virtual void Update(bool=true)
Update moving input points and internal state of external force term.