|
|
Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages |
#include <elxTransformBase.h>
This class is the elastix base class for all Transforms.
This class contains the common functionality for all Transforms.
The parameters used in this class are:




UseDirectionCosines: Controls whether to use or ignore the direction cosines (world matrix, transform matrix) set in the images. Voxel spacing and image origin are always taken into account, regardless the setting of this parameter.
example: (UseDirectionCosines "true")
Default: true. Setting it to false means that you choose to ignore important information from the image, which relates voxel coordinates to world coordinates. Ignoring it may easily lead to left/right swaps for example, which could skrew up a (medical) analysis.
HowToCombineTransforms: Indicates how to use the initial transform (given by the command-line argument -t0, or, if using multiple parameter files, by the result of registration using the previous parameter file). Possible options are "Add" and "Compose".
"Add" combines the initial transform 


"Compose" by composition: 
example: (HowToCombineTransforms "Add")
Default: "Compose".
Size: The size (number of voxels in each dimension) of the fixed image that was used during registration, and which is used for resampling the deformed moving image.
example: (Size 100 90 90)
Mandatory parameter.
Index: The starting index of the fixed image region that was used during registration, and which is used for resampling the deformed moving image.
example: (Index 0 0 0)
Currently always zero.
Spacing: The voxel spacing of the fixed image that was used during registration, and which is used for resampling the deformed moving image.
example: (Spacing 1.0 1.0 1.0)
Default: 1.0 for each dimension.
Origin: The origin (location of the first voxel in world coordinate) of the fixed image that was used during registration, and which is used for resampling the deformed moving image.
example: (Origin 5.0 10.0 11.0)
Default: 0.0 for each dimension.
Direction: The direction cosines matrix of the fixed image that was used during registration, and which is used for resampling the deformed moving image if the UseDirectionCosines parameter is set to "true".
The matrix elements must be sorted as follows: [ d11 d21 d31 d12 d22 d32 d13 d23 d33] (in 3D). So the elements must be specified in column-major order (Fortran-style). Please note: This is not the same as ITK's convention of using row-major order (C-style) for flattening the direction matrix of an image into a list.
example: (Direction -1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.1)
Default: identity matrix.
TransformParameters: the transform parameter vector that defines the transformation.
example (TransformParameters 0.03 1.0 0.2 ...)
The number of entries is stored the NumberOfParameters entry.
NumberOfParameters: the length of the transform parameter vector.
example (NumberOfParameters 722)
InitialTransformParameterFileName: The location/name of an initial transform that will be loaded when loading the current transform parameter file. Note that transform parameter file can also contain an initial transform. Recursively all transforms are thus automatically loaded when loading the last transform parameter file.
example (InitialTransformParameterFileName "./res/TransformParameters.0.txt")
The location is relative to the path from where elastix/transformix is started!
Default: "NoInitialTransform", which (obviously) means that there is no initial transform to be loaded.
InitialTransformParametersFileName: legacy parameter name, replaced with "InitialTransformParameterFileName", and deprecated from June 2023.
The command line arguments used by this class are:
-t0: optional argument for elastix for specifying an initial transform parameter file.
example: -t0 TransformParameters.txt
-def: optional argument for transformix for specifying a set of points that have to be transformed.
example: -def inputPoints.txt
The inputPoints.txt file should be structured: first line should be "index" or "point", depending if the user supplies voxel indices or real world coordinates. The second line should be the number of points that should be transformed. The third and following lines give the indices or points.
It is also possible to deform all points, thereby generating a deformation field image. This is done by:
example: -def all
Definition at line 144 of file elxTransformBase.h.
Public Member Functions | |
| int | BeforeAllTransformix () |
| void | ComputeAndWriteSpatialJacobianDeterminantImage () const |
| void | ComputeAndWriteSpatialJacobianMatrixImage () const |
| SpatialJacobianDeterminantImageType::Pointer | ComputeSpatialJacobianDeterminantImage () const |
| SpatialJacobianMatrixImageType::Pointer | ComputeSpatialJacobianMatrixImage () const |
| void | CreateTransformParameterMap (const ParametersType ¶m, ParameterMapType ¶meterMap, const bool includeDerivedTransformParameters=true) const |
| ITKBaseType * | GetAsITKBaseType () |
| const ITKBaseType * | GetAsITKBaseType () const |
| ITK_DISALLOW_COPY_AND_MOVE (TransformBase) | |
| itkOverrideGetNameOfClassMacro (TransformBase) | |
| itkStaticConstMacro (FixedImageDimension, unsigned int, FixedImageType::ImageDimension) | |
| itkStaticConstMacro (MovingImageDimension, unsigned int, MovingImageType::ImageDimension) | |
| virtual void | ReadFromFile () |
| void | ReadInitialTransformFromFile (const std::string &transformParameterFileName) |
| void | SetFinalParameters () |
| void | SetInitialTransform (InitialTransformType *_arg) |
| void | SetReadWriteTransformParameters (const bool _arg) |
| void | SetTransformParameterFileName (const std::string &filename) |
| template<typename TMesh> | |
| TMesh::Pointer | TransformMesh (const TMesh &mesh) const |
| void | TransformPoints () const |
| void | WriteToFile (std::ostream &transformationParameterInfo, const ParametersType ¶m) const |
| Public Member Functions inherited from elastix::BaseComponentSE< TElastix > | |
| void | AddTargetCellToIterationInfo (const char *const name) |
| const Configuration * | GetConfiguration () const |
| ElastixType * | GetElastix () const |
| auto & | GetIterationInfoAt (const char *const name) |
| itk::Statistics::MersenneTwisterRandomVariateGenerator & | GetRandomVariateGenerator () |
| RegistrationType * | GetRegistration () const |
| ITK_DISALLOW_COPY_AND_MOVE (BaseComponentSE) | |
| void | RemoveTargetCellFromIterationInfo (const char *const name) |
| void | SetConfiguration (const Configuration *_arg) |
| void | SetElastix (ElastixType *_arg) |
| Public Member Functions inherited from elastix::BaseComponent | |
| virtual void | AfterEachIteration () |
| virtual void | AfterEachIterationBase () |
| virtual void | AfterEachResolution () |
| virtual void | AfterEachResolutionBase () |
| virtual void | AfterRegistration () |
| virtual int | BeforeAll () |
| virtual void | BeforeEachResolution () |
| virtual void | BeforeEachResolutionBase () |
| virtual void | BeforeRegistration () |
| virtual const char * | elxGetClassName () const |
| const char * | GetComponentLabel () const |
| ITK_DISALLOW_COPY_AND_MOVE (BaseComponent) | |
| itkVirtualGetNameOfClassMacro (BaseComponent) | |
| void | SetComponentLabel (const char *label, unsigned int idx) |
Protected Member Functions | |
| void | AutomaticScalesEstimation (ScalesType &scales) const |
| void | AutomaticScalesEstimationStackTransform (const unsigned int numSubTransforms, ScalesType &scales) const |
| bool | HasITKTransformParameters () const |
| TransformBase ()=default | |
| ~TransformBase () override=default | |
| Protected Member Functions inherited from elastix::BaseComponentSE< TElastix > | |
| BaseComponentSE ()=default | |
| ~BaseComponentSE () override=default | |
| Protected Member Functions inherited from elastix::BaseComponent | |
| BaseComponent ()=default | |
| virtual | ~BaseComponent ()=default |
Private Member Functions | |
| void | AfterRegistrationBase () override |
| int | BeforeAllBase () override |
| void | BeforeRegistrationBase () override |
| template<typename TImage> | |
| auto | CreateChangeInformationImageFilter (TImage *image) const |
| virtual ParameterMapType | CreateDerivedTransformParameterMap () const =0 |
| template<template< typename, typename > class TSource, typename TOutputImage> | |
| auto | CreateJacobianSource () const |
| elxDeclarePureVirtualGetSelfMacro (ITKBaseType) | |
| DeformationFieldImageType::Pointer | GenerateDeformationFieldImage () const |
| const InitialTransformType * | GetInitialTransform () const |
| std::string | GetInitialTransformParameterFileName () const |
| virtual const char * | GetTransformParameterFileName () const |
| void | ReadInitialTransformFromConfiguration (const Configuration::ConstPointer) |
| void | TransformPointsAllPoints () const |
| void | TransformPointsSomePoints (const std::string &filename) const |
| void | TransformPointsSomePointsVTK (const std::string &filename) const |
| void | WriteDeformationFieldImage (typename DeformationFieldImageType::Pointer) const |
| virtual void | WriteDerivedTransformDataToFile () const |
Private Attributes | |
| ParametersType | m_FinalParameters |
| bool | m_ReadWriteTransformParameters { true } |
| std::string | m_TransformParameterFileName |
| ParametersType | m_TransformParameters |
Additional Inherited Members | |
| Static Public Member Functions inherited from elastix::BaseComponent | |
| template<typename TBaseComponent> | |
| static auto | AsITKBaseType (TBaseComponent *const baseComponent) -> decltype(baseComponent->GetAsITKBaseType()) |
| static void | InitializeElastixExecutable () |
| static bool | IsElastixLibrary () |
| Protected Attributes inherited from elastix::BaseComponentSE< TElastix > | |
| Configuration::ConstPointer | m_Configuration {} |
| itk::WeakPointer< TElastix > | m_Elastix {} |
| RegistrationType * | m_Registration {} |
| using elastix::TransformBase< TElastix >::CombinationTransformType = itk::AdvancedCombinationTransform<CoordinateType, Self::FixedImageDimension> |
Other typedef's.
Definition at line 178 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::CommandLineArgumentMapType = Configuration ::CommandLineArgumentMapType |
Definition at line 159 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::CommandLineEntryType = Configuration ::CommandLineEntryType |
Definition at line 160 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ComponentDescriptionType = ComponentDatabase::ComponentDescriptionType |
Typedef's from ComponentDatabase.
Definition at line 168 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::CoordinateType = ElastixBase::CoordinateType |
Elastix typedef's.
Definition at line 163 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::DeformationFieldImageType = itk::Image<VectorPixelType, FixedImageDimension> |
Definition at line 192 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::FixedImageType = typename TElastix::FixedImageType |
Definition at line 164 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::InitialTransformType = typename CombinationTransformType::InitialTransformType |
Definition at line 180 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::InputPointType = typename ITKBaseType::InputPointType |
Typedef's for TransformPoint.
Definition at line 187 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ITKBaseType = CombinationTransformType |
Definition at line 179 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ITKRegistrationType = typename RegistrationType::ITKBaseType |
Typedefs needed for AutomaticScalesEstimation function
Definition at line 195 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::MovingImageType = typename TElastix::MovingImageType |
Definition at line 165 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::OptimizerType = typename ITKRegistrationType::OptimizerType |
Definition at line 196 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::OutputPointType = typename ITKBaseType::OutputPointType |
Definition at line 188 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ParameterMapType = typename TElastix::ParameterMapType |
Typedef that is used in the elastix dll version.
Definition at line 206 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ParametersType = itk::OptimizerParameters<ValueType> |
Definition at line 184 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::PtrToCreator = ComponentDatabase::PtrToCreator |
Definition at line 169 of file elxTransformBase.h.
| using elastix::BaseComponentSE< TElastix >::RegistrationType |
RegistrationType; NB: this is the elx::RegistrationBase not an itk::Object or something like that.
Definition at line 63 of file elxBaseComponentSE.h.
| using elastix::TransformBase< TElastix >::ScalesType = itk::Optimizer::ScalesType |
Definition at line 197 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::Self = TransformBase |
Standard ITK stuff.
Definition at line 150 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::SpatialJacobianDeterminantImageType = itk::Image<float, FixedImageDimension> |
Typedefs for images of determinants of spatial Jacobian matrices, and images of spatial Jacobian matrices
Definition at line 200 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::SpatialJacobianMatrixImageType |
Definition at line 201 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::Superclass = BaseComponentSE<TElastix> |
Definition at line 151 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::ValueType = double |
Typedef's for parameters.
Definition at line 183 of file elxTransformBase.h.
| using elastix::TransformBase< TElastix >::VectorPixelType = itk::Vector<float, FixedImageDimension> |
Typedef's for TransformPointsAllPoints.
Definition at line 191 of file elxTransformBase.h.
|
protecteddefault |
The default-constructor.
|
overrideprotecteddefault |
The destructor.
|
overrideprivatevirtual |
Execute stuff after the registration:
Reimplemented from elastix::BaseComponent.
|
protected |
Estimate a scales vector AutomaticScalesEstimation works like this:
|
protected |
Estimate a scales vector for a stack transform (elxTranslationStackTransform, elxAffineStackTransform, ...) Instead of sampling along the n dimensions of the fixed image, it samples along n-1 dimensions. Then
|
overrideprivatevirtual |
Execute stuff before everything else:
Reimplemented from elastix::BaseComponent.
| int elastix::TransformBase< TElastix >::BeforeAllTransformix | ( | ) |
Execute stuff before the actual transformation:
|
overrideprivatevirtual |
Execute stuff before the actual registration:
Reimplemented from elastix::BaseComponent.
| void elastix::TransformBase< TElastix >::ComputeAndWriteSpatialJacobianDeterminantImage | ( | ) | const |
Computes the determinant of the spatial Jacobian and writes it to file.
| void elastix::TransformBase< TElastix >::ComputeAndWriteSpatialJacobianMatrixImage | ( | ) | const |
Computes the spatial Jacobian and writes it to file.
| SpatialJacobianDeterminantImageType::Pointer elastix::TransformBase< TElastix >::ComputeSpatialJacobianDeterminantImage | ( | ) | const |
Computes the spatial Jacobian determinant for each pixel, and returns the image.
| SpatialJacobianMatrixImageType::Pointer elastix::TransformBase< TElastix >::ComputeSpatialJacobianMatrixImage | ( | ) | const |
Computes the spatial Jacobian matrix for each pixel, and returns the image.
|
inlineprivate |
Creates an info changer that may change the direction of the image to the original value.
Definition at line 361 of file elxTransformBase.h.
|
privatepure virtual |
Implemented in elastix::AdvancedAffineTransformElastix< TElastix >, elastix::AdvancedBSplineTransform< TElastix >, elastix::AffineDTITransformElastix< TElastix >, elastix::AffineLogStackTransform< TElastix >, elastix::AffineLogTransformElastix< TElastix >, elastix::BSplineStackTransform< TElastix >, elastix::BSplineTransformWithDiffusion< TElastix >, elastix::DeformationFieldTransform< TElastix >, elastix::EulerStackTransform< TElastix >, elastix::EulerTransformElastix< TElastix >, elastix::ExternalTransform< TElastix >, elastix::MultiBSplineTransformWithNormal< TElastix >, elastix::RecursiveBSplineTransform< TElastix >, elastix::SimilarityTransformElastix< TElastix >, elastix::SplineKernelTransform< TElastix >, elastix::TranslationStackTransform< TElastix >, elastix::TranslationTransformElastix< TElastix >, and elastix::WeightedCombinationTransformElastix< TElastix >.
|
inlineprivate |
Supports either TransformToDeterminantOfSpatialJacobianSource or TransformToSpatialJacobianSource as TSource.
Definition at line 337 of file elxTransformBase.h.
| void elastix::TransformBase< TElastix >::CreateTransformParameterMap | ( | const ParametersType & | param, |
| ParameterMapType & | parameterMap, | ||
| const bool | includeDerivedTransformParameters = true ) const |
Function to create transform-parameters map.
|
private |
|
private |
Deprecation note: The plan is to split all Compute* and TransformPoints* functions into Generate* and Write* functions, since that would facilitate a proper library interface. To keep everything functional during the transition period we need to keep the orignal Compute* and TransformPoints* functions and let them just call Generate* and Write*. These functions should be considered marked deprecated. Function to transform all coordinates from fixed to moving image.
|
inline |
Retrieves this object as ITKBaseType.
Definition at line 210 of file elxTransformBase.h.
|
inline |
Retrieves this object as ITKBaseType, to use in const functions.
Definition at line 218 of file elxTransformBase.h.
|
private |
Get the initial transform.
|
inlineprivate |
Definition at line 433 of file elxTransformBase.h.
|
privatevirtual |
Get the TransformParameterFileName.
|
inlineprotected |
Tells whether this transform is specified by TransformParameters from ITK
Definition at line 306 of file elxTransformBase.h.
| elastix::TransformBase< TElastix >::ITK_DISALLOW_COPY_AND_MOVE | ( | TransformBase< TElastix > | ) |
| elastix::TransformBase< TElastix >::itkOverrideGetNameOfClassMacro | ( | TransformBase< TElastix > | ) |
Run-time type information (and related methods).
| elastix::TransformBase< TElastix >::itkStaticConstMacro | ( | FixedImageDimension | , |
| unsigned int | , | ||
| FixedImageType::ImageDimension | ) |
Get the dimension of the fixed image.
| elastix::TransformBase< TElastix >::itkStaticConstMacro | ( | MovingImageDimension | , |
| unsigned int | , | ||
| MovingImageType::ImageDimension | ) |
Get the dimension of the moving image.
|
virtual |
Function to read transform-parameters from a file.
Reimplemented in elastix::AdvancedAffineTransformElastix< TElastix >, elastix::AdvancedBSplineTransform< TElastix >, elastix::AffineDTITransformElastix< TElastix >, elastix::AffineLogStackTransform< TElastix >, elastix::AffineLogTransformElastix< TElastix >, elastix::BSplineStackTransform< TElastix >, elastix::BSplineTransformWithDiffusion< TElastix >, elastix::DeformationFieldTransform< TElastix >, elastix::EulerStackTransform< TElastix >, elastix::EulerTransformElastix< TElastix >, elastix::ExternalTransform< TElastix >, elastix::MultiBSplineTransformWithNormal< TElastix >, elastix::RecursiveBSplineTransform< TElastix >, elastix::SimilarityTransformElastix< TElastix >, elastix::SplineKernelTransform< TElastix >, elastix::TranslationStackTransform< TElastix >, and elastix::WeightedCombinationTransformElastix< TElastix >.
|
private |
Function to read the initial transform parameters from the specified configuration object.
| void elastix::TransformBase< TElastix >::ReadInitialTransformFromFile | ( | const std::string & | transformParameterFileName | ) |
Function to read the initial transform parameters from a file.
| void elastix::TransformBase< TElastix >::SetFinalParameters | ( | ) |
Makes sure that the final parameters from the registration components are copied, set, and stored.
| void elastix::TransformBase< TElastix >::SetInitialTransform | ( | InitialTransformType * | _arg | ) |
Set the initial transform.
| void elastix::TransformBase< TElastix >::SetReadWriteTransformParameters | ( | const bool | _arg | ) |
Macro for reading and writing the transform parameters in WriteToFile or not.
| void elastix::TransformBase< TElastix >::SetTransformParameterFileName | ( | const std::string & | filename | ) |
Set the TransformParameterFileName.
|
inline |
Transforms the specified mesh.
Definition at line 289 of file elxTransformBase.h.
| void elastix::TransformBase< TElastix >::TransformPoints | ( | ) | const |
Function to transform coordinates from fixed to moving image.
|
private |
Legacy function that calls GenerateDeformationFieldImage and WriteDeformationFieldImage.
|
private |
Function to transform coordinates from fixed to moving image.
|
private |
Function to transform coordinates from fixed to moving image, given as VTK file.
|
private |
|
inlineprivatevirtual |
Allows a derived transform class to write its data to file, by overriding this member function.
Reimplemented in elastix::BSplineTransformWithDiffusion< TElastix >, and elastix::DeformationFieldTransform< TElastix >.
Definition at line 451 of file elxTransformBase.h.
| void elastix::TransformBase< TElastix >::WriteToFile | ( | std::ostream & | transformationParameterInfo, |
| const ParametersType & | param ) const |
Function to write transform-parameters to a file.
|
private |
Definition at line 457 of file elxTransformBase.h.
|
private |
Boolean to decide whether or not the transform parameters are written.
Definition at line 460 of file elxTransformBase.h.
|
private |
Member variables.
Definition at line 455 of file elxTransformBase.h.
|
private |
Definition at line 456 of file elxTransformBase.h.
Generated on 1774142652 for elastix by 1.15.0 |