CosineOfNormalizedGradientField.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_CosineOfNormalizedGradientField_H
21 #define MIRTK_CosineOfNormalizedGradientField_H
22 
23 #include "mirtk/NormalizedGradientFieldSimilarity.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Cosine of normalized gradient field similarity measure
31  */
33 {
34  mirtkEnergyTermMacro(CosineOfNormalizedGradientField, EM_NGF_COS);
35 
36  // ---------------------------------------------------------------------------
37  // Attributes
38 
39  /// Power (exponent) of cosine function
40  mirtkPublicAttributeMacro(int, Power);
41 
42  // ---------------------------------------------------------------------------
43  // Construction/Destruction
44 public:
45 
46  /// Constructor
47  CosineOfNormalizedGradientField(const char * = "");
48 
49  /// Copy constructor
51 
52  /// Assignment operator
54 
55  /// Destructor
57 
58  // ---------------------------------------------------------------------------
59  // Parameters
60 protected:
61 
62  /// Set parameter value from string
63  virtual bool SetWithoutPrefix(const char *, const char *);
64 
65 public:
66 
67  // Import other overloads
69 
70  /// Get parameter key/value as string map
71  virtual ParameterList Parameter() const;
72 
73  // ---------------------------------------------------------------------------
74  // Evaluation
75 protected:
76 
77  /// Evaluate similarity of images
78  virtual double Evaluate();
79 
80  /// Evaluate non-parametric similarity gradient w.r.t the given image
82 
83  // ---------------------------------------------------------------------------
84  // Debugging
85 public:
86 
87  /// Return unweighted and unnormalized raw energy term value
88  /// \remarks Use for progress reporting only.
89  virtual double RawValue(double) const;
90 
91  /// Write input of data fidelity term
92  virtual void WriteDataSets(const char *, const char *, bool = true) const;
93 
94 };
95 
96 
97 } // namespace mirtk
98 
99 #endif // MIRTK_CosineOfNormalizedGradientField_H
CosineOfNormalizedGradientField(const char *="")
Constructor.
CosineOfNormalizedGradientField & operator=(const CosineOfNormalizedGradientField &)
Assignment operator.
Cosine of normalzed gradient field.
Definition: EnergyMeasure.h:49
virtual bool NonParametricGradient(const RegisteredImage *, GradientImageType *)
Evaluate non-parametric similarity gradient w.r.t the given image.
virtual double Evaluate()
Evaluate similarity of images.
virtual void WriteDataSets(const char *, const char *, bool=true) const
Write input of data fidelity term.
Array< Pair< string, string > > ParameterList
Ordered list of parameter name/value pairs.
Definition: Object.h:38
virtual bool SetWithoutPrefix(const char *, const char *)
Set parameter value from string.
Definition: IOConfig.h:41
virtual ParameterList Parameter() const
Get parameter key/value as string map.
virtual ParameterList Parameter() const
Get parameter key/value as string map.