NormalizedGradientFieldSimilarity.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2015 Imperial College London
5  * Copyright 2013-2015 Stefan Pszczolkowski Parraguez, 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_NormalizedGradientFieldSimilarity_H
21 #define MIRTK_NormalizedGradientFieldSimilarity_H
22 
23 #include "mirtk/GradientFieldSimilarity.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Base class for normalized gradient image similarity measures
31  *
32  * Subclasses of this intensity-based image similarity measure compute similarity
33  * from the normalized gradient field of the images.
34  */
36 {
37  mirtkAbstractMacro(NormalizedGradientFieldSimilarity);
38 
39  // ---------------------------------------------------------------------------
40  // Attributes
41 
42  /// Noise parameter for target image
43  mirtkPublicAttributeMacro(double, TargetNoise);
44 
45  /// Noise parameter for source image
46  mirtkPublicAttributeMacro(double, SourceNoise);
47 
48  /// Normalization constant for target image
49  mirtkPublicAttributeMacro(double, TargetNormalization);
50 
51  /// Normalization constant for source image
52  mirtkPublicAttributeMacro(double, SourceNormalization);
53 
54  /// Compute normalization constant for given image and noise value
55  double NormalizationFactor(RegisteredImage *, double = 1.0) const;
56 
57  // ---------------------------------------------------------------------------
58  // Construction/Destruction
59 
60 protected:
61 
62  /// Constructor
63  NormalizedGradientFieldSimilarity(const char * = "", double = 1.0);
64 
65  /// Copy constructor
67 
68  /// Destructor
70 
71  // ---------------------------------------------------------------------------
72  // Parameters
73 
74 protected:
75 
76  /// Set parameter value from string
77  virtual bool SetWithPrefix(const char *, const char *);
78 
79 public:
80 
81  // Import other overloads
83 
84  /// Get parameter name/value map
85  virtual ParameterList Parameter() const;
86 
87  // ---------------------------------------------------------------------------
88  // Evaluation
89 
90  /// Update moving input image(s) and internal state of similarity measure
91  virtual void Update(bool = true);
92 
93 };
94 
95 
96 } // namespace mirtk
97 
98 #endif // MIRTK_NormalizedGradientFieldSimilarity_H
virtual ParameterList Parameter() const
Get parameter name/value map.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
Definition: Object.h:38
Definition: IOConfig.h:41
virtual void Update(bool=true)
Update moving input image(s) and internal state of similarity measure.
NormalizedGradientFieldSimilarity(const char *="", double=1.0)
Constructor.
virtual ~NormalizedGradientFieldSimilarity()
Destructor.
virtual ParameterList Parameter() const
Get parameter name/value map.
virtual bool SetWithPrefix(const char *, const char *)
Set parameter value from string.