SuPReMo  0.1.1
Loading...
Searching...
No Matches
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
32{
33public:
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
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
81
85
88 double GetConstraintValue();
89
93
96 std::shared_ptr<Transformation> DeepCopy();
97
101
106
110
111
114 std::vector<nifti_image*> GetTransformationAsImage();
115
120 void SetGapOverlapConstraintWeight( double gapOverlabConstraintWeightIn );
121
125 void SetSignedDistanceMapImage( nifti_image* signedDistanceMapImageIn);
126
127
128private:
129
133
137
141 void AllocateTransformedSignedDistanceMaps( nifti_image* targetImage );
142
143
148
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
163
166
168};
169
Definition: SlidingTransformation.h:32
virtual PrecisionType GetSumOfPenaltyWeights()
Definition: SlidingTransformation.cpp:905
nifti_image * signedDistMapImageTransformedB
Nfiti image holdeing the signed distance map transformed with transformA.
Definition: SlidingTransformation.h:165
std::shared_ptr< Transformation > DeepCopy()
Definition: SlidingTransformation.cpp:977
double CalculateGapOverlapConstraintTerm()
Definition: SlidingTransformation.cpp:1089
Transformation::PrecisionType PrecisionType
Definition: SlidingTransformation.h:34
void AllocateTransformedSignedDistanceMaps(nifti_image *targetImage)
Definition: SlidingTransformation.cpp:1056
nifti_image * curDefSpaceImage
Pointer to the current image within the defSpaceImagePyramid.
Definition: SlidingTransformation.h:160
nifti_image * signedDistMapImage
Nifti image holding the singed distance image in source-image space for the current level.
Definition: SlidingTransformation.h:157
virtual PrecisionType * GetCopyOfParameters()
Definition: SlidingTransformation.cpp:177
std::vector< nifti_image * > GetTransformationAsImage()
Definition: SlidingTransformation.cpp:948
~SlidingTransformation()
Definition: SlidingTransformation.cpp:157
void SetGapOverlapConstraintWeight(double gapOverlabConstraintWeightIn)
Definition: SlidingTransformation.cpp:862
double gapOverlapConstraintWeight
The gap-overlap-constraint weight.
Definition: SlidingTransformation.h:167
virtual void InitialiseLevel(unsigned int level)
Definition: SlidingTransformation.cpp:206
void ClearTransformedSignedDistanceMaps()
Definition: SlidingTransformation.cpp:1036
double GetConstraintValue()
Definition: SlidingTransformation.cpp:653
virtual SlidingTransformation::PrecisionType * GetDVFGradientWRTTransformationParameters(nifti_image *denseDVFIn)
Definition: SlidingTransformation.cpp:677
nifti_image * signedDistMapImageTransformedA
Nfiti image holdeing the signed distance map transformed with transformA.
Definition: SlidingTransformation.h:164
virtual SlidingTransformation::PrecisionType * GetConstraintGradientWRTTransformationParameters()
Definition: SlidingTransformation.cpp:465
void SetSignedDistanceMapImage(nifti_image *signedDistanceMapImageIn)
Definition: SlidingTransformation.cpp:1001
std::shared_ptr< Transformation > transformB
The transformation defining the outside, i.e. SDT > 0.
Definition: SlidingTransformation.h:155
int lastInitialisedLevel
The last initialised level. This determines which level of the def space image pyramid is accessed....
Definition: SlidingTransformation.h:162
virtual PrecisionType GetMaxTransformationParameterLength(PrecisionType *parametersIn)
Definition: SlidingTransformation.cpp:925
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
std::shared_ptr< Transformation > transformA
The transformation defining the inside, i.e. SDT < 0.
Definition: SlidingTransformation.h:154
void ClearSignedDistanceMap()
Definition: SlidingTransformation.cpp:1020
void DisplayTransformationParameters()
Definition: SlidingTransformation.cpp:989
bool TransformedSignedDistMapsCanBeUsedForConstraintCalculations()
Definition: SlidingTransformation.cpp:1161
void SetParameters(PrecisionType *parametersIn, bool parametersAreDisplacements)
Definition: SlidingTransformation.cpp:882
virtual nifti_image * GetDeformationVectorField(nifti_image *targetImageIn)
Definition: SlidingTransformation.cpp:232
Definition: Transformation.h:55
float PrecisionType
Definition: Transformation.h:57