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_SincInterpolateImageFunction3D_HXX
21 #define MIRTK_SincInterpolateImageFunction3D_HXX
22
23 #include "mirtk/SincInterpolateImageFunction3D.h"
24 #include "mirtk/SincInterpolateImageFunction.hxx"
25
26 namespace mirtk {
27
28
29 // -----------------------------------------------------------------------------
30 template <class TImage>
31 GenericSincInterpolateImageFunction3D<TImage>
GenericSincInterpolateImageFunction3D()32 ::GenericSincInterpolateImageFunction3D()
33 {
34 this->NumberOfDimensions(3);
35 }
36
37 // -----------------------------------------------------------------------------
38 template <class TImage>
39 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
40 GenericSincInterpolateImageFunction3D<TImage>
Get(double x,double y,double z,double t) const41 ::Get(double x, double y, double z, double t) const
42 {
43 return this->Get3D(x, y, z, t);
44 }
45
46 // -----------------------------------------------------------------------------
47 template <class TImage>
48 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
49 GenericSincInterpolateImageFunction3D<TImage>
GetWithPadding(double x,double y,double z,double t) const50 ::GetWithPadding(double x, double y, double z, double t) const
51 {
52 return this->GetWithPadding3D(x, y, z, t);
53 }
54
55 // -----------------------------------------------------------------------------
56 template <class TImage> template <class TOtherImage>
57 inline typename TOtherImage::VoxelType
58 GenericSincInterpolateImageFunction3D<TImage>
Get(const TOtherImage * input,double x,double y,double z,double t) const59 ::Get(const TOtherImage *input, double x, double y, double z, double t) const
60 {
61 return this->Get3D(input, x, y, z, t);
62 }
63
64 // -----------------------------------------------------------------------------
65 template <class TImage> template <class TOtherImage>
66 inline typename TOtherImage::VoxelType
67 GenericSincInterpolateImageFunction3D<TImage>
GetWithPadding(const TOtherImage * input,double x,double y,double z,double t) const68 ::GetWithPadding(const TOtherImage *input, double x, double y, double z, double t) const
69 {
70 return this->GetWithPadding3D(input, x, y, z, t);
71 }
72
73 // -----------------------------------------------------------------------------
74 template <class TImage>
75 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
76 GenericSincInterpolateImageFunction3D<TImage>
GetInside(double x,double y,double z,double t) const77 ::GetInside(double x, double y, double z, double t) const
78 {
79 return Get(this->Input(), x, y, z, t);
80 }
81
82 // -----------------------------------------------------------------------------
83 template <class TImage>
84 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
85 GenericSincInterpolateImageFunction3D<TImage>
GetOutside(double x,double y,double z,double t) const86 ::GetOutside(double x, double y, double z, double t) const
87 {
88 if (this->Extrapolator()) {
89 return Get(this->Extrapolator(), x, y, z, t);
90 } else {
91 return Get(x, y, z, t);
92 }
93 }
94
95 // -----------------------------------------------------------------------------
96 template <class TImage>
97 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
98 GenericSincInterpolateImageFunction3D<TImage>
GetWithPaddingInside(double x,double y,double z,double t) const99 ::GetWithPaddingInside(double x, double y, double z, double t) const
100 {
101 return GetWithPadding(this->Input(), x, y, z, t);
102 }
103
104 // -----------------------------------------------------------------------------
105 template <class TImage>
106 inline typename GenericSincInterpolateImageFunction3D<TImage>::VoxelType
107 GenericSincInterpolateImageFunction3D<TImage>
GetWithPaddingOutside(double x,double y,double z,double t) const108 ::GetWithPaddingOutside(double x, double y, double z, double t) const
109 {
110 if (this->Extrapolator()) {
111 return GetWithPadding(this->Extrapolator(), x, y, z, t);
112 } else {
113 return GetWithPadding(x, y, z, t);
114 }
115 }
116
117
118 } // namespace mirtk
119
120 #endif // MIRTK_SincInterpolateImageFunction3D_HXX
121