ResamplingWithPadding.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2008-2017 Imperial College London
5  * Copyright 2008-2015 Daniel Rueckert, Julia Schnabel
6  * Copyright 2017 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_ResamplingWithPadding_H
22 #define MIRTK_ResamplingWithPadding_H
23 
24 #include "mirtk/Resampling.h"
25 
26 
27 namespace mirtk {
28 
29 
30 /**
31  * Class for resampling of padded images
32  *
33  * This class defines and implements the resampling of images with arbitrary
34  * voxel dimensions. The new image intensity of the voxels is calculated by
35  * interpolation of the old image intensities, using
36  * InterpolateImageFunction::EvaluateWithPadding.
37  */
38 template <class TVoxel>
39 class ResamplingWithPadding : public Resampling<TVoxel>
40 {
41  mirtkImageFilterMacro(ResamplingWithPadding, TVoxel);
42 
43  // ---------------------------------------------------------------------------
44  // Attributes
45 
46 protected:
47 
48  /// Padding value
49  mirtkPublicAttributeMacro(VoxelType, PaddingValue);
50 
51  // ---------------------------------------------------------------------------
52  // Construction/Destruction
53 
54 public:
55 
56  /// Constructor
57  ResamplingWithPadding(double, double, double, VoxelType);
58 
59  /// Constructor
60  ResamplingWithPadding(int, int, int, VoxelType);
61 
62  /// Constructor
63  ResamplingWithPadding(int, int, int, double, double, double, VoxelType);
64 
65  // ---------------------------------------------------------------------------
66  // Execution
67 
68  /// Run the resampling filter
69  virtual void Run();
70 
71 protected:
72 
73  /// Initialize the filter
74  virtual void Initialize();
75 
76 };
77 
78 
79 } // namespace mirtk
80 
81 #endif // MIRTK_ResamplingWithPadding_H
ResamplingWithPadding(double, double, double, VoxelType)
Constructor.
mirtkPublicAttributeMacro(VoxelType, PaddingValue)
Padding value.
Definition: IOConfig.h:41
TVoxel VoxelType
Input/output image voxel type.
Definition: ImageToImage.h:48
virtual void Run()
Run the resampling filter.
virtual void Initialize()
Initialize the filter.