SimpleITK
2.0.0
|
This class contains a stack of transforms and concatenates them by composition. More...
#include <sitkCompositeTransform.h>
Classes | |
struct | MyVisitor |
Public Types | |
using | Self = CompositeTransform |
using | Superclass = Transform |
Public Types inherited from itk::simple::Transform | |
using | Self = Transform |
Public Member Functions | |
Self & | AddTransform (Transform t) |
Add a transform to the back of the stack. More... | |
void | ClearTransforms () |
Remove all transforms from the stack. More... | |
CompositeTransform (const CompositeTransform &) | |
A lazy copy constructor. More... | |
CompositeTransform (const std::vector< itk::simple::Transform > &) | |
Create a composite from a vector of Transform. More... | |
CompositeTransform (const Transform &) | |
Create CompositeTransform converted or holding the transform argument. More... | |
CompositeTransform (unsigned int dimensions) | |
Construct an empty CompositeTransform. More... | |
Self & | FlattenTransform () |
Removes nested composite transforms. More... | |
Transform | GetBackTransform () |
Get a copy of the back transform. More... | |
std::string | GetName () const override |
Transform | GetNthTransform (unsigned int n) |
Get a copy of a transform in the stack. More... | |
unsigned int | GetNumberOfTransforms () const |
The number of transforms in the stack. More... | |
CompositeTransform & | operator= (const CompositeTransform &) |
void | RemoveTransform () |
Remove the active transform at the back. More... | |
~CompositeTransform () override | |
Public Member Functions inherited from itk::simple::Transform | |
unsigned int | GetDimension () const |
Transform | GetInverse () const |
Return a new inverse transform of the same type as this. More... | |
unsigned int | GetNumberOfFixedParameters () const |
unsigned int | GetNumberOfParameters () const |
TransformEnum | GetTransformEnum () const |
Get the TransformEnum of the underlying Transform. More... | |
virtual bool | IsLinear () const |
void | MakeUnique () |
Performs actually coping if needed to make object unique. More... | |
virtual void | SetIdentity () |
virtual bool | SetInverse () |
Try to change the current transform to it's inverse. More... | |
std::string | ToString () const |
Transform () | |
By default a 3-d identity transform is constructed. More... | |
Transform (Image &displacement, TransformEnum type=sitkDisplacementField) | |
Use an image to construct a transform. More... | |
template<unsigned int NDimension> | |
Transform (itk::CompositeTransform< double, NDimension > *compositeTransform) | |
Construct a SimpleITK Transform from a pointer to an ITK composite transform. More... | |
Transform (itk::TransformBase *transform) | |
Transform (unsigned int dimensions, TransformEnum type) | |
Construct a specific transformation. More... | |
std::vector< double > | TransformPoint (const std::vector< double > &point) const |
std::vector< double > | TransformVector (const std::vector< double > &vector, const std::vector< double > &point) const |
void | WriteTransform (const std::string &filename) const |
virtual | ~Transform () |
Transform & | operator= (const Transform &) |
Copy constructor and assignment operator. More... | |
Transform (const Transform &) | |
Copy constructor and assignment operator. More... | |
itk::TransformBase * | GetITKBase () |
const itk::TransformBase * | GetITKBase () const |
void | SetParameters (const std::vector< double > ¶meters) |
std::vector< double > | GetParameters () const |
void | SetFixedParameters (const std::vector< double > ¶meters) |
std::vector< double > | GetFixedParameters () const |
Protected Member Functions | |
void | SetPimpleTransform (PimpleTransformBase *) override |
Protected Member Functions inherited from itk::simple::Transform | |
Transform (PimpleTransformBase *pimpleTransform) | |
Private Member Functions | |
template<unsigned int NDimension> | |
void | InternalInitialization (itk::CompositeTransform< double, NDimension > *) |
template<unsigned int NDimensions> | |
void | InternalInitialization (itk::Transform< double, NDimensions, NDimensions > *) |
void | InternalInitialization (itk::TransformBase *transform) |
Private Attributes | |
std::function< void(Transform &)> | m_pfAddTransform |
std::function< Transform()> | m_pfBackTransform |
std::function< void()> | m_pfClearTransformQueue |
std::function< void()> | m_pfFlattenTransform |
std::function< Transform(unsigned int)> | m_pfGetNthTransform |
std::function< unsigned int()> | m_pfGetNumberOfTransforms |
std::function< void()> | m_pfRemoveTransform |
This class contains a stack of transforms and concatenates them by composition.
The transforms are composed in reverse order with the back being applied first: \( T_0 o T_1 = T_0(T_1(x)) \) Transforms are stored in a queue, in the following order: \( T_0, T_1, ... , T_N-1 \)
Transforms are added via AddTransform(). This adds the transforms to the back of the queue.
The only parameters of the transform at the back of the queue are exposed and optimizable for registration.
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 58 of file sitkCompositeTransform.h.
Definition at line 61 of file sitkCompositeTransform.h.
Definition at line 62 of file sitkCompositeTransform.h.
|
explicit |
Construct an empty CompositeTransform.
The created CompositeTransform is initialized with zero transforms. Additional transforms of dimensions can be added.
itk::simple::CompositeTransform::CompositeTransform | ( | const Transform & | ) |
Create CompositeTransform converted or holding the transform argument.
If the Transform is internally a CompositeTransform, a shallow copy to the internal transform will be made. Otherwise a new CompositeTransform is constructed which holds the transform argument.
itk::simple::CompositeTransform::CompositeTransform | ( | const CompositeTransform & | ) |
A lazy copy constructor.
The new SimpleITK object will reference to the same underlying ITK CompositeTransform. A deep-copy will be made when the object is modified.
|
explicit |
Create a composite from a vector of Transform.
The CompositeTransform is constructed from deep copies of the Transforms. If the vector contains additional composite transforms, deep copies will be made and nested composite transforms will be constructed.
An exception is thrown if the vector is empty.
|
override |
Add a transform to the back of the stack.
A deep-copy of the transform is performed. The added transform will have the optimizable parameters, while the other parameters are part of the fixed parameters.
void itk::simple::CompositeTransform::ClearTransforms | ( | ) |
Remove all transforms from the stack.
Self& itk::simple::CompositeTransform::FlattenTransform | ( | ) |
Removes nested composite transforms.
If this transform contains additional composite transforms, then these nested composite transformed are removed, while preserving the order of the regular transforms and transferring ownership to the parent CompositeTransform.
Nested composite transform may not be written to a file.
Transform itk::simple::CompositeTransform::GetBackTransform | ( | ) |
Get a copy of the back transform.
If the stack is empty an exception will be thrown.
|
inlineoverridevirtual |
Name of this class
Reimplemented from itk::simple::Transform.
Definition at line 103 of file sitkCompositeTransform.h.
Transform itk::simple::CompositeTransform::GetNthTransform | ( | unsigned int | n | ) |
Get a copy of a transform in the stack.
If n is equal or greater than the number of transforms, then an exception will be thrown.
unsigned int itk::simple::CompositeTransform::GetNumberOfTransforms | ( | ) | const |
The number of transforms in the stack.
|
private |
|
private |
|
private |
Referenced by itk::simple::CompositeTransform::MyVisitor::operator()().
CompositeTransform& itk::simple::CompositeTransform::operator= | ( | const CompositeTransform & | ) |
void itk::simple::CompositeTransform::RemoveTransform | ( | ) |
Remove the active transform at the back.
If the stack is empty an exception will be thrown.
|
overrideprotectedvirtual |
Reimplemented from itk::simple::Transform.
|
private |
Definition at line 183 of file sitkCompositeTransform.h.
|
private |
Definition at line 185 of file sitkCompositeTransform.h.
|
private |
Definition at line 188 of file sitkCompositeTransform.h.
|
private |
Definition at line 182 of file sitkCompositeTransform.h.
|
private |
Definition at line 186 of file sitkCompositeTransform.h.
|
private |
Definition at line 187 of file sitkCompositeTransform.h.
|
private |
Definition at line 184 of file sitkCompositeTransform.h.