SuPReMo  0.1.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Supremo Class Reference

#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< Transformationtransform
 Pointer to the transformation used (e.g. b-spline) More...
 
std::shared_ptr< CorrespondenceModelcorrespondenceModel
 Pointer to the correspondence model. More...
 
std::shared_ptr< ImageSimilaritysimilarityMeasure
 Pointer to the image similarity measure used. More...
 
std::shared_ptr< ImageAcquisitionimageAcquisition
 Pointer to the image acquisition used. More...
 
std::shared_ptr< MoCoReconmocoReconstructor
 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...
 

Detailed Description

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.

Member Typedef Documentation

◆ VoxelType

typedef float Supremo::VoxelType

Constructor & Destructor Documentation

◆ Supremo()

Supremo::Supremo ( )

Constructor

◆ ~Supremo()

Supremo::~Supremo ( )

Destructor

Member Function Documentation

◆ CheckParameters()

void Supremo::CheckParameters ( )
private

Checks that all parameters for fitting and reconstruction were provided correctly.

◆ DisplayCurrentLevelParameters()

void Supremo::DisplayCurrentLevelParameters ( unsigned int  level)
private

Display some parameters of the current levels including image resolution, transformation parameters, etc.

Parameters
levelThe level number

◆ FitMotionModelAndReconstruct()

void Supremo::FitMotionModelAndReconstruct ( )

Fit a motion model and perform motion compensated image reconstruction

◆ GenerateDVFsFromCorrespondenceModel()

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.

Returns
A vector holding the pointers to the DVFs for the defined surrogate values.

◆ GetCorrespondenceModelAsImage()

std::vector< nifti_image * > Supremo::GetCorrespondenceModelAsImage ( )

Get the respiratory correspondence model after model fitting

Returns
Vecotr with pointers to the nifti images representing the correspondence model. These will usually be a 5d nifti images.
Note
The correspondence model image depends on the transformation model used.

◆ GetMotionCompensatedReconstructedImage()

nifti_image * Supremo::GetMotionCompensatedReconstructedImage ( )
inline

Get the resulting motion-compensated reconstructed image.

Returns
Pointer to the image holding the final MCR iamge. This image will be deallocated by this class on destruction.

◆ Initialise()

void Supremo::Initialise ( )
private

Initillise the fitting and reconstruction method

  • Checks that all parameters were set correctly.
  • Generates the image pyramids.

Todo: Remove transform. Does not need to be a member variable!

◆ SaveInterMCRToImage()

void Supremo::SaveInterMCRToImage ( nifti_image *  mcrImage)
private

Save the current MCR image to file. The string levelID info will be used to determine the output

Parameters
mcrImageThe reconstructed image that will be saved to the defined output directory.

◆ SetBSplineBendingEnergy()

void Supremo::SetBSplineBendingEnergy ( float  be)

Set the bending energy weight for the B-spline regularisation

Parameters
beBending energy weight to set

◆ SetBSplineCPGSpacing()

void Supremo::SetBSplineCPGSpacing ( float  sx,
float  sy,
float  sz 
)

Set the control point spacing of the B-spline control point grid

Parameters
sxControl point spacing in x direction
syControl point spacing in y direction
szControl point spacing in z direction

◆ SetBSplineLinearEnergy()

void Supremo::SetBSplineLinearEnergy ( float  le)

Set the linear energy weight for the B-spline regularisation

Parameters
leLinear energy weight to set

◆ SetDefSpaceImage()

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.

Parameters
defSpaceImageInPointer to a nifti image that defines the space of the deforemd images.

◆ SetDynamicImages()

void Supremo::SetDynamicImages ( nifti_image **  dynamicImagesIn,
int  numberOfDynamicImagesIn 
)

Set all dynamic images. Used to set a number of externally loaded dynamic images.

Parameters
dynamicImagesInPointer to the dynamic images.
numberOfDynamicImagesInNumber of dynamic images, i.e. length of the pointer above.

◆ SetImageAcquisition()

void Supremo::SetImageAcquisition ( std::shared_ptr< ImageAcquisition imageAcquisitionIn)

Set an image acquisition object. Has to be created externally.

◆ SetInputRCMImages()

void Supremo::SetInputRCMImages ( const std::vector< nifti_image * > &  inputRCMImgs)
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.

Parameters
inputRCMImgsVector holding image pointers to the input respiratory correspondence model images.

◆ SetInterGradOutputFolder()

void Supremo::SetInterGradOutputFolder ( const std::string &  outputFolder)

Set the folder to which intermediate objective function gradients will be saved

Parameters
outputFolder

◆ SetInterMCROutputFolder()

void Supremo::SetInterMCROutputFolder ( const std::string &  outputFolder)

Set the folder to which intermediate MCR results will be saved

Parameters
outputFolder

◆ SetMaxModelFittingIterationNumber()

void Supremo::SetMaxModelFittingIterationNumber ( unsigned int  maxModelFittingIterations)
inline

Set the number of iterations used to fit the motion model.

Parameters
maxModelFittingIterationsMaximum number of model fitting iterations

◆ SetMaxSwitchIterationNumber()

void Supremo::SetMaxSwitchIterationNumber ( unsigned int  maxSwitchIterations)
inline

Set the number of switch iterations. Determines how often the method iterates between model fitting and motion-compensated image reconstruction.

Parameters
maxSwitchIterationsMaximum number of switch iterations

◆ SetMotionCompensatedReconstruction()

void Supremo::SetMotionCompensatedReconstruction ( std::shared_ptr< MoCoRecon mocoReconstructionIn)

Set the motion compensated image reconstruction object.

Note
The image acquisition has to be passed on to the reconstruction externally - no longer set internally by SuPReMo.
Parameters
mocoReconstructionInObject that implements a motion compensated image reconstruction.

◆ SetNumberOfPyramidLevels()

void Supremo::SetNumberOfPyramidLevels ( unsigned int  numberOfLevelsIn)
inline

Set the number of pyramid levels

Parameters
numberOfLevelsInTotal number of pyramid levels

◆ SetNumberOfPyramidLevelsToPerform()

void Supremo::SetNumberOfPyramidLevelsToPerform ( unsigned int  numberOfLevelsToPerformIn)
inline

Set the number of pyramid levels on which a computation should be performed.

Parameters
numberOfLevelsToPerformInNmber of pyramid levels. Has to be equal or smaller than the value set with SetNumberOfPyramidLevels().

◆ SetReferenceStateImage()

void Supremo::SetReferenceStateImage ( nifti_image *  referenceStateImageIn)

Set the reference state image \( \mathbf{I}_0 \). This image was known as static or source image.

Parameters
referenceStateImageInPointer to the nifti_image holding the static image.

◆ SetSlidingGapOverlapConstraintWeight()

void Supremo::SetSlidingGapOverlapConstraintWeight ( float  gapOverlapConstraintWeightIn)

Set the gap/overlap constraint weight. This weight only has an effect if the sliding transformation is being used.

Parameters
gapOverlapConstraintWeightInGap/overlap constraint weight.

◆ SetSlidingTrafoDistanceMap()

void Supremo::SetSlidingTrafoDistanceMap ( nifti_image *  slidingTrafoDistanceMapIn)

Set the distance map for the sliding transformation

Parameters
slidingTrafoDistanceMapInPointer to the nifti image structure holding the sliding transformation

◆ SetSurrogateSignals()

void Supremo::SetSurrogateSignals ( float *  surrogateSignalsIn,
int  numberOfSurrogateSignalsIn 
)

Set the surrogate data.

Note
This function must be called after the dynamic images were set.
Parameters
surrogateSignalsInPointer to the surrogate data. Has to be of size numberOfSurrogateSignalsIn*numberOfDynamicImages.
numberOfSurrogateSignalsInNumber of surrogate signals per dynamic image.

◆ SetTransformationType()

void Supremo::SetTransformationType ( t_transformationType  transformationTypeIn)

Set the transformation type used

Parameters
transformationTypeInTransformation type

◆ SimulateDynamicImages()

std::vector< nifti_image * > Supremo::SimulateDynamicImages ( )

Once a motion model was fitted (or input), use the results to simulate the dynamic images

Returns
A vector holding the pointers to the simulated dynamic images

Member Data Documentation

◆ allDynamicImages

nifti_image** Supremo::allDynamicImages
private

Pointer to all dynamic nifti images available.

◆ allDynamicPyramids

std::vector<std::shared_ptr<ImagePyramid<VoxelType> > > Supremo::allDynamicPyramids
private

Vector of pointers holding all the dynamic image pyramids.

◆ bSplineBendingEnergyWeight

float Supremo::bSplineBendingEnergyWeight
private

Bending energy weight to constrain a b-spline transformation.

◆ bSplineCPGSpacing

float Supremo::bSplineCPGSpacing[3]
private

B-spline control point spacing (used if b-spline transformation is used)

◆ bSplineLinearEnergyWeight

float Supremo::bSplineLinearEnergyWeight
private

Linear energy weight to constrain a b-spline transformation.

◆ correspondenceModel

std::shared_ptr<CorrespondenceModel> Supremo::correspondenceModel
private

Pointer to the correspondence model.

◆ currentLevel

unsigned int Supremo::currentLevel
private

The current level that is being processed.

◆ currentReferenceStateImage

nifti_image* Supremo::currentReferenceStateImage
private

◆ defSpaceImage

nifti_image* Supremo::defSpaceImage
private

Pointer to image that defines the space of the deformed images.

◆ finalMoCoReconImage

nifti_image* Supremo::finalMoCoReconImage
private

Pointer holding the final motion-compensated reconstruction image after fit and reconstruct.

◆ imageAcquisition

std::shared_ptr<ImageAcquisition> Supremo::imageAcquisition
private

Pointer to the image acquisition used.

◆ initialised

bool Supremo::initialised
private

Control parameter indicating if the fit-and-reconstruct method was initialised.

◆ inputRCMImages

std::vector<nifti_image*> Supremo::inputRCMImages
private

The vector holding the pointer to the respiratory correspondence model images. Will be used as a starting point of the optimisation.

◆ levelID

std::string Supremo::levelID
private

String holding an ID to differentiate file output from various multi-resolution levels and MCR iterations.

◆ maxModelFitIterationNumber

unsigned int Supremo::maxModelFitIterationNumber
private

Maximum number of respiratory correspondence model fitting iterations.

◆ maxSwitchIterationNumber

unsigned int Supremo::maxSwitchIterationNumber
private

Maximum number of times to iterate between motion compensated reconstruction and fitting the respiratory correspondence model.

◆ mocoReconstructor

std::shared_ptr<MoCoRecon> Supremo::mocoReconstructor
private

The motion-compensated image reconstruction object.

◆ numberOfDynamicImages

unsigned int Supremo::numberOfDynamicImages
private

Total number of dynamic images.

◆ numberOfLevels

unsigned int Supremo::numberOfLevels
private

The total number of levels.

◆ numberOfLevelsToPerform

unsigned int Supremo::numberOfLevelsToPerform
private

The number of levels that are used in the fitting/reconstruction process.

◆ numberOfSurrogateSignals

unsigned int Supremo::numberOfSurrogateSignals
private

Number of surrogate signals (per dynamic image)

◆ outputInterGradientFolder

std::string Supremo::outputInterGradientFolder
private

Folder to which intermediate objective function gradients will be saved.

◆ outputInterMCRFolder

std::string Supremo::outputInterMCRFolder
private

Folder to which intermediate MCRs will be saved.

◆ referenceStateImage

nifti_image* Supremo::referenceStateImage
private

Pointer to the reference state image \( \mathbf{I}_0 \).

◆ referenceStatePyramid

std::shared_ptr<ImagePyramid<VoxelType> > Supremo::referenceStatePyramid
private

Pointer holding the reference state image pyramid.

◆ similarityMeasure

std::shared_ptr<ImageSimilarity> Supremo::similarityMeasure
private

Pointer to the image similarity measure used.

◆ slidingGapOverlapConstraintWeight

float Supremo::slidingGapOverlapConstraintWeight
private

The weight with which the gaps and overlaps will be constrained.

◆ slidingSignedDistanceMapImage

nifti_image* Supremo::slidingSignedDistanceMapImage
private

Image required by the sliding transformation to determine the regions involved.

◆ surrogateSignals

std::vector<std::vector<float> > Supremo::surrogateSignals
private

Vector of vector containing the the surrogate signals. First index for time point, second for surrogate signal number.

surrogateSignals[time][surrNumber] 

◆ transform

std::shared_ptr<Transformation> Supremo::transform
private

Pointer to the transformation used (e.g. b-spline)

◆ transformationType

t_transformationType Supremo::transformationType
private

The transformation type used to deform the reference-state image.


The documentation for this class was generated from the following files: