Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
mirtk::PointCorrespondence Class Referenceabstract

#include <PointCorrespondence.h>

Inheritance diagram for mirtk::PointCorrespondence:
Inheritance graph
Collaboration diagram for mirtk::PointCorrespondence:
Collaboration graph

Public Types

enum  Direction
 Enumeration of correspondence mapping direction.
 
typedef PointLocator::FeatureInfo FeatureInfo
 Info structure of point feature to use for point matching.
 
typedef PointLocator::FeatureList FeatureList
 List of point features to use for point matching.
 
enum  TypeId {
  Unknown, FiducialMatch, ClosestPoint, ClosestPointLabel,
  ClosestCell, SpectralMatch, RobustClosestPoint, RobustPointMatch
}
 Enumeration of available point correspondence maps. More...
 

Public Member Functions

bool AddFeature (const char *name, double weight=1.0, double slope=1.0, double intercept=.0)
 
int GetIndex (int) const
 
bool GetInputPoint (int, Point &) const
 Get untransformed output point corresponding to i-th input (sample) point.
 
virtual bool GetInputSourcePoint (int, Point &) const =0
 Get untransformed source point corresponding to i-th target (sample) point.
 
virtual bool GetInputTargetPoint (int, Point &) const =0
 Get untransformed target point corresponding to i-th source (sample) point.
 
bool GetPoint (int, Point &) const
 Get (transformed) output point corresponding to i-th input (sample) point.
 
virtual int GetSourceIndex (int) const
 
virtual bool GetSourcePoint (int, Point &) const =0
 Get (transformed) source point corresponding to i-th target (sample) point.
 
virtual int GetTargetIndex (int) const
 
virtual bool GetTargetPoint (int, Point &) const =0
 Get (transformed) target point corresponding to i-th source (sample) point.
 
virtual void Initialize ()
 Initialize correspondence map.
 
virtual PointCorrespondenceNewInstance () const =0
 Copy construct a new instance.
 
virtual ParameterList Parameter () const
 Get parameter key/value as string map.
 
virtual void Reinitialize ()
 Reinitialize correspondence map after change of input topology.
 
void RemoveFeature (const char *name)
 
virtual bool Set (const char *, const char *)
 Set parameter value from string.
 
virtual TypeId Type () const =0
 Type enumeration value.
 
virtual void Update ()
 Update correspondence map after change of input data sets.
 
virtual bool Upgrade ()
 
virtual void WriteDataSets (const char *, const char *, bool=true) const
 Write input of data fidelity term.
 
virtual void WriteSpectralPoints (const char *, vtkPointSet *) const
 Write first three spectral coordinates as polydata points.
 
virtual ~PointCorrespondence ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static double Distance2BetweenPoints (const double *a, const double *b, int d=3)
 
static int GetNumberOfPoints (vtkPointSet *dataset, const Array< int > *sample=NULL)
 
static int GetNumberOfPoints (const RegisteredPointSet *dataset, const Array< int > *sample=NULL)
 
static void GetPoint (Point &point, vtkPointSet *dataset, const Array< int > *sample, int index)
 
static void GetPoint (Point &point, const RegisteredPointSet *dataset, const Array< int > *sample, int index)
 
static void GetPoint (double *point, vtkPointSet *dataset, const Array< int > *sample, int index, const FeatureList *feature=NULL)
 
static void GetPoint (double *point, const RegisteredPointSet *dataset, const Array< int > *sample, int index, const FeatureList *feature=NULL)
 
static int GetPointDataIndexByCaseInsensitiveName (vtkPointData *, const string &)
 Get index of point data array using case insensitive name.
 
static int GetPointDimension (vtkPointSet *dataset, const FeatureList *feature)
 
static int GetPointDimension (const RegisteredPointSet *dataset, const FeatureList *feature)
 
static int GetPointIndex (vtkPointSet *dataset, const Array< int > *sample, int index)
 
static int GetPointIndex (const RegisteredPointSet *dataset, const Array< int > *sample, int index)
 
static vtkSmartPointer< vtkPoints > GetPoints (vtkPointSet *dataset, const Array< int > *sample)
 
static vtkSmartPointer< vtkPoints > GetPoints (const RegisteredPointSet *dataset, const Array< int > *sample)
 
static vtkSmartPointer< vtkPointSet > GetPointSet (vtkPointSet *dataset, const Array< int > *sample)
 
static vtkSmartPointer< vtkPointSet > GetPointSet (const RegisteredPointSet *dataset, const Array< int > *sample)
 
static PointCorrespondenceNew (TypeId)
 Construct new instance of specified type.
 
static PointCorrespondenceNew (const char *)
 Construct new instance of specified type.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 

Protected Member Functions

void CompleteFeatureInfo (const RegisteredPointSet *, FeatureList &)
 
void Init ()
 
 mirtkAttributeMacro (int, M)
 Number of point (samples) in target data set.
 
 mirtkAttributeMacro (int, N)
 Number of point (samples) in source data set.
 
 mirtkAttributeMacro (Vector, TargetEigenvalues)
 Eigenvalues corresponding to spectral coordinates of target.
 
 mirtkAttributeMacro (Vector, SourceEigenvalues)
 Eigenvalues corresponding to spectral coordinates of source.
 
 mirtkPublicAggregateMacro (const RegisteredPointSet, Target)
 (Transformed) target data set
 
 mirtkPublicAggregateMacro (const Array< int >, TargetSample)
 Indices of target point samples or NULL if all points are considered.
 
 mirtkPublicAggregateMacro (const RegisteredPointSet, Source)
 (Transformed) source data set
 
 mirtkPublicAggregateMacro (const Array< int >, SourceSample)
 Indices of source point samples or NULL if all points are considered.
 
 mirtkPublicAttributeMacro (FeatureList, TargetFeatures)
 Indices and rescaling parameters of target point features.
 
 mirtkPublicAttributeMacro (FeatureList, SourceFeatures)
 Indices and rescaling parameters of source point features.
 
 mirtkPublicAttributeMacro (int, DimensionOfSpectralPoints)
 Number of eigenmodes used for spectral features if used.
 
 mirtkPublicAttributeMacro (bool, DiffeomorphicSpectralDecomposition)
 Whether to use diffeomorphic spectral matching for spectral decomposition.
 
 mirtkPublicAttributeMacro (bool, UpdateSpectralPoints)
 Whether to update spectral coordinates of moving dataset.
 
 mirtkPublicAttributeMacro (bool, FromTargetToSource)
 Whether target to source correspondences are needed (i.e., GetSourcePoint)
 
 mirtkPublicAttributeMacro (bool, FromSourceToTarget)
 Whether source to target correspondences are needed (i.e., GetTargetPoint)
 
 mirtkPublicAttributeMacro (Direction, DefaultDirection)
 Default direction (i.e., GetPoint)
 
 mirtkReadOnlyAttributeMacro (int, NumberOfFeatures)
 Dimension of feature vectors.
 
 PointCorrespondence (const RegisteredPointSet *=NULL, const RegisteredPointSet *=NULL)
 Constructor.
 
 PointCorrespondence (const PointCorrespondence &)
 Copy constructor.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Locator of corresponding points of point clouds, curves, or surfaces

An instance of a subclass derived from PointCorrespondence finds the point of the source data set which corresponds to the specified point in the target data set, i.e., a solution of the linear assignment problem. In case of curves or surfaces, the corresponding point need not be an explicit point of the source data set, but can also be a point on the line segment or surface element (cell), respectively.

Definition at line 47 of file PointCorrespondence.h.

Member Enumeration Documentation

§ TypeId

Enumeration of available point correspondence maps.

Enumerator
Unknown 

Unknown/invalid/default correspondence.

FiducialMatch 

Match points by their respective indices.

ClosestPoint 

Find closest point in source data set.

ClosestPointLabel 

Find closest point in source data set with identical label.

ClosestCell 

Find closest cell in source data set.

SpectralMatch 

Closest point interpolated using spectral similarity.

RobustClosestPoint 

Find closest points within proximity in both directions.

RobustPointMatch 

Robust point matching (RPM) correspondence.

Definition at line 56 of file PointCorrespondence.h.

Member Function Documentation

§ AddFeature()

bool mirtk::PointCorrespondence::AddFeature ( const char *  name,
double  weight = 1.0,
double  slope = 1.0,
double  intercept = .0 
)

Add point data array to use as feature in point matching

This function is used to specify the point data to use as features in the point matching. By default, if no features are specified, the spatial coordinates of the points are used. When a feature is added to the lists _TargetFeatures and _SourceFeatures, only the named features are used. The point matching is then done between n-dimensional vectors which are the concatenation of the selected features, where each feature may be linearly rescaled to normalize them or adjust their weight in the matching function. If the spatial coordinates are to be used as features along with other point data features, the feature "spatial coordinates" or "spatial point" must be added explicitly as well.

The feature value used is weight * (slope * value + intercept).

Parameters
[in]nameCase insensitive name of point data array in both target and source dataset.
[in]weightWeight of feature.
[in]slopeSlope of feature rescaling function.
[in]interceptIntercept of feature rescaling function, e.g., to normalize feature to zero mean.
Note
Whether a feature name is valid is determined by FinalizeFeatureLists called by Initialize. This cannot be done by AddFeature because the input poly data objects may not be set yet.

§ CompleteFeatureInfo()

void mirtk::PointCorrespondence::CompleteFeatureInfo ( const RegisteredPointSet ,
FeatureList  
)
protected

Fill in missing point feature info

This function is called by Initialize after the input data has been set. The AddFeature function cannot inspect the input data to determine the index of a named feature because the input may not be set yet when AddFeature is called.

§ Distance2BetweenPoints()

double mirtk::PointCorrespondence::Distance2BetweenPoints ( const double *  a,
const double *  b,
int  d = 3 
)
inlinestatic

Calculate squared Euclidean distance between feature vectors

Parameters
[in]aFirst feature vector.
[in]bSecond feature vector.
[in]dDimension of feature vectors.
Returns
Squared Euclidean distance, i.e., dot product of a and b.

Definition at line 500 of file PointCorrespondence.h.

§ GetIndex()

int mirtk::PointCorrespondence::GetIndex ( int  i) const
inline
Returns
Index of corresponding point and -1 if point is an outlier or its corresponding point is not a vertex position.

Definition at line 571 of file PointCorrespondence.h.

§ GetNumberOfPoints() [1/2]

int mirtk::PointCorrespondence::GetNumberOfPoints ( vtkPointSet *  dataset,
const Array< int > *  sample = NULL 
)
inlinestatic

Get number of points

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
Returns
Number of (sample) points.

Definition at line 429 of file PointCorrespondence.h.

§ GetNumberOfPoints() [2/2]

int mirtk::PointCorrespondence::GetNumberOfPoints ( const RegisteredPointSet dataset,
const Array< int > *  sample = NULL 
)
inlinestatic

Get number of points

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
Returns
Number of (sample) points.

Definition at line 436 of file PointCorrespondence.h.

§ GetPoint() [1/4]

void mirtk::PointCorrespondence::GetPoint ( Point point,
vtkPointSet *  dataset,
const Array< int > *  sample,
int  index 
)
inlinestatic

Get spatial (sample) point

Parameters
[out]pointFeature vector.
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).

Definition at line 471 of file PointCorrespondence.h.

§ GetPoint() [2/4]

void mirtk::PointCorrespondence::GetPoint ( Point point,
const RegisteredPointSet dataset,
const Array< int > *  sample,
int  index 
)
inlinestatic

Get spatial (sample) point

Parameters
[out]pointFeature vector.
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).

Definition at line 478 of file PointCorrespondence.h.

§ GetPoint() [3/4]

void mirtk::PointCorrespondence::GetPoint ( double *  point,
vtkPointSet *  dataset,
const Array< int > *  sample,
int  index,
const FeatureList feature = NULL 
)
inlinestatic

Get feature vector

Parameters
[out]pointFeature vector.
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).
[in]featureIndices/names and weights/rescaling parameters of features.

Definition at line 485 of file PointCorrespondence.h.

§ GetPoint() [4/4]

void mirtk::PointCorrespondence::GetPoint ( double *  point,
const RegisteredPointSet dataset,
const Array< int > *  sample,
int  index,
const FeatureList feature = NULL 
)
inlinestatic

Get feature vector

Parameters
[out]pointFeature vector.
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).
[in]featureIndices/names and weights/rescaling parameters of features.

Definition at line 492 of file PointCorrespondence.h.

§ GetPointDimension() [1/2]

int mirtk::PointCorrespondence::GetPointDimension ( vtkPointSet *  dataset,
const FeatureList feature 
)
inlinestatic

Get size of feature vectors

Parameters
[in]datasetDataset.
[in]featureIndices/names and weights/rescaling parameters of features.

Definition at line 443 of file PointCorrespondence.h.

§ GetPointDimension() [2/2]

int mirtk::PointCorrespondence::GetPointDimension ( const RegisteredPointSet dataset,
const FeatureList feature 
)
inlinestatic

Get size of feature vectors

Parameters
[in]datasetDataset.
[in]featureIndices/names and weights/rescaling parameters of features.

Definition at line 450 of file PointCorrespondence.h.

§ GetPointIndex() [1/2]

int mirtk::PointCorrespondence::GetPointIndex ( vtkPointSet *  dataset,
const Array< int > *  sample,
int  index 
)
inlinestatic

Get index of point

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).
Returns
Index of feature vector/point in dataset.

Definition at line 457 of file PointCorrespondence.h.

§ GetPointIndex() [2/2]

int mirtk::PointCorrespondence::GetPointIndex ( const RegisteredPointSet dataset,
const Array< int > *  sample,
int  index 
)
inlinestatic

Get index of point

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to consider only or NULL for all.
[in]indexIndex of point in dataset or sample (if not NULL).
Returns
Index of feature vector/point in dataset.

Definition at line 464 of file PointCorrespondence.h.

§ GetPoints() [1/2]

vtkSmartPointer< vtkPoints > mirtk::PointCorrespondence::GetPoints ( vtkPointSet *  dataset,
const Array< int > *  sample 
)
inlinestatic

Get subset of sample points

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to extract or NULL for all.
Returns
Set of sample points only.

Definition at line 507 of file PointCorrespondence.h.

§ GetPoints() [2/2]

vtkSmartPointer< vtkPoints > mirtk::PointCorrespondence::GetPoints ( const RegisteredPointSet dataset,
const Array< int > *  sample 
)
inlinestatic

Get subset of sample points

Parameters
[in]datasetRegistered dataset.
[in]sampleIndices of points in dataset to extract or NULL for all.
Returns
Set of sample points only.

Definition at line 526 of file PointCorrespondence.h.

§ GetPointSet() [1/2]

vtkSmartPointer< vtkPointSet > mirtk::PointCorrespondence::GetPointSet ( vtkPointSet *  dataset,
const Array< int > *  sample 
)
inlinestatic

Get subset of sample points

Parameters
[in]datasetDataset.
[in]sampleIndices of points in dataset to extract or NULL for all.
Returns
Dataset consisting of sample points only.

Definition at line 533 of file PointCorrespondence.h.

§ GetPointSet() [2/2]

vtkSmartPointer< vtkPointSet > mirtk::PointCorrespondence::GetPointSet ( const RegisteredPointSet dataset,
const Array< int > *  sample 
)
inlinestatic

Get subset of sample points

Parameters
[in]datasetRegistered dataset.
[in]sampleIndices of points in dataset to extract or NULL for all.
Returns
Dataset consisting of sample points only.

Definition at line 547 of file PointCorrespondence.h.

§ GetSourceIndex()

virtual int mirtk::PointCorrespondence::GetSourceIndex ( int  ) const
virtual

Get index of source point corresponding to i-th target (sample) point

Returns
Index of corresponding source point and -1 if point is an outlier or its corresponding point is not a source vertex position.

Reimplemented in mirtk::ClosestPoint, and mirtk::FiducialMatch.

§ GetTargetIndex()

virtual int mirtk::PointCorrespondence::GetTargetIndex ( int  ) const
virtual

Get index of target point corresponding to i-th source (sample) point

Returns
Index of corresponding target point and -1 if point is an outlier or its corresponding point is not a target vertex position.

Reimplemented in mirtk::ClosestPoint, and mirtk::FiducialMatch.

§ Init()

void mirtk::PointCorrespondence::Init ( )
protected

Common (re-)initialization steps of this class

Note
Must be a non-virtual function!

§ RemoveFeature()

void mirtk::PointCorrespondence::RemoveFeature ( const char *  name)

Remove point data array from list of features to use for point matching

Parameters
[in]nameName of point data array in both target and source dataset.

§ Upgrade()

virtual bool mirtk::PointCorrespondence::Upgrade ( )
virtual

Update correspondence map after convergence

Returns
Whether correspondences have changed.

Reimplemented in mirtk::FuzzyCorrespondence, mirtk::ClosestCell, mirtk::RobustPointMatch, mirtk::ClosestPoint, and mirtk::SpectralMatch.


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