NearOptimalIntrinsicSurfaceMapper.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_NearOptimalIntrinsicSurfaceMapper_H
21 #define MIRTK_NearOptimalIntrinsicSurfaceMapper_H
22 
23 #include "mirtk/IntrinsicSurfaceMapper.h"
24 
25 #include "vtkSmartPointer.h"
26 #include "vtkDataArray.h"
27 
28 
29 namespace mirtk {
30 
31 
32 /**
33  * Base class of filters that compute a near-optimal intrinsic surface map
34  *
35  * Surface map filters of this type find the optimal affine combination weights
36  * of independently computed conformal and authalic surface maps with given fixed
37  * boundary values which minimize a certain non-linear distortion criterion.
38  *
39  * - Desbrun, Meyer, and Alliez (2002). Intrinsic parameterizations of surface meshes.
40  * Computer Graphics Forum, 21(3), 209–218.
41  */
43 {
44  mirtkAbstractMacro(NearOptimalIntrinsicSurfaceMapper);
45 
46  // ---------------------------------------------------------------------------
47  // Attributes
48 
49  /// Copy attributes of this class from another instance
50  void CopyAttributes(const NearOptimalIntrinsicSurfaceMapper &);
51 
52  // ---------------------------------------------------------------------------
53  // Construction/Destruction
54 
55 protected:
56 
57  /// Default constructor
59 
60  /// Copy constructor
62 
63  /// Assignment operator
65 
66 public:
67 
68  /// Destructor
70 
71  // ---------------------------------------------------------------------------
72  // Execution
73 
74  /// Compute map values at interior points
75  virtual void ComputeMap();
76 
77 protected:
78 
79  /// Compute affine combination weight that minimizes a given distortion measure
80  ///
81  /// \param[in] u0 Discrete authalic surface map values, i.e., lambda=0.
82  /// \param[in] u1 Discrete conformal surface map values, i.e., lambda=1.
83  ///
84  /// \returns Affine combination weight \f$\lambda\f$, where final surface map values
85  /// are computed as \f$\lambda u1 + (1 - \lambda) * u0\f$.
86  virtual double ComputeLambda(vtkDataArray *u0, vtkDataArray *u1) const = 0;
87 
88  /// Determine scale of surface mesh
89  double Scale(vtkPolyData *) const;
90 
91  /// Determine scale of intrinsic parameterization
92  double Scale(vtkDataArray *, vtkDataArray * = nullptr) const;
93 
94 };
95 
96 
97 } // namespace mirtk
98 
99 #endif // MIRTK_NearOptimalIntrinsicSurfaceMapper_H
NearOptimalIntrinsicSurfaceMapper()
Default constructor.
virtual void ComputeMap()
Compute map values at interior points.
double Scale(vtkPolyData *) const
Determine scale of surface mesh.
virtual ~NearOptimalIntrinsicSurfaceMapper()
Destructor.
Definition: IOConfig.h:41
NearOptimalIntrinsicSurfaceMapper & operator=(const NearOptimalIntrinsicSurfaceMapper &)
Assignment operator.
virtual double ComputeLambda(vtkDataArray *u0, vtkDataArray *u1) const =0