LinearImageGradientFunction2D.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_LinearImageGradientFunction2D_H
21 #define MIRTK_LinearImageGradientFunction2D_H
22 
23 #include "mirtk/LinearImageGradientFunction.h"
24 
25 
26 namespace mirtk {
27 
28 
29 /**
30  * Linear interpolation of generic 2D image gradient
31  */
32 template <class TImage>
35 {
36  mirtkObjectMacro(GenericLinearImageGradientFunction2D);
37  mirtkGenericGradientInterpolatorTypes(GenericLinearImageGradientFunction);
38 
39 public:
40 
41  /// Default constructor
43 
44  /// Evaluate image gradient without handling boundary conditions
45  ///
46  /// This version is faster than EvaluateOutside, but is only defined inside
47  /// the domain for which all image values required for interpolation are
48  /// defined and thus require no extrapolation of the finite image.
49  virtual GradientType GetInside(double, double, double = 0, double = 0) const;
50 
51 
52  /// Evaluate image gradient without handling boundary conditions
53  ///
54  /// If the location is partially inside the foreground region of the image,
55  /// only the foreground values are interpolated. Otherwise, the _DefaultValue
56  /// is returned.
57  ///
58  /// This version is faster than GetWithPaddingOutside, but is only defined
59  /// inside the domain for which all image values required for interpolation
60  /// are defined and thus require no extrapolation of the finite image.
61  virtual GradientType GetWithPaddingInside(double, double, double = 0, double = 0) const;
62 
63 };
64 
65 
66 /**
67  * Linear interpolation of any 2D image gradient
68  */
70 : public GenericLinearImageGradientFunction2D<BaseImage>
71 {
72  mirtkObjectMacro(LinearImageGradientFunction2D);
73 
74 public:
75 
76  /// Constructor
78 
79 };
80 
81 
82 } // namespace mirtk
83 
84 #endif // MIRTK_LinearImageGradientFunction2D_H
virtual GradientType GetWithPaddingInside(double, double, double=0, double=0) const
Definition: IOConfig.h:41
virtual GradientType GetInside(double, double, double=0, double=0) const