SuPReMo  0.1.1
Loading...
Searching...
No Matches
CorrespondenceModel.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
22#include <memory>
23#include <vector>
24#include <iostream>
25#include "Supremo.h"
26#include "Transformation.h"
27
28
32public:
33
34 typedef float PrecisionType;
35 typedef std::vector<PrecisionType> SurrogateSignalType;
36
41 CorrespondenceModel( unsigned int numberOfSurrogateSignalsIn,
42 std::shared_ptr<Transformation> transformationIn );
43
47
53 //PrecisionType* GetTransformParamsFromSurrogateSignal( PrecisionType* surrogateSignalIn );
54
57 std::shared_ptr<Transformation> GetTransformationFromSurrogateSignal( const SurrogateSignalType & surrogateSignalIn );
58
63
67 void SetParameters( const PrecisionType* parametersIn );
68
69
75 void SetParameters( const std::vector<nifti_image*>& parameterImagesIn );
76
77
84
87 inline unsigned int GetNumberOfParameters() { return this->numberOfModelParameters; };
88
93 void GetTransformationParameterGradientWRTModelParameters( PrecisionType* transformationGradientIn,
94 const SurrogateSignalType & surrogateSignalIn,
95 PrecisionType* correspondenceModelGradientOut );
96
100 void InitialiseLevel( unsigned int levelIn );
101
105 std::shared_ptr<Transformation> GetTransformation();
106
113 std::vector<nifti_image*> GetCorrespondenceModelAsImage();
114
119
120
125
126
127private:
132
136 std::shared_ptr<Transformation> transform;
139};
Definition: CorrespondenceModel.h:31
unsigned int numberOfSurrogateSignals
The number of surrogate signals used.
Definition: CorrespondenceModel.h:133
std::shared_ptr< Transformation > transform
The internal transformation object that is used to construct a transformation (copy) from a surrogate...
Definition: CorrespondenceModel.h:136
unsigned int numberOfModelParameters
The total number of parameters describing the correspondence model.
Definition: CorrespondenceModel.h:135
~CorrespondenceModel()
Definition: CorrespondenceModel.cpp:64
PrecisionType * recoveryModelParameters
Pointer to model parameters that may be recovered.
Definition: CorrespondenceModel.h:138
void InitialiseLevel(unsigned int levelIn)
Definition: CorrespondenceModel.cpp:145
PrecisionType * modelParameters
Pointer to the model parameters.
Definition: CorrespondenceModel.h:137
void SetParameters(const PrecisionType *parametersIn)
Definition: CorrespondenceModel.cpp:374
PrecisionType GetMaxParameterLength(PrecisionType *parametersIn)
Definition: CorrespondenceModel.cpp:488
std::vector< nifti_image * > GetCorrespondenceModelAsImage()
Definition: CorrespondenceModel.cpp:237
void GetTransformationParameterGradientWRTModelParameters(PrecisionType *transformationGradientIn, const SurrogateSignalType &surrogateSignalIn, PrecisionType *correspondenceModelGradientOut)
Definition: CorrespondenceModel.cpp:508
void ClearRecoveryModelParameters()
Definition: CorrespondenceModel.cpp:346
std::shared_ptr< Transformation > GetTransformation()
Definition: CorrespondenceModel.cpp:225
PrecisionType * GetParameters()
Definition: CorrespondenceModel.cpp:362
unsigned int GetNumberOfParameters()
Definition: CorrespondenceModel.h:87
void SaveCurrentModelParametersForRecovery()
Definition: CorrespondenceModel.cpp:304
float PrecisionType
Definition: CorrespondenceModel.h:34
unsigned int numberOfTransformationParameters
The number of parameters to describe the transformation completely.
Definition: CorrespondenceModel.h:134
void RecoverSavedModelParameters()
Definition: CorrespondenceModel.cpp:324
std::shared_ptr< Transformation > GetTransformationFromSurrogateSignal(const SurrogateSignalType &surrogateSignalIn)
Definition: CorrespondenceModel.cpp:86
std::vector< PrecisionType > SurrogateSignalType
Definition: CorrespondenceModel.h:35