SuPReMo
0.1.1
Loading...
Searching...
No Matches
motion-lib
SlidingTransformation.h
1
// ====================================================================================================
2
//
3
// SuPReMo: Surrogate Parameterised Respiratory Motion Model
4
// An implementation of the generalised motion modelling and image registration framework
5
//
6
// Copyright (c) University College London (UCL). All rights reserved.
7
//
8
// This software is distributed WITHOUT ANY WARRANTY; without even
9
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10
// PURPOSE.
11
//
12
// See LICENSE.txt in the top level directory for details.
13
//
14
// ====================================================================================================
15
16
17
18
19
#pragma once
20
21
#include "Supremo.h"
22
#include "nifti1_io.h"
23
#include "Transformation.h"
24
25
26
27
28
31
class
SlidingTransformation
:
public
Transformation
32
{
33
public
:
34
typedef
Transformation::PrecisionType
PrecisionType
;
35
46
SlidingTransformation
( std::shared_ptr<Transformation>transformationAIn,
47
std::shared_ptr<Transformation>transformationBIn,
48
nifti_image* defSpaceImage,
49
unsigned
int
numberOfLevels,
50
unsigned
int
numberOfLevelsToPerform );
51
55
SlidingTransformation
(
const
SlidingTransformation
& transformToCopy );
56
59
~SlidingTransformation
();
60
64
virtual
void
InitialiseLevel
(
unsigned
int
level );
65
70
void
SetParameters
(
PrecisionType
* parametersIn,
bool
parametersAreDisplacements );
71
75
virtual
nifti_image*
GetDeformationVectorField
( nifti_image* targetImageIn );
76
80
virtual
SlidingTransformation::PrecisionType
*
GetDVFGradientWRTTransformationParameters
( nifti_image* denseDVFIn );
81
84
virtual
SlidingTransformation::PrecisionType
*
GetConstraintGradientWRTTransformationParameters
();
85
88
double
GetConstraintValue
();
89
92
virtual
PrecisionType
*
GetCopyOfParameters
();
93
96
std::shared_ptr<Transformation>
DeepCopy
();
97
100
void
DisplayTransformationParameters
();
101
105
virtual
PrecisionType
GetSumOfPenaltyWeights
();
106
109
virtual
PrecisionType
GetMaxTransformationParameterLength
(
PrecisionType
* parametersIn );
110
111
114
std::vector<nifti_image*>
GetTransformationAsImage
();
115
120
void
SetGapOverlapConstraintWeight
(
double
gapOverlabConstraintWeightIn );
121
125
void
SetSignedDistanceMapImage
( nifti_image* signedDistanceMapImageIn);
126
127
128
private
:
129
132
void
ClearSignedDistanceMap
();
133
136
void
ClearTransformedSignedDistanceMaps
();
137
141
void
AllocateTransformedSignedDistanceMaps
( nifti_image* targetImage );
142
143
147
double
CalculateGapOverlapConstraintTerm
();
148
152
bool
TransformedSignedDistMapsCanBeUsedForConstraintCalculations
();
153
154
std::shared_ptr<Transformation>
transformA
;
155
std::shared_ptr<Transformation>
transformB
;
156
157
nifti_image*
signedDistMapImage
;
158
159
std::shared_ptr<ImagePyramid<PrecisionType>>
defSpaceImagePyramid
;
160
nifti_image*
curDefSpaceImage
;
161
162
int
lastInitialisedLevel
;
163
164
nifti_image*
signedDistMapImageTransformedA
;
165
nifti_image*
signedDistMapImageTransformedB
;
166
167
double
gapOverlapConstraintWeight
;
168
};
169
SlidingTransformation
Definition:
SlidingTransformation.h:32
SlidingTransformation::GetSumOfPenaltyWeights
virtual PrecisionType GetSumOfPenaltyWeights()
Definition:
SlidingTransformation.cpp:905
SlidingTransformation::signedDistMapImageTransformedB
nifti_image * signedDistMapImageTransformedB
Nfiti image holdeing the signed distance map transformed with transformA.
Definition:
SlidingTransformation.h:165
SlidingTransformation::DeepCopy
std::shared_ptr< Transformation > DeepCopy()
Definition:
SlidingTransformation.cpp:977
SlidingTransformation::CalculateGapOverlapConstraintTerm
double CalculateGapOverlapConstraintTerm()
Definition:
SlidingTransformation.cpp:1089
SlidingTransformation::PrecisionType
Transformation::PrecisionType PrecisionType
Definition:
SlidingTransformation.h:34
SlidingTransformation::AllocateTransformedSignedDistanceMaps
void AllocateTransformedSignedDistanceMaps(nifti_image *targetImage)
Definition:
SlidingTransformation.cpp:1056
SlidingTransformation::curDefSpaceImage
nifti_image * curDefSpaceImage
Pointer to the current image within the defSpaceImagePyramid.
Definition:
SlidingTransformation.h:160
SlidingTransformation::signedDistMapImage
nifti_image * signedDistMapImage
Nifti image holding the singed distance image in source-image space for the current level.
Definition:
SlidingTransformation.h:157
SlidingTransformation::GetCopyOfParameters
virtual PrecisionType * GetCopyOfParameters()
Definition:
SlidingTransformation.cpp:177
SlidingTransformation::GetTransformationAsImage
std::vector< nifti_image * > GetTransformationAsImage()
Definition:
SlidingTransformation.cpp:948
SlidingTransformation::~SlidingTransformation
~SlidingTransformation()
Definition:
SlidingTransformation.cpp:157
SlidingTransformation::SetGapOverlapConstraintWeight
void SetGapOverlapConstraintWeight(double gapOverlabConstraintWeightIn)
Definition:
SlidingTransformation.cpp:862
SlidingTransformation::gapOverlapConstraintWeight
double gapOverlapConstraintWeight
The gap-overlap-constraint weight.
Definition:
SlidingTransformation.h:167
SlidingTransformation::InitialiseLevel
virtual void InitialiseLevel(unsigned int level)
Definition:
SlidingTransformation.cpp:206
SlidingTransformation::ClearTransformedSignedDistanceMaps
void ClearTransformedSignedDistanceMaps()
Definition:
SlidingTransformation.cpp:1036
SlidingTransformation::GetConstraintValue
double GetConstraintValue()
Definition:
SlidingTransformation.cpp:653
SlidingTransformation::GetDVFGradientWRTTransformationParameters
virtual SlidingTransformation::PrecisionType * GetDVFGradientWRTTransformationParameters(nifti_image *denseDVFIn)
Definition:
SlidingTransformation.cpp:677
SlidingTransformation::signedDistMapImageTransformedA
nifti_image * signedDistMapImageTransformedA
Nfiti image holdeing the signed distance map transformed with transformA.
Definition:
SlidingTransformation.h:164
SlidingTransformation::GetConstraintGradientWRTTransformationParameters
virtual SlidingTransformation::PrecisionType * GetConstraintGradientWRTTransformationParameters()
Definition:
SlidingTransformation.cpp:465
SlidingTransformation::SetSignedDistanceMapImage
void SetSignedDistanceMapImage(nifti_image *signedDistanceMapImageIn)
Definition:
SlidingTransformation.cpp:1001
SlidingTransformation::transformB
std::shared_ptr< Transformation > transformB
The transformation defining the outside, i.e. SDT > 0.
Definition:
SlidingTransformation.h:155
SlidingTransformation::lastInitialisedLevel
int lastInitialisedLevel
The last initialised level. This determines which level of the def space image pyramid is accessed....
Definition:
SlidingTransformation.h:162
SlidingTransformation::GetMaxTransformationParameterLength
virtual PrecisionType GetMaxTransformationParameterLength(PrecisionType *parametersIn)
Definition:
SlidingTransformation.cpp:925
SlidingTransformation::defSpaceImagePyramid
std::shared_ptr< ImagePyramid< PrecisionType > > defSpaceImagePyramid
The image pyramid holding the images in which the transformation is defined. Should correspond with t...
Definition:
SlidingTransformation.h:159
SlidingTransformation::transformA
std::shared_ptr< Transformation > transformA
The transformation defining the inside, i.e. SDT < 0.
Definition:
SlidingTransformation.h:154
SlidingTransformation::ClearSignedDistanceMap
void ClearSignedDistanceMap()
Definition:
SlidingTransformation.cpp:1020
SlidingTransformation::DisplayTransformationParameters
void DisplayTransformationParameters()
Definition:
SlidingTransformation.cpp:989
SlidingTransformation::TransformedSignedDistMapsCanBeUsedForConstraintCalculations
bool TransformedSignedDistMapsCanBeUsedForConstraintCalculations()
Definition:
SlidingTransformation.cpp:1161
SlidingTransformation::SetParameters
void SetParameters(PrecisionType *parametersIn, bool parametersAreDisplacements)
Definition:
SlidingTransformation.cpp:882
SlidingTransformation::GetDeformationVectorField
virtual nifti_image * GetDeformationVectorField(nifti_image *targetImageIn)
Definition:
SlidingTransformation.cpp:232
Transformation
Definition:
Transformation.h:55
Transformation::PrecisionType
float PrecisionType
Definition:
Transformation.h:57