ITK
4.4.0
Insight Segmentation and Registration Toolkit
|
#include <itkCompositeTransform.h>
This class contains a list of transforms and concatenates them by composition.
This class concatenates transforms in reverse queue order by means of composition: Transforms are stored in a container (queue), in the following order: Transforms are added via a single method, AddTransform(). This adds the transforms to the back of the queue. A single method for adding transforms is meant to simplify the interface and prevent errors. One use of the class is to optimize only a subset of included transforms.
The sub transforms are the same dimensionality as this class.
Example: A user wants to optimize two Affine transforms together, then add a Deformation Field (DF) transform, and optimize it separately. He first adds the two Affines, then runs the optimization and both Affines transforms are optimized. Next, he adds the DF transform and calls SetOnlyMostRecentTransformToOptimizeOn, which clears the optimization flags for both of the affine transforms, and leaves the flag set only for the DF transform, since it was the last transform added. Now he runs the optimization and only the DF transform is optimized, but the affines are included in the transformation during the optimization.
Optimization Flags: The m_TransformsToOptimize flags hold one flag for each transform in the queue, designating if each transform is to be used for optimization. Note that all transforms in the queue are applied in TransformPoint, regardless of these flags states'. The methods GetParameters, SetParameters, ComputeJacobianWithRespectToParameters, GetTransformCategory, GetFixedParameters, and SetFixedParameters all query these flags and include only those transforms whose corresponding flag is set. Their input or output is a concatenated array of all transforms set for use in optimization. The goal is to be able to optimize multiple transforms at once, while leaving other transforms fixed. See the above example.
Setting Optimization Flags: A transform's optimization flag is set when it is added to the queue, and remains set as other transforms are added. The methods SetNthTransformToOptimize* and SetAllTransformToOptimize* are used to set and clear flags arbitrarily. SetOnlyMostRecentTransformToOptimizeOn is a convenience method for setting only the most recently added transform for optimization, with the idea that this will be a common practice.
Indexing: The index values used in GetNthTransform and SetNthTransformToOptimize* and SetAllTransformToOptimize* follow the order in which transforms were added. Thus, the first transform added is at index 0, the next at index 1, etc.
Inverse: The inverse transform is created by retrieving the inverse from each sub transform and adding them to a composite transform in reverse order. The m_TransformsToOptimizeFlags is copied in reverse for the inverse.
Definition at line 88 of file itkCompositeTransform.h.
Public Types | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::InputCovariantVectorType | InputCovariantVectorType |
typedef Superclass::InputDiffusionTensor3DType | InputDiffusionTensor3DType |
typedef Superclass::InputPointType | InputPointType |
typedef Superclass::InputSymmetricSecondRankTensorType | InputSymmetricSecondRankTensorType |
typedef Superclass::InputVectorPixelType | InputVectorPixelType |
typedef Superclass::InputVectorType | InputVectorType |
typedef Superclass::InputVnlVectorType | InputVnlVectorType |
typedef Superclass::InverseTransformBasePointer | InverseTransformBasePointer |
typedef Superclass::JacobianType | JacobianType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef Superclass::OutputCovariantVectorType | OutputCovariantVectorType |
typedef Superclass::OutputDiffusionTensor3DType | OutputDiffusionTensor3DType |
typedef Superclass::OutputPointType | OutputPointType |
typedef Superclass::OutputSymmetricSecondRankTensorType | OutputSymmetricSecondRankTensorType |
typedef Superclass::OutputVectorPixelType | OutputVectorPixelType |
typedef Superclass::OutputVectorType | OutputVectorType |
typedef Superclass::OutputVnlVectorType | OutputVnlVectorType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef Superclass::ScalarType | ScalarType |
typedef CompositeTransform | Self |
typedef MultiTransform < TScalar, NDimensions, NDimensions > | Superclass |
typedef Superclass::TransformCategoryType | TransformCategoryType |
typedef Superclass::TransformQueueType | TransformQueueType |
typedef std::deque< bool > | TransformsToOptimizeFlagsType |
typedef Superclass::TransformType | TransformType |
typedef Superclass::TransformTypePointer | TransformTypePointer |
Public Types inherited from itk::MultiTransform< TScalar, NDimensions > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Superclass::DerivativeType | DerivativeType |
typedef Superclass::InputCovariantVectorType | InputCovariantVectorType |
typedef Superclass::InputDiffusionTensor3DType | InputDiffusionTensor3DType |
typedef Superclass::InputPointType | InputPointType |
typedef Superclass::InputSymmetricSecondRankTensorType | InputSymmetricSecondRankTensorType |
typedef Superclass::InputVectorPixelType | InputVectorPixelType |
typedef Superclass::InputVectorType | InputVectorType |
typedef Superclass::InputVnlVectorType | InputVnlVectorType |
typedef Superclass::InverseTransformBasePointer | InverseTransformBasePointer |
typedef Superclass::JacobianType | JacobianType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef Superclass::OutputCovariantVectorType | OutputCovariantVectorType |
typedef Superclass::OutputDiffusionTensor3DType | OutputDiffusionTensor3DType |
typedef Superclass::OutputPointType | OutputPointType |
typedef Superclass::OutputSymmetricSecondRankTensorType | OutputSymmetricSecondRankTensorType |
typedef Superclass::OutputVectorPixelType | OutputVectorPixelType |
typedef Superclass::OutputVectorType | OutputVectorType |
typedef Superclass::OutputVnlVectorType | OutputVnlVectorType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef Superclass::ScalarType | ScalarType |
typedef MultiTransform | Self |
typedef TransformType::InverseTransformBasePointer | SubTransformInverseTransformBasePointer |
typedef Transform< TScalar, NDimensions, NDimensions > | Superclass |
typedef Superclass::TransformCategoryType | TransformCategoryType |
typedef std::deque < TransformTypePointer > | TransformQueueType |
typedef Transform< TScalar, NDimensions, NDimensions > | TransformType |
typedef TransformType::Pointer | TransformTypePointer |
Public Types inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
typedef SmartPointer< const Self > | ConstPointer |
typedef Array < ParametersValueType > | DerivativeType |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | DirectionChangeMatrix |
typedef CovariantVector < TScalar, NInputDimensions > | InputCovariantVectorType |
typedef DiffusionTensor3D < TScalar > | InputDiffusionTensor3DType |
typedef Matrix< double, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | InputDirectionMatrix |
typedef Point< TScalar, NInputDimensions > | InputPointType |
typedef SymmetricSecondRankTensor < TScalar, NInputDimensions > | InputSymmetricSecondRankTensorType |
typedef VariableLengthVector < TScalar > | InputVectorPixelType |
typedef Vector< TScalar, NInputDimensions > | InputVectorType |
typedef vnl_vector_fixed < TScalar, NInputDimensions > | InputVnlVectorType |
typedef InverseTransformBaseType::Pointer | InverseTransformBasePointer |
typedef Transform< TScalar, NOutputDimensions, NInputDimensions > | InverseTransformBaseType |
typedef Array2D < ParametersValueType > | JacobianType |
typedef Matrix< TScalar, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | MatrixType |
typedef Superclass::NumberOfParametersType | NumberOfParametersType |
typedef CovariantVector < TScalar, NOutputDimensions > | OutputCovariantVectorType |
typedef DiffusionTensor3D < TScalar > | OutputDiffusionTensor3DType |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(OutputSpaceDimension)> | OutputDirectionMatrix |
typedef Point< TScalar, NOutputDimensions > | OutputPointType |
typedef SymmetricSecondRankTensor < TScalar, NOutputDimensions > | OutputSymmetricSecondRankTensorType |
typedef VariableLengthVector < TScalar > | OutputVectorPixelType |
typedef Vector< TScalar, NOutputDimensions > | OutputVectorType |
typedef vnl_vector_fixed < TScalar, NOutputDimensions > | OutputVnlVectorType |
typedef Superclass::ParametersType | ParametersType |
typedef Superclass::ParametersValueType | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef TScalar | ScalarType |
typedef Transform | Self |
typedef TransformBase | Superclass |
Public Types inherited from itk::TransformBase | |
typedef SmartPointer< const Self > | ConstPointer |
typedef IdentifierType | NumberOfParametersType |
typedef OptimizerParameters < ParametersValueType > | ParametersType |
typedef double | ParametersValueType |
typedef SmartPointer< Self > | Pointer |
typedef TransformBase | Self |
typedef Object | Superclass |
enum | TransformCategoryType { UnknownTransformCategory =0, Linear =1, BSpline =2, Spline =3, DisplacementField =4, VelocityField =5 } |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Static Public Member Functions | |
static Pointer | New () |
Static Public Attributes | |
static const unsigned int | InputDimension = NDimensions |
static const unsigned int | OutputDimension = NDimensions |
Static Public Attributes inherited from itk::MultiTransform< TScalar, NDimensions > | |
static const unsigned int | SubInputDimension |
static const unsigned int | SubOutputDimension |
static const unsigned int | InputDimension |
static const unsigned int | OutputDimension |
Static Public Attributes inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
static const unsigned int | InputSpaceDimension |
static const unsigned int | OutputSpaceDimension |
Protected Attributes | |
TransformsToOptimizeFlagsType | m_TransformsToOptimizeFlags |
TransformQueueType | m_TransformsToOptimizeQueue |
Protected Attributes inherited from itk::MultiTransform< TScalar, NDimensions > | |
ModifiedTimeType | m_LocalParametersUpdateTime |
NumberOfParametersType | m_NumberOfLocalParameters |
TransformQueueType | m_TransformQueue |
Protected Attributes inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
DirectionChangeMatrix | m_DirectionChange |
ParametersType | m_FixedParameters |
ParametersType | m_Parameters |
Private Member Functions | |
CompositeTransform (const Self &) | |
void | operator= (const Self &) |
Private Attributes | |
ModifiedTimeType | m_PreviousTransformsToOptimizeUpdateTime |
Additional Inherited Members | |
Protected Types inherited from itk::LightObject | |
typedef int | InternalReferenceCountType |
typedef SmartPointer<const Self> itk::CompositeTransform< TScalar, NDimensions >::ConstPointer |
Definition at line 96 of file itkCompositeTransform.h.
typedef Superclass::DerivativeType itk::CompositeTransform< TScalar, NDimensions >::DerivativeType |
Derivative type
Definition at line 119 of file itkCompositeTransform.h.
typedef Superclass::InputCovariantVectorType itk::CompositeTransform< TScalar, NDimensions >::InputCovariantVectorType |
Standard covariant vector type for this class
Definition at line 136 of file itkCompositeTransform.h.
typedef Superclass::InputDiffusionTensor3DType itk::CompositeTransform< TScalar, NDimensions >::InputDiffusionTensor3DType |
Standard DiffusionTensor3D typedef for this class
Definition at line 148 of file itkCompositeTransform.h.
typedef Superclass::InputPointType itk::CompositeTransform< TScalar, NDimensions >::InputPointType |
Standard coordinate point type for this class.
Definition at line 128 of file itkCompositeTransform.h.
typedef Superclass::InputSymmetricSecondRankTensorType itk::CompositeTransform< TScalar, NDimensions >::InputSymmetricSecondRankTensorType |
Standard SymmetricSecondRankTensor typedef for this class
Definition at line 152 of file itkCompositeTransform.h.
typedef Superclass::InputVectorPixelType itk::CompositeTransform< TScalar, NDimensions >::InputVectorPixelType |
Standard Vectorpixel type for this class
Definition at line 144 of file itkCompositeTransform.h.
typedef Superclass::InputVectorType itk::CompositeTransform< TScalar, NDimensions >::InputVectorType |
Standard vector type for this class.
Definition at line 132 of file itkCompositeTransform.h.
typedef Superclass::InputVnlVectorType itk::CompositeTransform< TScalar, NDimensions >::InputVnlVectorType |
Standard vnl_vector type for this class.
Definition at line 140 of file itkCompositeTransform.h.
typedef Superclass::InverseTransformBasePointer itk::CompositeTransform< TScalar, NDimensions >::InverseTransformBasePointer |
InverseTransform type.
Definition at line 109 of file itkCompositeTransform.h.
typedef Superclass::JacobianType itk::CompositeTransform< TScalar, NDimensions >::JacobianType |
Jacobian type.
Definition at line 122 of file itkCompositeTransform.h.
typedef Superclass::NumberOfParametersType itk::CompositeTransform< TScalar, NDimensions >::NumberOfParametersType |
The number of parameters defininig this transform.
Definition at line 159 of file itkCompositeTransform.h.
typedef Superclass::OutputCovariantVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputCovariantVectorType |
Definition at line 137 of file itkCompositeTransform.h.
typedef Superclass::OutputDiffusionTensor3DType itk::CompositeTransform< TScalar, NDimensions >::OutputDiffusionTensor3DType |
Definition at line 149 of file itkCompositeTransform.h.
typedef Superclass::OutputPointType itk::CompositeTransform< TScalar, NDimensions >::OutputPointType |
Definition at line 129 of file itkCompositeTransform.h.
typedef Superclass::OutputSymmetricSecondRankTensorType itk::CompositeTransform< TScalar, NDimensions >::OutputSymmetricSecondRankTensorType |
Definition at line 153 of file itkCompositeTransform.h.
typedef Superclass::OutputVectorPixelType itk::CompositeTransform< TScalar, NDimensions >::OutputVectorPixelType |
Definition at line 145 of file itkCompositeTransform.h.
typedef Superclass::OutputVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputVectorType |
Definition at line 133 of file itkCompositeTransform.h.
typedef Superclass::OutputVnlVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputVnlVectorType |
Definition at line 141 of file itkCompositeTransform.h.
typedef Superclass::ParametersType itk::CompositeTransform< TScalar, NDimensions >::ParametersType |
Parameters type.
Definition at line 115 of file itkCompositeTransform.h.
typedef Superclass::ParametersValueType itk::CompositeTransform< TScalar, NDimensions >::ParametersValueType |
Definition at line 116 of file itkCompositeTransform.h.
typedef SmartPointer<Self> itk::CompositeTransform< TScalar, NDimensions >::Pointer |
Definition at line 95 of file itkCompositeTransform.h.
typedef Superclass::ScalarType itk::CompositeTransform< TScalar, NDimensions >::ScalarType |
Scalar type.
Definition at line 112 of file itkCompositeTransform.h.
typedef CompositeTransform itk::CompositeTransform< TScalar, NDimensions >::Self |
Standard class typedefs.
Definition at line 93 of file itkCompositeTransform.h.
typedef MultiTransform<TScalar, NDimensions, NDimensions> itk::CompositeTransform< TScalar, NDimensions >::Superclass |
Definition at line 94 of file itkCompositeTransform.h.
typedef Superclass::TransformCategoryType itk::CompositeTransform< TScalar, NDimensions >::TransformCategoryType |
Transform category type.
Definition at line 125 of file itkCompositeTransform.h.
typedef Superclass::TransformQueueType itk::CompositeTransform< TScalar, NDimensions >::TransformQueueType |
Transform queue type
Definition at line 156 of file itkCompositeTransform.h.
typedef std::deque<bool> itk::CompositeTransform< TScalar, NDimensions >::TransformsToOptimizeFlagsType |
Optimization flags queue type
Definition at line 162 of file itkCompositeTransform.h.
typedef Superclass::TransformType itk::CompositeTransform< TScalar, NDimensions >::TransformType |
Sub transform type
Definition at line 102 of file itkCompositeTransform.h.
typedef Superclass::TransformTypePointer itk::CompositeTransform< TScalar, NDimensions >::TransformTypePointer |
Definition at line 106 of file itkCompositeTransform.h.
|
protected |
|
protectedvirtual |
|
private |
|
inlinevirtual |
Clear the transform queue.
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
Definition at line 228 of file itkCompositeTransform.h.
|
virtual |
Compute the Jacobian with respect to the parameters for the compositie transform using Jacobian rule. See comments in the implementation.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
|
virtual |
Flatten the transform queue such that there are no nested composite transforms.
|
virtual |
Get the Fixed Parameters.
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
bool itk::CompositeTransform< TScalar, NDimensions >::GetInverse | ( | Self * | inverse | ) | const |
Returns a boolean indicating whether it is possible or not to compute the inverse of this current Transform. If it is possible, then the inverse of the transform is returned in the inverseTransform variable passed by the user. The inverse consists of the inverse of each sub-transform, in the reverse order of the forward transforms.
|
virtual |
Return an inverse of this transform. If the inverse has not been implemented, return NULL. The type of the inverse transform does not necessarily need to match the type of the forward transform. This allows one to return a numeric inverse transform instead.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
inlinevirtual |
Definition at line 217 of file itkCompositeTransform.h.
|
virtual |
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
virtual |
Return the number of local parameters that completely defines the Transform at an individual voxel. For transforms with local support, this will enable downstream computation of the jacobian wrt only the local support region. For instance, in the case of a deformation field, this will be equal to the number of image dimensions. If it is an affine transform, this will be the same as the GetNumberOfParameters().
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
virtual |
Return the number of parameters that completely define the Transfom
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
virtual |
Get/Set Parameter functions work on the current list of transforms that are set to be optimized (active) using the 'Set[Nth|All]TransformToOptimze' routines. The parameter data from each active transform is concatenated into a single ParametersType object.
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
virtual |
Special handling for composite transform. If all transforms are linear, then return category Linear. Otherwise if all transforms set to optimize are DisplacementFields, then return DisplacementField category.
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
inlinevirtual |
Access optimize flags
Definition at line 223 of file itkCompositeTransform.h.
|
protected |
Get a list of transforms to optimize. Helper function.
|
protectedvirtual |
Clone the current transform
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
static |
New macro for creation of through a Smart Pointer
|
private |
|
inlineprotectedvirtual |
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
Definition at line 405 of file itkCompositeTransform.h.
|
inlineprotectedvirtual |
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
Definition at line 399 of file itkCompositeTransform.h.
|
protectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::Object.
|
inlineprotectedvirtual |
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
Definition at line 392 of file itkCompositeTransform.h.
|
inlineprotectedvirtual |
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
Definition at line 385 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 187 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 199 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 194 of file itkCompositeTransform.h.
|
virtual |
|
inlinevirtual |
Active Transform state manipulation
Definition at line 171 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 182 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 177 of file itkCompositeTransform.h.
|
inlinevirtual |
Definition at line 207 of file itkCompositeTransform.h.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Compute the position of point in the new space.
Transforms are applied starting from the back of the queue. That is, in reverse order of which they were added, in order to work properly with ResampleFilter.
Imagine a user wants to apply an Affine transform followed by a Deformation Field (DF) transform. He adds the Affine, then the DF. Because the user typically conceptualizes a transformation as being applied from the Moving image to the Fixed image, this makes intuitive sense. But since the ResampleFilter expects to transform from the Fixed image to the Moving image, the transforms are applied in reverse order of addition, i.e. from the back of the queue, and thus, DF then Affine.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Update the transform's parameters by the values in update
. See GetParameters() for parameter ordering.
Reimplemented from itk::MultiTransform< TScalar, NDimensions >.
|
static |
Dimension of the domain spaces.
Definition at line 165 of file itkCompositeTransform.h.
|
mutableprivate |
Definition at line 421 of file itkCompositeTransform.h.
|
mutableprotected |
Definition at line 415 of file itkCompositeTransform.h.
|
mutableprotected |
Definition at line 414 of file itkCompositeTransform.h.
|
static |
Dimension of the domain spaces.
Definition at line 166 of file itkCompositeTransform.h.