![]() |
SuPReMo
0.1.1
|
#include <Supremo.h>
Public Types | |
typedef float | VoxelType |
Public Member Functions | |
Supremo () | |
~Supremo () | |
void | FitMotionModelAndReconstruct () |
void | SetDynamicImages (nifti_image **dynamicImagesIn, int numberOfDynamicImagesIn) |
void | SetReferenceStateImage (nifti_image *referenceStateImageIn) |
void | SetSurrogateSignals (float *surrogateSignalsIn, int numberOfSurrogateSignalsIn) |
void | SetDefSpaceImage (nifti_image *defSpaceImageIn) |
void | SetImageAcquisition (std::shared_ptr< ImageAcquisition > imageAcquisitionIn) |
void | SetMotionCompensatedReconstruction (std::shared_ptr< MoCoRecon > mocoReconstructionIn) |
void | SetInterMCROutputFolder (const std::string &outputFolder) |
void | SetInterGradOutputFolder (const std::string &outputFolder) |
void | SetTransformationType (t_transformationType transformationTypeIn) |
void | SetSlidingTrafoDistanceMap (nifti_image *slidingTrafoDistanceMapIn) |
void | SetSlidingGapOverlapConstraintWeight (float gapOverlapConstraintWeightIn) |
void | SetBSplineCPGSpacing (float sx, float sy, float sz) |
void | SetBSplineBendingEnergy (float be) |
void | SetBSplineLinearEnergy (float le) |
void | SetNumberOfPyramidLevels (unsigned int numberOfLevelsIn) |
void | SetNumberOfPyramidLevelsToPerform (unsigned int numberOfLevelsToPerformIn) |
void | SetMaxModelFittingIterationNumber (unsigned int maxModelFittingIterations) |
void | SetMaxSwitchIterationNumber (unsigned int maxSwitchIterations) |
void | SetInputRCMImages (const std::vector< nifti_image * > &inputRCMImgs) |
std::vector< nifti_image * > | GetCorrespondenceModelAsImage () |
nifti_image * | GetMotionCompensatedReconstructedImage () |
std::vector< nifti_image * > | SimulateDynamicImages () |
std::vector< nifti_image * > | GenerateDVFsFromCorrespondenceModel () |
Private Member Functions | |
void | Initialise () |
void | CheckParameters () |
void | DisplayCurrentLevelParameters (unsigned int level) |
void | SaveInterMCRToImage (nifti_image *mcrImage) |
Private Attributes | |
unsigned int | numberOfSurrogateSignals |
Number of surrogate signals (per dynamic image) More... | |
unsigned int | numberOfDynamicImages |
Total number of dynamic images. More... | |
nifti_image ** | allDynamicImages |
Pointer to all dynamic nifti images available. More... | |
nifti_image * | referenceStateImage |
Pointer to the reference state image \( \mathbf{I}_0 \). More... | |
nifti_image * | finalMoCoReconImage |
Pointer holding the final motion-compensated reconstruction image after fit and reconstruct. More... | |
std::vector< std::vector< float > > | surrogateSignals |
Vector of vector containing the the surrogate signals. First index for time point, second for surrogate signal number. More... | |
nifti_image * | defSpaceImage |
Pointer to image that defines the space of the deformed images. More... | |
std::vector< nifti_image * > | inputRCMImages |
The vector holding the pointer to the respiratory correspondence model images. Will be used as a starting point of the optimisation. More... | |
unsigned int | maxSwitchIterationNumber |
Maximum number of times to iterate between motion compensated reconstruction and fitting the respiratory correspondence model. More... | |
unsigned int | maxModelFitIterationNumber |
Maximum number of respiratory correspondence model fitting iterations. More... | |
unsigned int | numberOfLevels |
The total number of levels. More... | |
unsigned int | numberOfLevelsToPerform |
The number of levels that are used in the fitting/reconstruction process. More... | |
unsigned int | currentLevel |
The current level that is being processed. More... | |
t_transformationType | transformationType |
The transformation type used to deform the reference-state image. More... | |
float | bSplineCPGSpacing [3] |
B-spline control point spacing (used if b-spline transformation is used) More... | |
float | bSplineBendingEnergyWeight |
Bending energy weight to constrain a b-spline transformation. More... | |
float | bSplineLinearEnergyWeight |
Linear energy weight to constrain a b-spline transformation. More... | |
nifti_image * | slidingSignedDistanceMapImage |
Image required by the sliding transformation to determine the regions involved. More... | |
float | slidingGapOverlapConstraintWeight |
The weight with which the gaps and overlaps will be constrained. More... | |
std::string | outputInterMCRFolder |
Folder to which intermediate MCRs will be saved. More... | |
std::string | outputInterGradientFolder |
Folder to which intermediate objective function gradients will be saved. More... | |
bool | initialised |
Control parameter indicating if the fit-and-reconstruct method was initialised. More... | |
std::shared_ptr< ImagePyramid< VoxelType > > | referenceStatePyramid |
Pointer holding the reference state image pyramid. More... | |
std::vector< std::shared_ptr< ImagePyramid< VoxelType > > > | allDynamicPyramids |
Vector of pointers holding all the dynamic image pyramids. More... | |
nifti_image * | currentReferenceStateImage |
std::shared_ptr< Transformation > | transform |
Pointer to the transformation used (e.g. b-spline) More... | |
std::shared_ptr< CorrespondenceModel > | correspondenceModel |
Pointer to the correspondence model. More... | |
std::shared_ptr< ImageSimilarity > | similarityMeasure |
Pointer to the image similarity measure used. More... | |
std::shared_ptr< ImageAcquisition > | imageAcquisition |
Pointer to the image acquisition used. More... | |
std::shared_ptr< MoCoRecon > | mocoReconstructor |
The motion-compensated image reconstruction object. More... | |
std::string | levelID |
String holding an ID to differentiate file output from various multi-resolution levels and MCR iterations. More... | |
Class that implements the generalised motion modelling framework by McClelland et al. (2017). This class implements the generalised motion modelling framework and is the main class that determines flow control, data handling etc.
typedef float Supremo::VoxelType |
Supremo::Supremo | ( | ) |
Constructor
Supremo::~Supremo | ( | ) |
Destructor
|
private |
Checks that all parameters for fitting and reconstruction were provided correctly.
|
private |
Display some parameters of the current levels including image resolution, transformation parameters, etc.
level | The level number |
void Supremo::FitMotionModelAndReconstruct | ( | ) |
Fit a motion model and perform motion compensated image reconstruction
std::vector< nifti_image * > Supremo::GenerateDVFsFromCorrespondenceModel | ( | ) |
Once a motion model was fitted (or input), use the results to calculate the deformation vector fields. The requested DVFs will have the size of the dynamic images.
std::vector< nifti_image * > Supremo::GetCorrespondenceModelAsImage | ( | ) |
Get the respiratory correspondence model after model fitting
|
inline |
Get the resulting motion-compensated reconstructed image.
|
private |
Initillise the fitting and reconstruction method
Todo: Remove transform. Does not need to be a member variable!
|
private |
Save the current MCR image to file. The string levelID info will be used to determine the output
mcrImage | The reconstructed image that will be saved to the defined output directory. |
void Supremo::SetBSplineBendingEnergy | ( | float | be | ) |
Set the bending energy weight for the B-spline regularisation
be | Bending energy weight to set |
void Supremo::SetBSplineCPGSpacing | ( | float | sx, |
float | sy, | ||
float | sz | ||
) |
Set the control point spacing of the B-spline control point grid
sx | Control point spacing in x direction |
sy | Control point spacing in y direction |
sz | Control point spacing in z direction |
void Supremo::SetBSplineLinearEnergy | ( | float | le | ) |
Set the linear energy weight for the B-spline regularisation
le | Linear energy weight to set |
void Supremo::SetDefSpaceImage | ( | nifti_image * | defSpaceImageIn | ) |
Set an image to define the space of the deformed images. Image used to define the space of the deformed images. This image is used to define the extent and resolution (if specified in voxels) of the model and transform CPGs. If a defSpace image is not specified the reference state image will be used.
defSpaceImageIn | Pointer to a nifti image that defines the space of the deforemd images. |
void Supremo::SetDynamicImages | ( | nifti_image ** | dynamicImagesIn, |
int | numberOfDynamicImagesIn | ||
) |
Set all dynamic images. Used to set a number of externally loaded dynamic images.
dynamicImagesIn | Pointer to the dynamic images. |
numberOfDynamicImagesIn | Number of dynamic images, i.e. length of the pointer above. |
void Supremo::SetImageAcquisition | ( | std::shared_ptr< ImageAcquisition > | imageAcquisitionIn | ) |
Set an image acquisition object. Has to be created externally.
|
inline |
Set the input RCM correspondence model. The values of this image/these image(s) will be used as a starting point of the optimisation. Multiple RCMs can occur if the sliding transforation was used.
inputRCMImgs | Vector holding image pointers to the input respiratory correspondence model images. |
void Supremo::SetInterGradOutputFolder | ( | const std::string & | outputFolder | ) |
Set the folder to which intermediate objective function gradients will be saved
outputFolder |
void Supremo::SetInterMCROutputFolder | ( | const std::string & | outputFolder | ) |
Set the folder to which intermediate MCR results will be saved
outputFolder |
|
inline |
Set the number of iterations used to fit the motion model.
maxModelFittingIterations | Maximum number of model fitting iterations |
|
inline |
Set the number of switch iterations. Determines how often the method iterates between model fitting and motion-compensated image reconstruction.
maxSwitchIterations | Maximum number of switch iterations |
void Supremo::SetMotionCompensatedReconstruction | ( | std::shared_ptr< MoCoRecon > | mocoReconstructionIn | ) |
Set the motion compensated image reconstruction object.
mocoReconstructionIn | Object that implements a motion compensated image reconstruction. |
|
inline |
Set the number of pyramid levels
numberOfLevelsIn | Total number of pyramid levels |
|
inline |
Set the number of pyramid levels on which a computation should be performed.
numberOfLevelsToPerformIn | Nmber of pyramid levels. Has to be equal or smaller than the value set with SetNumberOfPyramidLevels(). |
void Supremo::SetReferenceStateImage | ( | nifti_image * | referenceStateImageIn | ) |
Set the reference state image \( \mathbf{I}_0 \). This image was known as static or source image.
referenceStateImageIn | Pointer to the nifti_image holding the static image. |
void Supremo::SetSlidingGapOverlapConstraintWeight | ( | float | gapOverlapConstraintWeightIn | ) |
Set the gap/overlap constraint weight. This weight only has an effect if the sliding transformation is being used.
gapOverlapConstraintWeightIn | Gap/overlap constraint weight. |
void Supremo::SetSlidingTrafoDistanceMap | ( | nifti_image * | slidingTrafoDistanceMapIn | ) |
Set the distance map for the sliding transformation
slidingTrafoDistanceMapIn | Pointer to the nifti image structure holding the sliding transformation |
void Supremo::SetSurrogateSignals | ( | float * | surrogateSignalsIn, |
int | numberOfSurrogateSignalsIn | ||
) |
Set the surrogate data.
surrogateSignalsIn | Pointer to the surrogate data. Has to be of size numberOfSurrogateSignalsIn*numberOfDynamicImages. |
numberOfSurrogateSignalsIn | Number of surrogate signals per dynamic image. |
void Supremo::SetTransformationType | ( | t_transformationType | transformationTypeIn | ) |
Set the transformation type used
transformationTypeIn | Transformation type |
std::vector< nifti_image * > Supremo::SimulateDynamicImages | ( | ) |
Once a motion model was fitted (or input), use the results to simulate the dynamic images
|
private |
Pointer to all dynamic nifti images available.
|
private |
Vector of pointers holding all the dynamic image pyramids.
|
private |
Bending energy weight to constrain a b-spline transformation.
|
private |
B-spline control point spacing (used if b-spline transformation is used)
|
private |
Linear energy weight to constrain a b-spline transformation.
|
private |
Pointer to the correspondence model.
|
private |
The current level that is being processed.
|
private |
|
private |
Pointer to image that defines the space of the deformed images.
|
private |
Pointer holding the final motion-compensated reconstruction image after fit and reconstruct.
|
private |
Pointer to the image acquisition used.
|
private |
Control parameter indicating if the fit-and-reconstruct method was initialised.
|
private |
The vector holding the pointer to the respiratory correspondence model images. Will be used as a starting point of the optimisation.
|
private |
String holding an ID to differentiate file output from various multi-resolution levels and MCR iterations.
|
private |
Maximum number of respiratory correspondence model fitting iterations.
|
private |
Maximum number of times to iterate between motion compensated reconstruction and fitting the respiratory correspondence model.
|
private |
The motion-compensated image reconstruction object.
|
private |
Total number of dynamic images.
|
private |
The total number of levels.
|
private |
The number of levels that are used in the fitting/reconstruction process.
|
private |
Number of surrogate signals (per dynamic image)
|
private |
Folder to which intermediate objective function gradients will be saved.
|
private |
Folder to which intermediate MCRs will be saved.
|
private |
Pointer to the reference state image \( \mathbf{I}_0 \).
|
private |
Pointer holding the reference state image pyramid.
|
private |
Pointer to the image similarity measure used.
|
private |
The weight with which the gaps and overlaps will be constrained.
|
private |
Image required by the sliding transformation to determine the regions involved.
|
private |
Vector of vector containing the the surrogate signals. First index for time point, second for surrogate signal number.
surrogateSignals[time][surrNumber]
|
private |
Pointer to the transformation used (e.g. b-spline)
|
private |
The transformation type used to deform the reference-state image.