SuPReMo  0.1.1
Loading...
Searching...
No Matches
ObjectiveFunction.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
23//----------
24// includes
25//----------
26#include "Supremo.h"
27#include <memory>
28#include "SupremoUtils.h"
29
30
31
32//----------------------
33// Forward declarations
34//----------------------
36class Transformation;
37
38
39
40
44public:
45
46 typedef float PrecisionType;
47 typedef std::vector< std::vector<PrecisionType> > SurrogateSignalType;
48
52
53
57
58
65 PrecisionType GetValue( const PrecisionType* parametersIn );
66
67
75 void GetGradient( const PrecisionType* parametersIn, PrecisionType* gradientOut, bool normaliseGradient = false );
76
77
82 std::vector<nifti_image*> GetGradientAsImage( const PrecisionType* parametersIn, bool normaliseGradient = false );
83
84
87 unsigned int GetNumberOfParameters();
88
89
96
97
102 void SetCorrespondenceModel( const std::shared_ptr<CorrespondenceModel>& correspondenceModelIn );
103
104
108 void SetSimilarityMeasure( const std::shared_ptr<ImageSimilarity>& imageSimilarityIn);
109
110
114 void SetSurrogateSignals( const SurrogateSignalType & surrSignalsIn );
115
116
120 void SetReferenceStateImage( nifti_image* refStateImgIn );
121
122
128 void SetDynamicImages( const std::vector<nifti_image*>& dynamicImagesIn );
129
134 void SetImageAcquisition( const std::shared_ptr<ImageAcquisition>& imageAcquisitionIn );
135
136private:
137 std::shared_ptr<CorrespondenceModel> correspondenceModel;
138 std::shared_ptr<ImageSimilarity> imageSimilarity;
140 nifti_image* referenceStateImage;
141 std::vector<nifti_image*> dynamicImages;
143 std::shared_ptr<ImageAcquisition> imageAcquisition;
144};
145
Definition: CorrespondenceModel.h:31
Definition: ObjectiveFunction.h:43
void SetSurrogateSignals(const SurrogateSignalType &surrSignalsIn)
Definition: ObjectiveFunction.cpp:146
unsigned int GetNumberOfParameters()
Definition: ObjectiveFunction.cpp:434
ObjectiveFunction()
Definition: ObjectiveFunction.cpp:30
std::vector< nifti_image * > dynamicImages
Vector holding all pointers to the dynamic images.
Definition: ObjectiveFunction.h:141
std::shared_ptr< ImageSimilarity > imageSimilarity
Object that measures the similarity between two images.
Definition: ObjectiveFunction.h:138
std::shared_ptr< CorrespondenceModel > correspondenceModel
Object that represents the correspondence model. Able to generate a transformation.
Definition: ObjectiveFunction.h:137
void SetReferenceStateImage(nifti_image *refStateImgIn)
Definition: ObjectiveFunction.cpp:112
std::vector< std::vector< PrecisionType > > SurrogateSignalType
Definition: ObjectiveFunction.h:47
nifti_image * referenceStateImage
Nifti image structure with all.
Definition: ObjectiveFunction.h:140
void SetCorrespondenceModel(const std::shared_ptr< CorrespondenceModel > &correspondenceModelIn)
Definition: ObjectiveFunction.cpp:97
PrecisionType GetMaxStepSize()
Definition: ObjectiveFunction.cpp:52
PrecisionType similarityWeight
Similarity weight.
Definition: ObjectiveFunction.h:142
std::vector< nifti_image * > GetGradientAsImage(const PrecisionType *parametersIn, bool normaliseGradient=false)
Definition: ObjectiveFunction.cpp:381
float PrecisionType
Definition: ObjectiveFunction.h:46
~ObjectiveFunction()
Definition: ObjectiveFunction.cpp:43
void SetDynamicImages(const std::vector< nifti_image * > &dynamicImagesIn)
Definition: ObjectiveFunction.cpp:123
void SetSimilarityMeasure(const std::shared_ptr< ImageSimilarity > &imageSimilarityIn)
Definition: ObjectiveFunction.cpp:157
PrecisionType GetValue(const PrecisionType *parametersIn)
Definition: ObjectiveFunction.cpp:168
void SetImageAcquisition(const std::shared_ptr< ImageAcquisition > &imageAcquisitionIn)
Definition: ObjectiveFunction.cpp:134
SurrogateSignalType surrogateSignals
All surrogate signals.
Definition: ObjectiveFunction.h:139
void GetGradient(const PrecisionType *parametersIn, PrecisionType *gradientOut, bool normaliseGradient=false)
Definition: ObjectiveFunction.cpp:229
std::shared_ptr< ImageAcquisition > imageAcquisition
The object simulating acquisition and calculating the adjoint of the image acquisition procedure.
Definition: ObjectiveFunction.h:143
Definition: Transformation.h:55