SquaredErrorFunction.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_SquaredErrorFunction_H
21 #define MIRTK_SquaredErrorFunction_H
22 
23 #include "mirtk/RadialErrorFunction.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Squared Euclidean distance registration error function
31  */
33 {
34  mirtkObjectMacro(SquaredErrorFunction);
35 
36 public:
37 
38  /// Constructor
40 
41  /// Copy constructor
43 
44  /// Destructor
46 
47  /// Copy construct a new instance
49  {
50  return new SquaredErrorFunction(*this);
51  }
52 
53  /// Type enumeration value
54  virtual TypeId Type() const
55  {
56  return Squared;
57  }
58 
59  /// Evaluate radial registration error
60  virtual double Value(double d) const
61  {
62  return d;
63  }
64 
65  /// Evaluate derivative of radial registration error
66  virtual double Derivative(double d) const
67  {
68  return 1.0;
69  }
70 
71 };
72 
73 
74 } // namespace mirtk
75 
76 #endif // MIRTK_SquaredErrorFunction_H
SquaredErrorFunction(const SquaredErrorFunction &)
Copy constructor.
TypeId
Enumeration of available error functions.
virtual double Value(double d) const
Evaluate radial registration error.
Definition: IOConfig.h:41
virtual TypeId Type() const
Type enumeration value.
virtual RadialErrorFunction * NewInstance() const
Copy construct a new instance.
Squared (Euclidean) distance.
virtual double Derivative(double d) const
Evaluate derivative of radial registration error.