SimpleITK  
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::LandmarkBasedTransformInitializerFilter Class Reference

#include <sitkLandmarkBasedTransformInitializerFilter.h>

+ Inheritance diagram for itk::simple::LandmarkBasedTransformInitializerFilter:
+ Collaboration diagram for itk::simple::LandmarkBasedTransformInitializerFilter:

Public Types

using PixelIDTypeList = typelist2::typelist< BasicPixelID< float > >
 
using Self = LandmarkBasedTransformInitializerFilter
 
- Public Types inherited from itk::simple::ImageFilter
using Self = ImageFilter
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

Transform Execute (const Transform &transform)
 
unsigned int GetBSplineNumberOfControlPoints () const
 
std::vector< double > GetFixedLandmarks () const
 
std::vector< double > GetLandmarkWeight () const
 
std::vector< double > GetMovingLandmarks () const
 
std::string GetName () const override
 
Image GetReferenceImage () const
 
 LandmarkBasedTransformInitializerFilter ()
 
SelfSetBSplineNumberOfControlPoints (unsigned int BSplineNumberOfControlPoints)
 
SelfSetFixedLandmarks (const std::vector< double > &FixedLandmarks)
 
SelfSetLandmarkWeight (const std::vector< double > &LandmarkWeight)
 
SelfSetMovingLandmarks (const std::vector< double > &MovingLandmarks)
 
SelfSetReferenceImage (const Image &ReferenceImage)
 
std::string ToString () const override
 
 ~LandmarkBasedTransformInitializerFilter () override
 
- Public Member Functions inherited from itk::simple::ImageFilter
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, const std::function< void()> &func)
 Directly add a callback to observe an event. More...
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event. More...
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution. More...
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event. More...
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands. More...
 
virtual ~ProcessObject ()
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
virtual bool GetDebug () const
 
virtual void SetDebug (bool debugFlag)
 
virtual void SetNumberOfThreads (unsigned int n)
 
virtual unsigned int GetNumberOfThreads () const
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Private Types

typedef Transform(Self::* MemberFunctionType) (const Transform *transform)
 

Private Member Functions

template<class TImageType >
Transform ExecuteInternal (const Transform *transform)
 

Private Attributes

unsigned int m_BSplineNumberOfControlPoints
 
std::vector< double > m_FixedLandmarks
 
std::vector< double > m_LandmarkWeight
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
std::vector< double > m_MovingLandmarks
 
Image m_ReferenceImage
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ProcessObject
static bool GetGlobalDefaultDebug ()
 
static void GlobalDefaultDebugOff ()
 
static void GlobalDefaultDebugOn ()
 
static void SetGlobalDefaultDebug (bool debugFlag)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects. More...
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects. More...
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects. More...
 
- Protected Member Functions inherited from itk::simple::ImageFilter
void CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name)
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) noexcept
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter
template<class TImageType >
static void FixNonZeroIndex (TImageType *img)
 
- Static Protected Member Functions inherited from itk::simple::ProcessObject
template<class TImageType >
static TImageType::ConstPointer CastImageToITK (const Image &img)
 
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
 
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img)
 
template<class TImageType >
static Image CastITKToImage (TImageType *img)
 
static const itk::EventObjectGetITKEventObject (EventEnum e)
 
template<typename T >
static std::ostream & ToStringHelper (std::ostream &os, const T &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const signed char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const unsigned char &v)
 

Detailed Description

This class computes the transform that aligns the fixed and moving images given a set of pair landmarks. The class is templated over the Transform type as well as fixed image and moving image types. The transform computed gives the best fit transform that maps the fixed and moving images in a least squares sense. The indices are taken to correspond, so point 1 in the first set will get mapped close to point 1 in the second set, etc.

Currently, the following transforms are supported by the class:

An equal number of fixed and moving landmarks need to be specified using SetFixedLandmarks() and SetMovingLandmarks() . Any number of landmarks may be specified. In the case of using Affine or BSpline transforms, each landmark pair can contribute in the final transform based on its defined weight. Number of weights should be equal to the number of landmarks and can be specified using SetLandmarkWeight() . By defaults are weights are set to one. Call InitializeTransform() to initialize the transform.

The class is based in part on Hybrid/vtkLandmarkTransform originally implemented in python by David G. Gobbi.

The solution is based on Berthold K. P. Horn (1987), "Closed-form solution of absolute orientation using unit quaternions," http://people.csail.mit.edu/bkph/papers/Absolute_Orientation.pdf

The Affine Transform initializer is based on an algorithm by H Spaeth, and is described in the Insight Journal Article "Affine Transformation for Landmark Based Registration Initializer in ITK" by Kim E.Y., Johnson H., Williams N. available at https://www.midasjournal.org/browse/publication/825

Wiki Examples:

Definition at line 71 of file sitkLandmarkBasedTransformInitializerFilter.h.

Member Typedef Documentation

◆ MemberFunctionType

typedef Transform(Self::* itk::simple::LandmarkBasedTransformInitializerFilter::MemberFunctionType) (const Transform *transform)
private

Setup for member function dispatching

Definition at line 150 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 84 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ Self

Constructor & Destructor Documentation

◆ ~LandmarkBasedTransformInitializerFilter()

itk::simple::LandmarkBasedTransformInitializerFilter::~LandmarkBasedTransformInitializerFilter ( )
override

Destructor

◆ LandmarkBasedTransformInitializerFilter()

itk::simple::LandmarkBasedTransformInitializerFilter::LandmarkBasedTransformInitializerFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ Execute()

Transform itk::simple::LandmarkBasedTransformInitializerFilter::Execute ( const Transform transform)

Execute the filter on the input image

◆ ExecuteInternal()

template<class TImageType >
Transform itk::simple::LandmarkBasedTransformInitializerFilter::ExecuteInternal ( const Transform transform)
private

◆ GetBSplineNumberOfControlPoints()

unsigned int itk::simple::LandmarkBasedTransformInitializerFilter::GetBSplineNumberOfControlPoints ( ) const
inline

Set/Get the number of control points

Definition at line 134 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ GetFixedLandmarks()

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::GetFixedLandmarks ( ) const
inline

◆ GetLandmarkWeight()

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::GetLandmarkWeight ( ) const
inline

◆ GetMovingLandmarks()

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::GetMovingLandmarks ( ) const
inline

Get the shrink factors.

Definition at line 105 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ GetName()

std::string itk::simple::LandmarkBasedTransformInitializerFilter::GetName ( ) const
inlineoverridevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 136 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ GetReferenceImage()

Image itk::simple::LandmarkBasedTransformInitializerFilter::GetReferenceImage ( ) const
inline

◆ SetBSplineNumberOfControlPoints()

Self& itk::simple::LandmarkBasedTransformInitializerFilter::SetBSplineNumberOfControlPoints ( unsigned int  BSplineNumberOfControlPoints)
inline

Set/Get the number of control points

Definition at line 129 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ SetFixedLandmarks()

Self& itk::simple::LandmarkBasedTransformInitializerFilter::SetFixedLandmarks ( const std::vector< double > &  FixedLandmarks)
inline

Set the Fixed landmark point containers

Definition at line 90 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ SetLandmarkWeight()

Self& itk::simple::LandmarkBasedTransformInitializerFilter::SetLandmarkWeight ( const std::vector< double > &  LandmarkWeight)
inline

Set the landmark weight point containers Weight includes diagonal elements of weight matrix

Definition at line 110 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ SetMovingLandmarks()

Self& itk::simple::LandmarkBasedTransformInitializerFilter::SetMovingLandmarks ( const std::vector< double > &  MovingLandmarks)
inline

Set the Moving landmark point containers

Definition at line 100 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ SetReferenceImage()

Self& itk::simple::LandmarkBasedTransformInitializerFilter::SetReferenceImage ( const Image ReferenceImage)
inline

Set the reference image to define the parametric domain for the BSpline transform

Definition at line 120 of file sitkLandmarkBasedTransformInitializerFilter.h.

◆ ToString()

std::string itk::simple::LandmarkBasedTransformInitializerFilter::ToString ( ) const
overridevirtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Member Data Documentation

◆ m_BSplineNumberOfControlPoints

unsigned int itk::simple::LandmarkBasedTransformInitializerFilter::m_BSplineNumberOfControlPoints
private

◆ m_FixedLandmarks

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::m_FixedLandmarks
private

◆ m_LandmarkWeight

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::m_LandmarkWeight
private

◆ m_MemberFactory

std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::LandmarkBasedTransformInitializerFilter::m_MemberFactory
private

◆ m_MovingLandmarks

std::vector<double> itk::simple::LandmarkBasedTransformInitializerFilter::m_MovingLandmarks
private

◆ m_ReferenceImage

Image itk::simple::LandmarkBasedTransformInitializerFilter::m_ReferenceImage
private

The documentation for this class was generated from the following file: