AsConformalAsPossibleMapper.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2015-2016 Imperial College London
5  * Copyright 2015-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_AsConformalAsPossibleMapper_H
21 #define MIRTK_AsConformalAsPossibleMapper_H
22 
23 #include "mirtk/LinearTetrahedralMeshMapper.h"
24 
25 #include "mirtk/Array.h"
26 #include "mirtk/Matrix3x3.h"
27 
28 
29 namespace mirtk {
30 
31 
32 /**
33  * Compute as-conformal-as-possible (ACAP) piecewise linear volumetric map
34  *
35  * Paillé & Poulin (2012), As-conformal-as-possible discrete volumetric mapping,
36  * Computers and Graphics, 36(5), 427–433.
37  */
39 {
40  mirtkObjectMacro(AsConformalAsPossibleMapper);
41 
42  // ---------------------------------------------------------------------------
43  // Attributes
44 
45  /// Uniform weight of scale and angle conformality
46  mirtkPublicAttributeMacro(double, UniformWeight);
47 
48  /// Local orientation of tetrahedron (rotation matrix)
49  mirtkAttributeMacro(Array<Matrix3x3>, Orientation);
50 
51  /// Copy attributes of this class from another instance
52  void CopyAttributes(const AsConformalAsPossibleMapper &);
53 
54 public:
55 
56  // ---------------------------------------------------------------------------
57  // Construction/Destruction
58 
59  /// Default constructor
61 
62  /// Copy constructor
64 
65  /// Assignment operator
67 
68  /// Destructor
70 
71  // ---------------------------------------------------------------------------
72  // Exection
73 
74 protected:
75 
76  /// Initialize filter after input and parameters are set
77  void Initialize();
78 
79  /// Finalize filter execution
80  void Finalize();
81 
82  // ---------------------------------------------------------------------------
83  // Auxiliary functions
84 
85  /// Calculate operator weight for given tetrahadron
86  ///
87  /// \param[in] cellId ID of tetrahedron.
88  /// \param[in] v0 First vertex/point of tetrahedron.
89  /// \param[in] v1 Second vertex/point of tetrahedron.
90  /// \param[in] v2 Third vertex/point of tetrahedron.
91  /// \param[in] v3 Fourth vertex/point of tetrahedron.
92  /// \param[in] volume Volume of tetrahedron.
93  ///
94  /// \return Operator weight contribution of tetrahedron.
95  virtual Matrix3x3 GetWeight(vtkIdType cellId,
96  const double v0[3],
97  const double v1[3],
98  const double v2[3],
99  const double v3[3],
100  double volume) const;
101 
102 };
103 
104 
105 } // namespace mirtk
106 
107 #endif // MIRTK_AsConformalAsPossibleMapper_H
void Finalize()
Finalize filter execution.
AsConformalAsPossibleMapper & operator=(const AsConformalAsPossibleMapper &)
Assignment operator.
AsConformalAsPossibleMapper()
Default constructor.
void Initialize()
Initialize filter after input and parameters are set.
Definition: IOConfig.h:41
virtual Matrix3x3 GetWeight(vtkIdType cellId, const double v0[3], const double v1[3], const double v2[3], const double v3[3], double volume) const
virtual ~AsConformalAsPossibleMapper()
Destructor.