ITK
4.2.0
Insight Segmentation and Registration Toolkit
|
#include <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 Transform< TScalar, NDimensions, NDimensions > | Superclass |
typedef std::deque < TransformTypePointer > | TransformQueueType |
typedef std::deque< bool > | TransformsToOptimizeFlagsType |
typedef Superclass | TransformType |
typedef Superclass::Pointer | TransformTypePointer |
Public Types inherited from itk::Transform< TScalar, NDimensions, NDimensions > | |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | DirectionChangeMatrix |
typedef Matrix< double, itkGetStaticConstMacro(InputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | InputDirectionMatrix |
typedef Transform< TScalar, NOutputDimensions, NInputDimensions > | InverseTransformBaseType |
typedef Matrix< TScalar, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(InputSpaceDimension)> | MatrixType |
typedef Matrix< double, itkGetStaticConstMacro(OutputSpaceDimension), itkGetStaticConstMacro(OutputSpaceDimension)> | OutputDirectionMatrix |
Public Types inherited from itk::TransformBase | |
Public Types inherited from itk::Object | |
Public Types inherited from itk::LightObject |
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::Transform< TScalar, NDimensions, NDimensions > | |
static const unsigned int | InputSpaceDimension |
static const unsigned int | OutputSpaceDimension |
Private Member Functions | |
CompositeTransform (const Self &) | |
void | operator= (const Self &) |
Private Attributes | |
unsigned long | m_LocalParametersUpdateTime |
unsigned long | m_PreviousTransformsToOptimizeUpdateTime |
This class contains a list of transforms and concatenates them by composition.
This class concatenates transforms 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.
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, ComputeJacobianWithRespectToPosition, 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.
TODO
Interface Issues/Comments x The PushFrontTransform and PushBackTransform methods are protected to force the user to use the AddTransform method, forcing the order of transforms. Are there use cases where the user would need to insert transforms at the front of the queue? Or at arbitrary positions?
GetParameters efficiency optimization Can we optimize this to only query the sub-transforms when the params in the sub transforms have changed since the previous call? Can't use Modified time b/c that will get updated in sub-transforms with every call to SetParameters. Is this worth worrying about? i.e. how much time will it take in the overall registration process? Probably very little.
Definition at line 102 of file itkCompositeTransform.h.
typedef SmartPointer<const Self> itk::CompositeTransform< TScalar, NDimensions >::ConstPointer |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 110 of file itkCompositeTransform.h.
typedef Superclass::DerivativeType itk::CompositeTransform< TScalar, NDimensions >::DerivativeType |
Derivative type
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 134 of file itkCompositeTransform.h.
typedef Superclass::InputCovariantVectorType itk::CompositeTransform< TScalar, NDimensions >::InputCovariantVectorType |
Standard covariant vector type for this class
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 149 of file itkCompositeTransform.h.
typedef Superclass::InputDiffusionTensor3DType itk::CompositeTransform< TScalar, NDimensions >::InputDiffusionTensor3DType |
Standard DiffusionTensor3D typedef for this class
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 162 of file itkCompositeTransform.h.
typedef Superclass::InputPointType itk::CompositeTransform< TScalar, NDimensions >::InputPointType |
Standard coordinate point type for this class.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 140 of file itkCompositeTransform.h.
typedef Superclass::InputSymmetricSecondRankTensorType itk::CompositeTransform< TScalar, NDimensions >::InputSymmetricSecondRankTensorType |
Standard SymmetricSecondRankTensor typedef for this class
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 167 of file itkCompositeTransform.h.
typedef Superclass::InputVectorPixelType itk::CompositeTransform< TScalar, NDimensions >::InputVectorPixelType |
Standard Vectorpixel type for this class
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 158 of file itkCompositeTransform.h.
typedef Superclass::InputVectorType itk::CompositeTransform< TScalar, NDimensions >::InputVectorType |
Standard vector type for this class.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 144 of file itkCompositeTransform.h.
typedef Superclass::InputVnlVectorType itk::CompositeTransform< TScalar, NDimensions >::InputVnlVectorType |
Standard vnl_vector type for this class.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 154 of file itkCompositeTransform.h.
typedef Superclass::InverseTransformBasePointer itk::CompositeTransform< TScalar, NDimensions >::InverseTransformBasePointer |
InverseTransform type.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 124 of file itkCompositeTransform.h.
typedef Superclass::JacobianType itk::CompositeTransform< TScalar, NDimensions >::JacobianType |
Jacobian type.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 137 of file itkCompositeTransform.h.
typedef Superclass::NumberOfParametersType itk::CompositeTransform< TScalar, NDimensions >::NumberOfParametersType |
The number of parameters defininig this transform.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 178 of file itkCompositeTransform.h.
typedef Superclass::OutputCovariantVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputCovariantVectorType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 151 of file itkCompositeTransform.h.
typedef Superclass::OutputDiffusionTensor3DType itk::CompositeTransform< TScalar, NDimensions >::OutputDiffusionTensor3DType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 163 of file itkCompositeTransform.h.
typedef Superclass::OutputPointType itk::CompositeTransform< TScalar, NDimensions >::OutputPointType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 141 of file itkCompositeTransform.h.
typedef Superclass::OutputSymmetricSecondRankTensorType itk::CompositeTransform< TScalar, NDimensions >::OutputSymmetricSecondRankTensorType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 169 of file itkCompositeTransform.h.
typedef Superclass::OutputVectorPixelType itk::CompositeTransform< TScalar, NDimensions >::OutputVectorPixelType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 159 of file itkCompositeTransform.h.
typedef Superclass::OutputVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputVectorType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 145 of file itkCompositeTransform.h.
typedef Superclass::OutputVnlVectorType itk::CompositeTransform< TScalar, NDimensions >::OutputVnlVectorType |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 155 of file itkCompositeTransform.h.
typedef Superclass::ParametersType itk::CompositeTransform< TScalar, NDimensions >::ParametersType |
Parameters type.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 130 of file itkCompositeTransform.h.
typedef Superclass::ParametersValueType itk::CompositeTransform< TScalar, NDimensions >::ParametersValueType |
Type of the input parameters.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 131 of file itkCompositeTransform.h.
typedef SmartPointer<Self> itk::CompositeTransform< TScalar, NDimensions >::Pointer |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 109 of file itkCompositeTransform.h.
typedef Superclass::ScalarType itk::CompositeTransform< TScalar, NDimensions >::ScalarType |
Scalar type.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 127 of file itkCompositeTransform.h.
typedef CompositeTransform itk::CompositeTransform< TScalar, NDimensions >::Self |
Standard class typedefs.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 107 of file itkCompositeTransform.h.
typedef Transform<TScalar, NDimensions, NDimensions> itk::CompositeTransform< TScalar, NDimensions >::Superclass |
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
Definition at line 108 of file itkCompositeTransform.h.
typedef std::deque<TransformTypePointer> itk::CompositeTransform< TScalar, NDimensions >::TransformQueueType |
Transform queue type
Definition at line 172 of file itkCompositeTransform.h.
typedef std::deque<bool> itk::CompositeTransform< TScalar, NDimensions >::TransformsToOptimizeFlagsType |
Optimization flags queue type
Definition at line 175 of file itkCompositeTransform.h.
typedef Superclass itk::CompositeTransform< TScalar, NDimensions >::TransformType |
Component transform type
Definition at line 116 of file itkCompositeTransform.h.
typedef Superclass::Pointer itk::CompositeTransform< TScalar, NDimensions >::TransformTypePointer |
Definition at line 120 of file itkCompositeTransform.h.
|
protected |
|
protectedvirtual |
|
private |
|
inline |
Functionality for sub transforms Add transforms to the queue, as stack. Only allow one method for simplicity. Most-recently added transform is always at back of queue, index N-1.
Definition at line 190 of file itkCompositeTransform.h.
|
inline |
Definition at line 295 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.
|
inlinevirtual |
Definition at line 458 of file itkCompositeTransform.h.
|
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.
|
inline |
Definition at line 208 of file itkCompositeTransform.h.
|
virtual |
Get the Fixed Parameters.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
inline |
See transforms at the front and the back of the queue
Definition at line 202 of file itkCompositeTransform.h.
bool itk::CompositeTransform< TScalar, NDimensions >::GetInverse | ( | Self * | inverse | ) | const |
Return an inverse of this transform.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
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::Transform< TScalar, NDimensions, NDimensions >.
|
inline |
Definition at line 214 of file itkCompositeTransform.h.
|
inline |
Definition at line 267 of file itkCompositeTransform.h.
|
virtual |
|
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::Transform< TScalar, NDimensions, NDimensions >.
|
virtual |
Return the number of parameters that completely define the Transfom
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
inline |
Definition at line 290 of file itkCompositeTransform.h.
|
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::Transform< TScalar, NDimensions, NDimensions >.
|
inline |
Access transform queue
Definition at line 273 of file itkCompositeTransform.h.
|
inline |
Access optimize flags
Definition at line 279 of file itkCompositeTransform.h.
|
protected |
Get a list of transforms to optimize. Helper function.
|
virtual |
Indicates if this transform is a "global" transform e.g. an affine transform or a local one, e.g. a deformation field. Returns true if only all sub-transforms that are set to be optimized return true.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
protectedvirtual |
Clone the current transform
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
virtual |
Indicates if this transform is linear. A transform is defined to be linear if the transform of a linear combination of points is equal to the linear combination (with the same coefficients) of the individual transforms of each point. The transform T will be linear if given two points P and Q, and scalar coefficients a and b, then
T( a*P + b*Q ) = a * T(P) + b * T(Q)
By default, we assume this to NOT be the case for most transforms. However, transforms for which this is true will overload and reimplement this method accordingly.
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
inline |
Misc. functionality
Definition at line 285 of file itkCompositeTransform.h.
|
static |
New macro for creation of through a Smart Pointer
Reimplemented from itk::Object.
|
private |
Mutex lock to protect modification to the reference count
Reimplemented from itk::Transform< TScalar, NDimensions, NDimensions >.
|
inlineprotected |
Definition at line 496 of file itkCompositeTransform.h.
|
inlineprotected |
Definition at line 489 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.
|
inlineprotected |
Definition at line 481 of file itkCompositeTransform.h.
|
inlineprotected |
Definition at line 473 of file itkCompositeTransform.h.
|
inline |
Definition at line 195 of file itkCompositeTransform.h.
|
inline |
Definition at line 237 of file itkCompositeTransform.h.
|
inline |
Definition at line 249 of file itkCompositeTransform.h.
|
inline |
Definition at line 244 of file itkCompositeTransform.h.
|
virtual |
|
inline |
Active Transform state manipulation
Definition at line 221 of file itkCompositeTransform.h.
|
inline |
Definition at line 232 of file itkCompositeTransform.h.
|
inline |
Definition at line 227 of file itkCompositeTransform.h.
|
inline |
Definition at line 257 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
. We assume update
is of the same length as Parameters. Throw exception otherwise. factor
is a scalar multiplier for each value in update. SetParameters is called on each sub-transform, to allow transforms to perform any required operations on the update parameters, typically a converion to member variables for use in TransformPoint.
|
static |
Dimension of the domain spaces.
Definition at line 181 of file itkCompositeTransform.h.
|
mutableprivate |
Definition at line 526 of file itkCompositeTransform.h.
|
mutableprotected |
Unify the parameter memory be copying all sub-transform parameters into a single memory block, and redirecting sub-transform's parameter memory to point within this block.
Definition at line 511 of file itkCompositeTransform.h.
|
mutableprivate |
Definition at line 525 of file itkCompositeTransform.h.
|
mutableprotected |
Transform container object.
Definition at line 514 of file itkCompositeTransform.h.
|
mutableprotected |
Definition at line 520 of file itkCompositeTransform.h.
|
mutableprotected |
Definition at line 519 of file itkCompositeTransform.h.
|
static |
Dimension of the domain spaces.
Definition at line 182 of file itkCompositeTransform.h.