RobustPointMatch.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_RobustPointMatch_H
21 #define MIRTK_RobustPointMatch_H
22 
23 #include "mirtk/FuzzyCorrespondence.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Robust point match (RPM) correspondences
31  *
32  * The point correspondences returned by an instance of this class correspond
33  * to the cluster centers of the Robust Point Matching (RPM) algorithm of
34  *
35  * Chui and Rangarajan, "A new point matching algorithm for non-rigid registration",
36  * Computer Vision and Image Understanding, 89(2-3), pp. 114–141, 2003.
37  *
38  * where the smoothness regularization term is separate. Therefore, the weight
39  * of the smoothness term is not directly coupled to the annealing temperature
40  * used by this class, unlike the original RPM proposal.
41  *
42  * \sa FiducialRegistrationError
43  */
45 {
46  mirtkObjectMacro(RobustPointMatch);
47 
48  // ---------------------------------------------------------------------------
49  // Attributes
50 
51  /// Initial temperature of the deterministic annealing process
52  mirtkPublicAttributeMacro(double, InitialTemperature);
53 
54  /// Annealing rate by which the temperature is multiplied or number of NN
55  ///
56  /// If set to a negative value, the average mean distance to the
57  /// corresponding number of nearest neighbors is used as next temperature.
58  mirtkPublicAttributeMacro(double, AnnealingRate);
59 
60  /// Final temperature which stops the deterministic annealing process
61  mirtkPublicAttributeMacro(double, FinalTemperature);
62 
63  /// Current temperature of the deterministic annealing process
64  mirtkPublicAttributeMacro(double, Temperature);
65 
66  /// Variance of extra features (resp. of their differences)
67  mirtkPublicAttributeMacro(double, VarianceOfFeatures);
68 
69  /// Cluster for outliers in target (i.e., centroid of source points!)
70  mirtkReadOnlyAttributeMacro(Point, TargetOutlierCluster);
71 
72  /// Cluster for outliers in source (i.e., centroid of target points!)
73  mirtkReadOnlyAttributeMacro(Point, SourceOutlierCluster);
74 
75  // ---------------------------------------------------------------------------
76  // Construction/Destruction
77 public:
78 
79  /// Default constructor
81 
82  /// Construct correspondence map and initialize it
84  const RegisteredPointSet *);
85 
86  /// Copy constructor
88 
89  /// Copy construct a new instance
90  virtual PointCorrespondence *NewInstance() const;
91 
92  /// Destructor
93  virtual ~RobustPointMatch();
94 
95  /// Type enumeration value
96  virtual TypeId Type() const;
97 
98  // ---------------------------------------------------------------------------
99  // Parameters
100 
101  // Import other overloads
103 
104  /// Set parameter value from string
105  virtual bool Set(const char *, const char *);
106 
107  /// Get parameter key/value as string map
108  virtual ParameterList Parameter() const;
109 
110  // ---------------------------------------------------------------------------
111  // Correspondences
112 
113  /// Initialize correspondence map
114  virtual void Initialize();
115 
116  /// Update correspondence map after convergence
117  virtual bool Upgrade();
118 
119 protected:
120 
121  /// Initialize annealing process
122  virtual void InitializeAnnealing();
123 
124  /// (Re-)calculate weights of correspondence links
125  virtual void CalculateWeights();
126 
127 };
128 
129 
130 } // namespace mirtk
131 
132 #endif // MIRTK_RobustPointMatch_H
TypeId
Enumeration of available point correspondence maps.
virtual TypeId Type() const
Type enumeration value.
virtual void Initialize()
Initialize correspondence map.
RobustPointMatch()
Default constructor.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual void CalculateWeights()
(Re-)calculate weights of correspondence links
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual ~RobustPointMatch()
Destructor.
virtual bool Upgrade()
Update correspondence map after convergence.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
Definition: Object.h:38
virtual bool Set(const char *, const char *)
Set parameter value from string.
virtual void InitializeAnnealing()
Initialize annealing process.
Definition: IOConfig.h:41
virtual PointCorrespondence * NewInstance() const
Copy construct a new instance.