SpectralMatch.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_SpectralMatch_H
21 #define MIRTK_SpectralMatch_H
22 
23 #include "mirtk/PointCorrespondence.h"
24 
25 #include "mirtk/PointSet.h"
26 
27 
28 namespace mirtk {
29 
30 
31 class PointLocator;
32 
33 
34 /**
35  * Correspondence map based on diffeomorphic spectral matching
36  */
38 {
39  mirtkObjectMacro(SpectralMatch);
40 
41  // ---------------------------------------------------------------------------
42  // Attributes
43 protected:
44 
45  /// Number of spectral nearest neighbors to consider
46  mirtkPublicAttributeMacro(int, NumberOfNeighbors);
47 
48  /// Standard deviation of Gaussian interpolation kernel
49  mirtkPublicAttributeMacro(double, Sigma);
50 
51  /// Target points corresponding to source points
52  mirtkAttributeMacro(PointSet, TargetPoints);
53 
54  /// Source points corresponding to target points
55  mirtkAttributeMacro(PointSet, SourcePoints);
56 
57  PointLocator *_TargetLocator;
58  PointLocator *_SourceLocator;
59 
60  // ---------------------------------------------------------------------------
61  // Construction/Destruction
62 public:
63 
64  /// Constructor
65  SpectralMatch();
66 
67  /// Copy constructor
69 
70  /// Copy construct a new instance
71  virtual PointCorrespondence *NewInstance() const;
72 
73  /// Destructor
74  virtual ~SpectralMatch();
75 
76  /// Type enumeration value
77  virtual TypeId Type() const;
78 
79  // ---------------------------------------------------------------------------
80  // Parameters
81 
82  // Import other overloads
84 
85  /// Set parameter value from string
86  virtual bool Set(const char *, const char *);
87 
88  /// Get parameter key/value as string map
89  virtual ParameterList Parameter() const;
90 
91  // ---------------------------------------------------------------------------
92  // Correspondences
93 
94  /// Initialize correspondence map
95  virtual void Initialize();
96 
97  /// Update correspondence map
98  virtual void Update();
99 
100  /// Update correspondence map after convergence
101  virtual bool Upgrade();
102 
103  /// Get untransformed target point corresponding to i-th source (sample) point
104  virtual bool GetInputTargetPoint(int, Point &) const;
105 
106  /// Get untransformed source point corresponding to i-th target (sample) point
107  virtual bool GetInputSourcePoint(int, Point &) const;
108 
109  /// Get (transformed) target point corresponding to i-th source (sample) point
110  virtual bool GetTargetPoint(int, Point &) const;
111 
112  /// Get (transformed) source point corresponding to i-th target (sample) point
113  virtual bool GetSourcePoint(int, Point &) const;
114 
115 };
116 
117 
118 } // namespace mirtk
119 
120 #endif // MIRTK_SpectralMatch_H
TypeId
Enumeration of available point correspondence maps.
virtual bool Set(const char *, const char *)
Set parameter value from string.
virtual bool GetTargetPoint(int, Point &) const
Get (transformed) target point corresponding to i-th source (sample) point.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual TypeId Type() const
Type enumeration value.
virtual PointCorrespondence * NewInstance() const
Copy construct a new instance.
virtual void Update()
Update correspondence map.
virtual bool GetInputSourcePoint(int, Point &) const
Get untransformed source point corresponding to i-th target (sample) point.
virtual ParameterList Parameter() const
Get parameter key/value as string map.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
Definition: Object.h:38
mirtkAttributeMacro(PointSet, TargetPoints)
Target points corresponding to source points.
Definition: IOConfig.h:41
virtual void Initialize()
Initialize correspondence map.
virtual bool GetInputTargetPoint(int, Point &) const
Get untransformed target point corresponding to i-th source (sample) point.
virtual bool GetSourcePoint(int, Point &) const
Get (transformed) source point corresponding to i-th target (sample) point.
virtual bool Upgrade()
Update correspondence map after convergence.
mirtkPublicAttributeMacro(int, NumberOfNeighbors)
Number of spectral nearest neighbors to consider.
virtual ~SpectralMatch()
Destructor.
SpectralMatch()
Constructor.