![]() |
SuPReMo
0.1.1
|
#include <SlidingTransformation.h>


Public Types | |
| typedef Transformation::PrecisionType | PrecisionType |
Public Types inherited from Transformation | |
| typedef float | PrecisionType |
Public Member Functions | |
| SlidingTransformation (std::shared_ptr< Transformation >transformationAIn, std::shared_ptr< Transformation >transformationBIn, nifti_image *defSpaceImage, unsigned int numberOfLevels, unsigned int numberOfLevelsToPerform) | |
| SlidingTransformation (const SlidingTransformation &transformToCopy) | |
| ~SlidingTransformation () | |
| virtual void | InitialiseLevel (unsigned int level) |
| void | SetParameters (PrecisionType *parametersIn, bool parametersAreDisplacements) |
| virtual nifti_image * | GetDeformationVectorField (nifti_image *targetImageIn) |
| virtual SlidingTransformation::PrecisionType * | GetDVFGradientWRTTransformationParameters (nifti_image *denseDVFIn) |
| virtual SlidingTransformation::PrecisionType * | GetConstraintGradientWRTTransformationParameters () |
| double | GetConstraintValue () |
| virtual PrecisionType * | GetCopyOfParameters () |
| std::shared_ptr< Transformation > | DeepCopy () |
| void | DisplayTransformationParameters () |
| virtual PrecisionType | GetSumOfPenaltyWeights () |
| virtual PrecisionType | GetMaxTransformationParameterLength (PrecisionType *parametersIn) |
| std::vector< nifti_image * > | GetTransformationAsImage () |
| void | SetGapOverlapConstraintWeight (double gapOverlabConstraintWeightIn) |
| void | SetSignedDistanceMapImage (nifti_image *signedDistanceMapImageIn) |
Public Member Functions inherited from Transformation | |
| virtual | ~Transformation () |
| virtual void | InitialiseLevel (unsigned int level)=0 |
| virtual PrecisionType * | GetCopyOfParameters ()=0 |
| virtual unsigned int | GetNumberOfParameters () |
| virtual void | SetParameters (PrecisionType *paramsIn, bool parametersAreDisplacements)=0 |
| virtual nifti_image * | GetDeformationVectorField (nifti_image *targetImageIn)=0 |
| virtual PrecisionType * | GetDVFGradientWRTTransformationParameters (nifti_image *denseDVFIn)=0 |
| virtual PrecisionType * | GetConstraintGradientWRTTransformationParameters ()=0 |
| virtual double | GetConstraintValue ()=0 |
| void | TransformImage (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | TransformImageAdjoint (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| virtual std::shared_ptr< Transformation > | DeepCopy ()=0 |
| virtual void | DisplayTransformationParameters ()=0 |
| virtual PrecisionType | GetSumOfPenaltyWeights ()=0 |
| virtual void | GetImageGradientWRTDVF (nifti_image *sourceImage, nifti_image *outWarpedGradientImage) |
| void | ReorientateVectorImage (nifti_image *vectorFieldToReorientate, mat44 reorientationMatrix) |
| virtual PrecisionType | GetMaxTransformationParameterLength (PrecisionType *parametersIn)=0 |
| virtual std::vector< nifti_image * > | GetTransformationAsImage ()=0 |
| PrecisionType | GetPaddingValue () |
Private Member Functions | |
| void | ClearSignedDistanceMap () |
| void | ClearTransformedSignedDistanceMaps () |
| void | AllocateTransformedSignedDistanceMaps (nifti_image *targetImage) |
| double | CalculateGapOverlapConstraintTerm () |
| bool | TransformedSignedDistMapsCanBeUsedForConstraintCalculations () |
Private Attributes | |
| std::shared_ptr< Transformation > | transformA |
| The transformation defining the inside, i.e. SDT < 0. More... | |
| std::shared_ptr< Transformation > | transformB |
| The transformation defining the outside, i.e. SDT > 0. More... | |
| nifti_image * | signedDistMapImage |
| Nifti image holding the singed distance image in source-image space for the current level. More... | |
| std::shared_ptr< ImagePyramid< PrecisionType > > | defSpaceImagePyramid |
| The image pyramid holding the images in which the transformation is defined. Should correspond with those used to initilase the transfomrations A and B. Will be generated during construction. More... | |
| nifti_image * | curDefSpaceImage |
| Pointer to the current image within the defSpaceImagePyramid. More... | |
| int | lastInitialisedLevel |
| The last initialised level. This determines which level of the def space image pyramid is accessed. Will be set to -1 before initialisation. More... | |
| nifti_image * | signedDistMapImageTransformedA |
| Nfiti image holdeing the signed distance map transformed with transformA. More... | |
| nifti_image * | signedDistMapImageTransformedB |
| Nfiti image holdeing the signed distance map transformed with transformA. More... | |
| double | gapOverlapConstraintWeight |
| The gap-overlap-constraint weight. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Transformation | |
| bool | CheckDVFImageUpdateRequired (nifti_image *targetImageIn) |
| bool | CheckImageGeometryEquality (nifti_image *img1, nifti_image *img2) |
| virtual void | ClearDeformationVectorFieldImage () |
| void | CubicSplineTransformImage3D (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | CubicSplineTransformImage2D (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | NearestNeighbourTransformImage3D (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | NearestNeighbourTransformImage2D (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | TrilinearTransformImage (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | BilinearTransformImage (nifti_image *sourceImage, nifti_image *warpedImage) |
| void | CubicSplineTransformImageAdjoint3D (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | CubicSplineTransformImageAdjoint2D (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | NearestNeighbourTransformImageAdjoint3D (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | NearestNeighbourTransformImageAdjoint2D (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | TrilinearTransformImageAdjoint (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | BilinearTransformImageAdjoint (nifti_image *sourceImage, nifti_image *sourceWeightsImage, nifti_image *warpedImage, nifti_image *warpedWeightsImage) |
| void | TrilinearImageGradient (nifti_image *sourceImage, nifti_image *resultGradientImage) |
| void | BilinearImageGradient (nifti_image *sourceImage, nifti_image *resultGradientImage) |
| void | CubicSplineImageGradient3D (nifti_image *sourceImage, nifti_image *resultGradientImage) |
| void | CubicSplineImageGradient2D (nifti_image *sourceImage, nifti_image *resultGradientImage) |
Protected Attributes inherited from Transformation | |
| bool | dvfImageUpdateRequired |
| Indicates if the DVF requires re-calculation when it is required. More... | |
| unsigned int | numberOfParameters |
| The total number of parameters needed to describe the transformation. More... | |
| int | interpolation |
| Type of interpolation used. More... | |
| PrecisionType | warpedPaddingValue |
| Padding value for the warped image. More... | |
| nifti_image * | deformationVectorFieldImage |
| The deformation vector field image. More... | |
Class implementing the sliding transformation
| SlidingTransformation::SlidingTransformation | ( | std::shared_ptr< Transformation > | transformationAIn, |
| std::shared_ptr< Transformation > | transformationBIn, | ||
| nifti_image * | defSpaceImage, | ||
| unsigned int | numberOfLevels, | ||
| unsigned int | numberOfLevelsToPerform | ||
| ) |
Constructor to generate a sliding transformation object.
The sliding transformation is defined by two individual transformation objects, i.e. transformationA and transformationB.
| transformationAIn | Pointer to the first transformation. |
| transformationBIn | Pointer to the second transformation. |
| defSpaceImage | Image defining the area where the sliding-transformation specific constraint term will be calculated. |
| numberOfLevels | Number of pyramid levels. Required to correctly calculate the image pyramid of defSpaceImage. |
| numberOfLevelsToPerform | Number of levels to perform. See numberOfLevels. |
| SlidingTransformation::SlidingTransformation | ( | const SlidingTransformation & | transformToCopy | ) |
Copy constructor.
| transformToCopy | Reference to the sliding transformation object to copy. |
| SlidingTransformation::~SlidingTransformation | ( | ) |
Destructor.
|
private |
Allocate the transfomred signed distance maps
| targetImage | The target image defines the size of the allocated signed distance maps. |
|
private |
Calculate the gap and overlap constraint term from the transfomred signed distance maps.
|
private |
Delete this objet's copy of the signed distance image used.
|
private |
Delete the transfomred signed distance maps
|
virtual |
Function to create a deep copy of this object.
Implements Transformation.
|
virtual |
Display function to print the transformation parameters to the standard output
Implements Transformation.
|
virtual |
Calculate the gradient of the constraint term (regularisation) for the transformation with the current parameters.
Implements Transformation.
|
virtual |
Get the constraint value for the transformation with the current parameters.
Implements Transformation.
|
virtual |
Return a pointer to the parameters of the transformation
Implements Transformation.
|
virtual |
For a given target image, calculate a deformation vector field (DVF).
| targetImageIn | The target image defines the geometry of the DVF, or the voxel locations for which deformation vectors are calculated. |
ToDo: make parallel
Implements Transformation.
|
virtual |
Calculates the gradient of an image for a given deformation vector field.
| denseDVFIn | Deformation vector field |
Implements Transformation.
|
virtual |
Calculate the maximum control-point displacement value for the given transformation parametes.
Implements Transformation.
|
virtual |
Calculates the sum of the penalty term weights. Responsibility of the correct scaling of the penalty term lies with the generating function.
Implements Transformation.
|
virtual |
Returns the transformation as an image.
Implements Transformation.
|
virtual |
Initialise a given level. Call the initialisation for the individual transformations and update the current defSpaceImage.
| level | Defines the level that is to be initialised. |
Implements Transformation.
| void SlidingTransformation::SetGapOverlapConstraintWeight | ( | double | gapOverlabConstraintWeightIn | ) |
Set the sliding-transformation specific constraint weight. Higher values will result in less gaps and overlaps.
| gapOverlabConstraintWeightIn | Weight of the gap-overlap constraint term. |
|
virtual |
Set the parameters that define the sliding transformation.
| parametersIn | Pointer to the parameters that will be copied to the internal transformation parameters. |
| parametersAreDisplacements | Set to true if the parameters are displacements. |
Implements Transformation.
| void SlidingTransformation::SetSignedDistanceMapImage | ( | nifti_image * | signedDistanceMapImageIn | ) |
Set the signed distance map image used to determine the sliding boundary. This function generates a local copy of this image
| signedDistanceMapImageIn | Nifti image of the signed distance map in the source image space. |
|
private |
Checks the geometry of the transformed signed distance map and the (current) image defining the space where the sliding constraint is calculated.
|
private |
Pointer to the current image within the defSpaceImagePyramid.
|
private |
The image pyramid holding the images in which the transformation is defined. Should correspond with those used to initilase the transfomrations A and B. Will be generated during construction.
|
private |
The gap-overlap-constraint weight.
|
private |
The last initialised level. This determines which level of the def space image pyramid is accessed. Will be set to -1 before initialisation.
|
private |
Nifti image holding the singed distance image in source-image space for the current level.
|
private |
Nfiti image holdeing the signed distance map transformed with transformA.
|
private |
Nfiti image holdeing the signed distance map transformed with transformA.
|
private |
The transformation defining the inside, i.e. SDT < 0.
|
private |
The transformation defining the outside, i.e. SDT > 0.