SuPReMo
0.1.1
|
#include <CorrespondenceModel.h>
Public Types | |
typedef float | PrecisionType |
typedef std::vector< PrecisionType > | SurrogateSignalType |
Public Member Functions | |
CorrespondenceModel (unsigned int numberOfSurrogateSignalsIn, std::shared_ptr< Transformation > transformationIn) | |
~CorrespondenceModel () | |
std::shared_ptr< Transformation > | GetTransformationFromSurrogateSignal (const SurrogateSignalType &surrogateSignalIn) |
PrecisionType * | GetParameters () |
void | SetParameters (const PrecisionType *parametersIn) |
void | SetParameters (const std::vector< nifti_image * > ¶meterImagesIn) |
PrecisionType | GetMaxParameterLength (PrecisionType *parametersIn) |
unsigned int | GetNumberOfParameters () |
void | GetTransformationParameterGradientWRTModelParameters (PrecisionType *transformationGradientIn, const SurrogateSignalType &surrogateSignalIn, PrecisionType *correspondenceModelGradientOut) |
void | InitialiseLevel (unsigned int levelIn) |
std::shared_ptr< Transformation > | GetTransformation () |
std::vector< nifti_image * > | GetCorrespondenceModelAsImage () |
void | SaveCurrentModelParametersForRecovery () |
void | RecoverSavedModelParameters () |
Private Member Functions | |
void | ClearRecoveryModelParameters () |
Private Attributes | |
unsigned int | numberOfSurrogateSignals |
The number of surrogate signals used. More... | |
unsigned int | numberOfTransformationParameters |
The number of parameters to describe the transformation completely. More... | |
unsigned int | numberOfModelParameters |
The total number of parameters describing the correspondence model. More... | |
std::shared_ptr< Transformation > | transform |
The internal transformation object that is used to construct a transformation (copy) from a surrogate signal. More... | |
PrecisionType * | modelParameters |
Pointer to the model parameters. More... | |
PrecisionType * | recoveryModelParameters |
Pointer to model parameters that may be recovered. More... | |
Class implementing the (respiratory) correspondence model.
typedef float CorrespondenceModel::PrecisionType |
typedef std::vector<PrecisionType> CorrespondenceModel::SurrogateSignalType |
CorrespondenceModel::CorrespondenceModel | ( | unsigned int | numberOfSurrogateSignalsIn, |
std::shared_ptr< Transformation > | transformationIn | ||
) |
Constructor.
numberOfSurrogateSignalsIn | The number of surrogate signals for this correspondence model. |
transformationIn | The base transformation that is internally used to generate a transformation from input surrogate signals |
CorrespondenceModel::~CorrespondenceModel | ( | ) |
Destructor.
|
private |
Free the memory allocated to store the recovery model parameters and set the corresponding pointer to null.
std::vector< nifti_image * > CorrespondenceModel::GetCorrespondenceModelAsImage | ( | ) |
Generates a vector with nifti images which can be saved. The data of the images will be allocated for the images, so they are detached from the internal representation of the correspondence model. The transformations can have multiple images so each image returned by this function reflects the number of images of the underlying transformation.
CorrespondenceModel::PrecisionType CorrespondenceModel::GetMaxParameterLength | ( | PrecisionType * | parametersIn | ) |
Function used to calculate the gradient length, which in turn is used to normalise the gradient of the objective function. The correspondence model class defines the relationship between the respiratory correspondence model parameters and the transformation parameters. This is dependent on the number of surrogate signals. The maximum transformation parameter length will be calculated by the member transformation.
|
inline |
Get the number of parameters.
CorrespondenceModel::PrecisionType * CorrespondenceModel::GetParameters | ( | ) |
Get access to the current parameters. A pointer to \( \mathbf{R} \) is returned.
std::shared_ptr< Transformation > CorrespondenceModel::GetTransformation | ( | ) |
Get a pointer to the transformation. Allow other objects, such as the ObjectiveFunction to use methods provided by the transformation
std::shared_ptr< Transformation > CorrespondenceModel::GetTransformationFromSurrogateSignal | ( | const SurrogateSignalType & | surrogateSignalIn | ) |
Calculate the transformation parameters for a given surrogate signal on the basis of the current model parameters. \( \mathbf{M}_t(\mathbf{S}_t) \).
surrogateSignalIn | Pointer to the surrogate values \( \mathbf{S}_t \). Get a transformatinon object corresponding to a surrogate signal. Checks the size of the surrogate signal. |
void CorrespondenceModel::GetTransformationParameterGradientWRTModelParameters | ( | CorrespondenceModel::PrecisionType * | transformationGradientIn, |
const SurrogateSignalType & | surrogateSignalIn, | ||
CorrespondenceModel::PrecisionType * | correspondenceModelGradientOut | ||
) |
Get the gradient of the transformation parametres with respect to the model parametres. This function implements \( \frac{\partial \mathbf{M}_t }{\partial \mathbf{R} } \). Adds calculates the correspondence model gradient
void CorrespondenceModel::InitialiseLevel | ( | unsigned int | levelIn | ) |
Initialise the given level. The transformation will be used to upsample the model parameters.
void CorrespondenceModel::RecoverSavedModelParameters | ( | ) |
Recover correspondence model parameters that were previously saved. Parameters for recovery have to be saved previously using CorrespondenceModel::SaveCurrentModelParametersForRecovery().
void CorrespondenceModel::SaveCurrentModelParametersForRecovery | ( | ) |
Save the current model parameters to an internal variable such that they can be recovered if necessary by CorrespondenceModel::RecoverSavedModelParameters().
void CorrespondenceModel::SetParameters | ( | const PrecisionType * | parametersIn | ) |
Set the current parameters. The internal data of \( \mathbf{R} \) will be updated (i.e. copied).
void CorrespondenceModel::SetParameters | ( | const std::vector< nifti_image * > & | parameterImagesIn | ) |
Set the current parameters from the given input images. This function takes the image intensity and sets it as the correspondence model parameters. At the moment only the total number of parameters is tested.
parameterImagesIn | Vectore with images holding the correspondence model parameters. |
|
private |
Pointer to the model parameters.
|
private |
The total number of parameters describing the correspondence model.
|
private |
The number of surrogate signals used.
|
private |
The number of parameters to describe the transformation completely.
|
private |
Pointer to model parameters that may be recovered.
|
private |
The internal transformation object that is used to construct a transformation (copy) from a surrogate signal.