Modules
Image
include
mirtk
ConstExtrapolateImageFunctionWithPeriodicTime.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_ConstExtrapolateImageFunctionWithPeriodicTime_H
21
#define MIRTK_ConstExtrapolateImageFunctionWithPeriodicTime_H
22
23
#include "mirtk/BaseImage.h"
24
#include "mirtk/ConstExtrapolateImageFunction.h"
25
#include "mirtk/RepeatExtrapolateImageFunction.h"
26
27
28
namespace
mirtk
{
29
30
31
/**
32
* Extrapolation of generic image by padding it with a constant value
33
* in the spatial domain, but a periodic extension in the temporal dimension
34
*/
35
template
<
class
TImage>
36
class
GenericConstExtrapolateImageFunctionWithPeriodicTime
37
:
public
GenericConstExtrapolateImageFunction
<TImage>
38
{
39
mirtkExtrapolatorMacro(
40
GenericConstExtrapolateImageFunctionWithPeriodicTime
,
41
Extrapolation_ConstWithPeriodicTime
42
);
43
44
public
:
45
46
typedef
TImage
ImageType
;
///< Input image type
47
typedef
typename
ImageType::VoxelType
VoxelType
;
///< Input voxel type
48
typedef
typename
ImageType::RealType
RealType
;
///< Compatible floating-point type
49
50
/// Constructor
51
GenericConstExtrapolateImageFunctionWithPeriodicTime
(
double
padding_value = .0)
52
:
53
GenericConstExtrapolateImageFunction
<TImage>(padding_value)
54
{}
55
56
/// Destructor
57
virtual
~GenericConstExtrapolateImageFunctionWithPeriodicTime
() {}
58
59
// Import overloaded non-virtual member functions from base class
60
using
GenericConstExtrapolateImageFunction<TImage>::Get
;
61
62
/// Get image value at an arbitrary discrete image location
63
virtual
VoxelType
Get
(
int
i,
int
j,
int
k = 0,
int
l = 0)
const
64
{
65
RepeatExtrapolateImageFunction::Apply
(l, this->
T
() - 1);
66
return
GenericConstExtrapolateImageFunction<TImage>::Get
(i, j, k, l);
67
}
68
69
};
70
71
72
/**
73
* Extrapolation of any image by padding it with a constant value
74
* in the spatial domain, but a periodic extension in the temporal dimension
75
*/
76
class
ConstExtrapolateImageFunctionWithPeriodicTime
77
:
public
GenericConstExtrapolateImageFunctionWithPeriodicTime
<BaseImage>
78
{
79
mirtkObjectMacro(
ConstExtrapolateImageFunctionWithPeriodicTime
);
80
81
public
:
82
83
/// Constructor
84
ConstExtrapolateImageFunctionWithPeriodicTime
() {}
85
86
/// Destructor
87
virtual
~ConstExtrapolateImageFunctionWithPeriodicTime
() {}
88
89
};
90
91
92
}
// namespace mirtk
93
94
#endif // MIRTK_ConstExtrapolateImageFunctionWithPeriodicTime_H
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:36
mirtk::GenericRepeatExtrapolateImageFunction< BaseImage >::Apply
static void Apply(int &index, int max)
Definition:
RepeatExtrapolateImageFunction.h:56
mirtk::GenericConstExtrapolateImageFunction::Get
virtual VoxelType Get(int i, int j, int k=0, int l=0) const
Get image value at an arbitrary discrete image location.
Definition:
ConstExtrapolateImageFunction.h:60
mirtk::ConstExtrapolateImageFunctionWithPeriodicTime::~ConstExtrapolateImageFunctionWithPeriodicTime
virtual ~ConstExtrapolateImageFunctionWithPeriodicTime()
Destructor.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:87
mirtk::ConstExtrapolateImageFunctionWithPeriodicTime
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:76
mirtk::ExtrapolateImageFunction::T
int T() const
Size of input image in t dimension.
Definition:
ExtrapolateImageFunction.h:399
mirtk::ConstExtrapolateImageFunctionWithPeriodicTime::ConstExtrapolateImageFunctionWithPeriodicTime
ConstExtrapolateImageFunctionWithPeriodicTime()
Constructor.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:84
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::VoxelType
ImageType::VoxelType VoxelType
Input voxel type.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:47
mirtk
Definition:
IOConfig.h:41
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::~GenericConstExtrapolateImageFunctionWithPeriodicTime
virtual ~GenericConstExtrapolateImageFunctionWithPeriodicTime()
Destructor.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:57
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::GenericConstExtrapolateImageFunctionWithPeriodicTime
GenericConstExtrapolateImageFunctionWithPeriodicTime(double padding_value=.0)
Constructor.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:51
mirtk::BaseImage::VoxelType
double VoxelType
Definition:
BaseImage.h:770
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::ImageType
TImage ImageType
Input image type.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:46
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::RealType
ImageType::RealType RealType
Compatible floating-point type.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:48
mirtk::GenericConstExtrapolateImageFunctionWithPeriodicTime::Get
virtual VoxelType Get(int i, int j, int k=0, int l=0) const
Get image value at an arbitrary discrete image location.
Definition:
ConstExtrapolateImageFunctionWithPeriodicTime.h:63
mirtk::GenericConstExtrapolateImageFunction
Definition:
ConstExtrapolateImageFunction.h:40