ScalarGaussian.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2008-2015 Imperial College London
5  * Copyright 2008-2015 Daniel Rueckert, Julia Schnabel
6  * Copyright 2013-2015 Andreas Schuh
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef MIRTK_ScalarGaussian_H
22 #define MIRTK_ScalarGaussian_H
23 
24 #include "mirtk/ScalarFunction.h"
25 #include "mirtk/Vector4D.h"
26 
27 
28 namespace mirtk {
29 
30 
31 /**
32  * Scalar Gaussian function.
33  */
35 {
36  mirtkObjectMacro(ScalarGaussian);
37 
38 protected:
39 
40  /// Variance of the Gaussian
42 
43  /// Center of Gaussian
45 
46  /// Normalization of ND Gaussian function
47  double _Norm[4];
48 
49  /// Pre-compute normalization factor(s)
50  void ComputeNorm();
51 
52 public:
53 
54  /// Construct Gaussian with isotropic sigma of 1 and center at origin
56 
57  /// Construct Gaussian with isotropic sigma and center at origin
58  ScalarGaussian(double);
59 
60  /// Construct Gaussian with isotropic sigma and specific center
61  ScalarGaussian(double, double, double, double = .0, double = .0);
62 
63  /// Construct 3D Gaussian with anisotropic sigma and specific center
64  ScalarGaussian(double, double, double,
65  double, double, double);
66 
67  /// Construct 4D Gaussian with anisotropic sigma and specific center
68  ScalarGaussian(double, double, double, double,
69  double, double, double, double);
70 
71  /// Destructor
72  virtual ~ScalarGaussian();
73 
74  /// Evaluate 1D Gaussian
75  virtual double Evaluate(double);
76 
77  /// Evaluate 2D Gaussian
78  virtual double Evaluate(double, double);
79 
80  /// Evaluate 3D Gaussian
81  virtual double Evaluate(double, double, double);
82 
83  /// Evaluate 4D Gaussian
84  virtual double Evaluate(double, double, double, double);
85 };
86 
87 
88 } // namespace mirtk
89 
90 #endif // MIRTK_ScalarGaussian_H
double _Norm[4]
Normalization of ND Gaussian function.
virtual ~ScalarGaussian()
Destructor.
ScalarGaussian()
Construct Gaussian with isotropic sigma of 1 and center at origin.
Definition: IOConfig.h:41
void ComputeNorm()
Pre-compute normalization factor(s)
Vector4D< double > _Center
Center of Gaussian.
virtual double Evaluate(double)
Evaluate 1D Gaussian.
Vector4D< double > _Variance
Variance of the Gaussian.