#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:
(HowToCombineTransforms "Add")
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 and the current transform (which is currently optimized) by addition: ;
"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".
example: (Direction -1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.1)
Default: identity matrix. Elements are sorted as follows: [ d11 d21 d31 d12 d22 d32 d13 d23 d33] (in 3D).
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 137 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 |
virtual const char * | GetClassName () const |
ITK_DISALLOW_COPY_AND_MOVE (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) |
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) | |
itkTypeMacroNoParent (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<CoordRepType, Self::FixedImageDimension> |
Other typedef's.
Definition at line 171 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::CommandLineArgumentMapType = Configuration ::CommandLineArgumentMapType |
Definition at line 152 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::CommandLineEntryType = Configuration ::CommandLineEntryType |
Definition at line 153 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ComponentDescriptionType = ComponentDatabase::ComponentDescriptionType |
Typedef's from ComponentDatabase.
Definition at line 161 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::CoordRepType = ElastixBase::CoordRepType |
Elastix typedef's.
Definition at line 156 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::DeformationFieldImageType = itk::Image<VectorPixelType, FixedImageDimension> |
Definition at line 185 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::FixedImageType = typename TElastix::FixedImageType |
Definition at line 157 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::InitialTransformType = typename CombinationTransformType::InitialTransformType |
Definition at line 173 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::InputPointType = typename ITKBaseType::InputPointType |
Typedef's for TransformPoint.
Definition at line 180 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ITKBaseType = CombinationTransformType |
Definition at line 172 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ITKRegistrationType = typename RegistrationType::ITKBaseType |
Typedefs needed for AutomaticScalesEstimation function
Definition at line 188 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::MovingImageType = typename TElastix::MovingImageType |
Definition at line 158 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::OptimizerType = typename ITKRegistrationType::OptimizerType |
Definition at line 189 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::OutputPointType = typename ITKBaseType::OutputPointType |
Definition at line 181 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ParameterMapType = typename TElastix::ParameterMapType |
Typedef that is used in the elastix dll version.
Definition at line 199 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ParametersType = itk::OptimizerParameters<ValueType> |
Definition at line 177 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::PtrToCreator = ComponentDatabase::PtrToCreator |
Definition at line 162 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 62 of file elxBaseComponentSE.h.
using elastix::TransformBase< TElastix >::ScalesType = itk::Optimizer::ScalesType |
Definition at line 190 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::Self = TransformBase |
Standard ITK stuff.
Definition at line 143 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 193 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::SpatialJacobianMatrixImageType |
Definition at line 194 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::Superclass = BaseComponentSE<TElastix> |
Definition at line 144 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::ValueType = double |
Typedef's for parameters.
Definition at line 176 of file elxTransformBase.h.
using elastix::TransformBase< TElastix >::VectorPixelType = itk::Vector<float, FixedImageDimension> |
Typedef's for TransformPointsAllPoints.
Definition at line 184 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 354 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 330 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 203 of file elxTransformBase.h.
|
inline |
Retrieves this object as ITKBaseType, to use in const functions.
Definition at line 211 of file elxTransformBase.h.
|
virtual |
Run-time type information (and related methods).
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 >, elastix::TranslationTransformElastix< TElastix >, and elastix::WeightedCombinationTransformElastix< TElastix >.
|
private |
Get the initial transform.
|
inlineprivate |
Definition at line 426 of file elxTransformBase.h.
|
privatevirtual |
Get the TransformParameterFileName.
|
inlineprotected |
Tells whether this transform is specified by TransformParameters from ITK
Definition at line 299 of file elxTransformBase.h.
elastix::TransformBase< TElastix >::ITK_DISALLOW_COPY_AND_MOVE | ( | TransformBase< TElastix > | ) |
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 282 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 444 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 450 of file elxTransformBase.h.
|
private |
Boolean to decide whether or not the transform parameters are written.
Definition at line 453 of file elxTransformBase.h.
|
private |
Member variables.
Definition at line 448 of file elxTransformBase.h.
|
private |
Definition at line 449 of file elxTransformBase.h.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |