FixedBoundarySurfaceMapper.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_FixedBoundarySurfaceMapper_H
21 #define MIRTK_FixedBoundarySurfaceMapper_H
22 
23 #include "mirtk/SurfaceMapper.h"
24 
25 #include "mirtk/PiecewiseLinearMap.h"
26 
27 
28 namespace mirtk {
29 
30 
31 /**
32  * Base class of solvers computing a surface map given a fixed boundary map
33  *
34  * Solvers of this type compute a surface map value for each interior point of
35  * the non-closed input surface mesh given a fixed map value for each point on
36  * at least one of the boundary segments. Additional either weak or hard
37  * constraints at interior points may also be considered.
38  *
39  * \todo Mesh holes formed by those boundaries for which no Dirichlet boundary
40  * conditions are given as suggest in Marchandise et al. (2014)
41  * Optimal parametrizations for surface remeshing. See Figure 9.
42  */
44 {
45  mirtkAbstractMacro(FixedBoundarySurfaceMapper);
46 
47  // ---------------------------------------------------------------------------
48  // Attributes
49 
50  /// Surface boundary map
51  ///
52  /// This discrete mapping must map at least one of the closed surface boundary
53  /// segments and possibly map also individual interior surface points. Whether
54  /// these interior map values are considered as weak constraints, hard constraints,
55  /// or not at all by a surface mapping method depends on the particular subclass
56  /// implementation and respective mapping method. Only map values at boundary
57  /// points are guaranteed to be enforced by subclasses.
58  mirtkPublicAttributeMacro(SharedPtr<PiecewiseLinearMap>, Input);
59 
60  /// Copy attributes of this class from another instance
61  void CopyAttributes(const FixedBoundarySurfaceMapper &);
62 
63  // ---------------------------------------------------------------------------
64  // Construction/Destruction
65 
66 protected:
67 
68  /// Default constructor
70 
71  /// Copy constructor
73 
74  /// Assignment operator
76 
77 public:
78 
79  /// Destructor
81 
82  // ---------------------------------------------------------------------------
83  // Execution
84 
85 protected:
86 
87  /// Initialize filter after input and parameters are set
88  virtual void Initialize();
89 
90 
91  // ---------------------------------------------------------------------------
92  // Auxiliaries
93 
94 protected:
95 
96  /// Number of boundary/surface map components
97  int NumberOfComponents() const;
98 
99 };
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 // Inline definitions
103 ////////////////////////////////////////////////////////////////////////////////
104 
105 // -----------------------------------------------------------------------------
107 {
108  return _Input->NumberOfComponents();
109 }
110 
111 
112 } // namespace mirtk
113 
114 #endif // MIRTK_FixedBoundarySurfaceMapper_H
FixedBoundarySurfaceMapper()
Default constructor.
Definition: IOConfig.h:41
int NumberOfComponents() const
Number of boundary/surface map components.
FixedBoundarySurfaceMapper & operator=(const FixedBoundarySurfaceMapper &)
Assignment operator.
virtual ~FixedBoundarySurfaceMapper()
Destructor.
virtual void Initialize()
Initialize filter after input and parameters are set.