Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mirtk::RegisteredPointSet Class Reference

#include <RegisteredPointSet.h>

Inheritance diagram for mirtk::RegisteredPointSet:
Inheritance graph
Collaboration diagram for mirtk::RegisteredPointSet:
Collaboration graph

Classes

struct  ScalingFunction
 Feature scaling function parameters. More...
 

Public Types

typedef mirtk::EdgeTable EdgeTable
 Adjacency matrix with edge IDs.
 
typedef EdgeConnectivity NodeNeighbors
 Table of n-connected node neighbors.
 
typedef Array< ScalingFunctionScalingFunctions
 Indices and scaling function parameters of transformed point data.
 

Public Member Functions

void BuildEdgeTables ()
 
void BuildLocators ()
 Pre-initialize point/cell locators.
 
void BuildNeighborhoodTables (int n=-1)
 
vtkAbstractCellLocator * CellLocator () const
 
const char * DefaultExtension () const
 Default file name extension.
 
const EdgeTableEdges () const
 
void GetInputPoint (int, double &, double &, double &) const
 Get untransformed input point with specified index.
 
void GetInputPoint (int, double *) const
 Get untransformed input point with specified index.
 
void GetInputPoint (int, Point &) const
 Get untransformed input point with specified index.
 
void GetInputPoints (class PointSet &) const
 Get untransformed points of input data set.
 
void GetInputSurfacePoint (int, double &, double &, double &) const
 Get untransformed input surface point with specified index.
 
void GetInputSurfacePoint (int, double *) const
 Get untransformed input surface point with specified index.
 
void GetInputSurfacePoint (int, Point &) const
 Get untransformed input surface point with specified index.
 
void GetInputSurfacePoints (class PointSet &) const
 Get untransformed points of input point set surface.
 
void GetPoint (int, double &, double &, double &) const
 Get point with specified index.
 
void GetPoint (int, double *) const
 Get point with specified index.
 
void GetPoint (int, Point &) const
 Get point with specified index.
 
void GetPoints (class PointSet &) const
 Get points of point set.
 
void GetSurfacePoint (int, double &, double &, double &) const
 Get point with specified index.
 
void GetSurfacePoint (int, double *) const
 Get point with specified index.
 
void GetSurfacePoint (int, Point &) const
 Get point with specified index.
 
void GetSurfacePoints (class PointSet &) const
 Get point set surface points.
 
void Initialize (bool deep_copy_points=false)
 
vtkDataArray * InitialStatus () const
 Get initial point status array if any.
 
vtkDataArray * InitialSurfaceStatus () const
 Get point status array if any.
 
void InputPointsChanged ()
 Re-copy input point set/surface points.
 
double InputSurfaceArea () const
 Area of input point set surface.
 
const class PointSetInputSurfacePoints () const
 Untransformed points of input point set surface.
 
bool IsSurface () const
 
const NodeNeighborsNeighbors (int=-1) const
 
int NumberOfCells () const
 Get number of cells.
 
int NumberOfEdges () const
 Number of (input) point set edges.
 
int NumberOfPoints () const
 Get number of points.
 
int NumberOfSurfaceCells () const
 Get number of surface cells.
 
int NumberOfSurfaceEdges () const
 Number of (input) surface edges.
 
int NumberOfSurfacePoints () const
 Get number of surface points.
 
 operator vtkDataSet * () const
 Implicit conversion to vtkDataSet pointer.
 
 operator vtkPointSet * () const
 Implicit conversion to vtkPointSet pointer.
 
RegisteredPointSetoperator= (const RegisteredPointSet &)
 Assignment operator.
 
vtkIdTypeArray * OriginalSurfaceCellIds () const
 Get array which stores for each surface cell the input point set cell ID.
 
vtkIdTypeArray * OriginalSurfacePointIds () const
 Get array which stores for each surface point the input point set point ID.
 
vtkAbstractPointLocator * PointLocator () const
 Get point locator.
 
vtkPoints * Points () const
 Get points of point set.
 
void PointsChanged ()
 
vtkPointSet * PointSet () const
 Get (transformed) point set.
 
 RegisteredPointSet (vtkPointSet *=NULL, const class Transformation *=NULL)
 Constructor.
 
 RegisteredPointSet (const RegisteredPointSet &)
 Copy constructor.
 
SharedPtr< const EdgeTableSharedEdgeTable () const
 
SharedPtr< const EdgeTableSharedSurfaceEdgeTable () const
 
vtkDataArray * Status () const
 Get point status array if any.
 
vtkPolyData * Surface () const
 Get output surface.
 
double SurfaceArea () const
 Area of point set surface.
 
vtkAbstractCellLocator * SurfaceCellLocator () const
 
const EdgeTableSurfaceEdges () const
 
vtkDataArray * SurfaceFaceNormals () const
 
const NodeNeighborsSurfaceNeighbors (int=-1) const
 
vtkDataArray * SurfaceNormals () const
 
vtkAbstractPointLocator * SurfacePointLocator () const
 Get surface point locator.
 
vtkPoints * SurfacePoints () const
 Get points of point set surface.
 
vtkDataArray * SurfaceStatus () const
 Get point status array if any.
 
void Update (bool force=false)
 
void Write (const char *, vtkAbstractArray *=NULL, vtkAbstractArray *=NULL) const
 Write transformed dataset to file.
 
void Write (const char *, vtkAbstractArray **, int, vtkAbstractArray **=NULL, int=0) const
 Write transformed dataset to file.
 
 ~RegisteredPointSet ()
 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.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Protected Member Functions

void CopyAttributes (const RegisteredPointSet &)
 Copy attributes of this class from another instance.
 
 mirtkComponentMacro (GenericImage< double >, Displacement)
 Cached displacement field evaluated at each lattice point of _Domain.
 
 mirtkPublicAggregateMacro (const class Transformation, Transformation)
 Current transformation estimate.
 
 mirtkPublicAggregateMacro (GenericImage< double >, ExternalDisplacement)
 Externally pre-computed displacements to use.
 
 mirtkPublicAttributeMacro (vtkSmartPointer< vtkPointSet >, InputPointSet)
 Untransformed input point set.
 
 mirtkPublicAttributeMacro (double, InputTime)
 Time point of input dataset.
 
 mirtkPublicAttributeMacro (double, Time)
 Time point of (transformed) dataset.
 
 mirtkPublicAttributeMacro (ScalingFunctions, PointDataToCopy)
 Indices of point data to copy and (optionally) rescale/normalize.
 
 mirtkPublicAttributeMacro (bool, CopyAll)
 Whether to copy all point and cell data.
 
 mirtkPublicAttributeMacro (int, NeighborhoodRadius)
 (Minimum) radius (maximum edge-connectivity) of node neighborhood
 
 mirtkPublicAttributeMacro (bool, SelfUpdate)
 Whether self-update is enabled.
 
 mirtkPublicAttributeMacro (bool, UpdateSurfaceNormals)
 Whether point normals of output surface need to be recomputed (on demand)
 
 mirtkPublicAttributeMacro (bool, UpdateSurfaceFaceNormals)
 Whether face normals of output surface need to be recomputed (on demand)
 
 mirtkPublicAttributeMacro (ImageAttributes, Domain)
 
 mirtkReadOnlyAttributeMacro (vtkSmartPointer< vtkPolyData >, InputSurface)
 Untransformed surface of input point set.
 
 mirtkReadOnlyAttributeMacro (bool, IsSurfaceMesh)
 Whether this point is a surface mesh.
 
 mirtkReadOnlyAttributeMacro (class PointSet, InputPoints)
 
 mirtkReadOnlyAttributeMacro (double, AverageInputEdgeLength)
 Average edge length of input point set.
 
 mirtkReadOnlyAttributeMacro (double, AverageInputSurfaceEdgeLength)
 Average edge length of input surface.
 
 mirtkReadOnlyAttributeMacro (vtkSmartPointer< vtkPointSet >, OutputPointSet)
 Transformed output point set.
 
 mirtkReadOnlyAttributeMacro (vtkSmartPointer< vtkPolyData >, OutputSurface)
 Transformed output surface.
 
 mirtkReadOnlyAttributeMacro (double, InputDiameter)
 Length of diagonal of input point set bounding box.
 
 mirtkReadOnlyAttributeMacro (double, Diameter)
 Length of diagonal of point set bounding box.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Protected Attributes

vtkSmartPointer< vtkAbstractCellLocator > _CellLocator
 Cell locator (built on demand)
 
SharedPtr< const EdgeTable_EdgeTable
 Edge table of point set (computed on demand)
 
double _InputSurfaceArea
 Input point set surface area (computed on demand)
 
class PointSet_InputSurfacePoints
 
NodeNeighbors _NodeNeighbors
 Edge-connectivities / neighborhood of point set nodes (computed on demand)
 
vtkSmartPointer< vtkAbstractPointLocator > _PointLocator
 Point locator (built on demand)
 
double _SurfaceArea
 Point set surface area (computed on demand)
 
vtkSmartPointer< vtkAbstractCellLocator > _SurfaceCellLocator
 Surface cell locator (built on demand)
 
SharedPtr< const EdgeTable_SurfaceEdgeTable
 Edge table of point set surface (computed on demand)
 
NodeNeighbors _SurfaceNodeNeighbors
 Edge-connectivities / neighborhood of point set surface nodes (computed on demand)
 
vtkSmartPointer< vtkAbstractPointLocator > _SurfacePointLocator
 Surface point locator (built on demand)
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- 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

Registered point set

A registered point set is aligned with another data set (i.e., an image or another point set) through a given transformation. If no transformation is set (i.e., NULL), the point set is fixed and usually serves as target for the registration. Given the pull-back character of image transformations, the point set which is being transformed is generally the one defined in the space of the target image (i.e., the fixed reference image). We therefore refer to the transformed point set as the "target" instead, whereas the "source" point set is usually not transformed. Eventually, however, both target and source point sets may be transformed, e.g., in case of a symmetric registration.

Besides the geometry, i.e., point positions, a point set may also have a topological structure as in case of a tetrahedralized simplicial complex or a boundary surface mesh. Point set distance measures and constraints may be specialized for surface meshes only, such as the surface curvature constraint, for example (CurvatureConstraint). These objective function terms only consider the surface of a given point set which is provided by this class. If the input point set itself is already a vtkPolyData object, the point set and its surface are identical. Otherwise, an instance of this class extracts the surface of the point set using the vtkDataSetSurfaceFilter upon initialization and keeps the point positions and data of the registered point set and its corresponding surface in sync.

Note
VTK does not make use of the const keyword and none of the member functions are declared const. Therefore, returning a pointer to a const VTK object is useless. Thus, this class grants anyone non-const access to the internal VTK data objects even if these are not to be modified by the caller.

Definition at line 74 of file RegisteredPointSet.h.

Member Function Documentation

§ BuildEdgeTables()

void mirtk::RegisteredPointSet::BuildEdgeTables ( )

Pre-initialize edge tables

The edge tables returned by the Edges and SurfaceEdges functions are built upon demand when the respective function is called the first time. If required, a pre-initialization of the edge tables can be requested by calling this function.

§ BuildNeighborhoodTables()

void mirtk::RegisteredPointSet::BuildNeighborhoodTables ( int  n = -1)

Pre-initialize node neighborhood tables

The sets of node neighbors with the given maximum edge-connectivity (or neighborhood radius) are determined on demand upon the first call of the Neighbors and SurfaceNeighbors functions. If required, a pre-initialization of the tables can be requested by calling this function. Beforehand, the required minimum neighborhood radius must be set using the NeighborhoodRadius(int) function unless the desired maximum node connectivity of the neighbors is passed as argument.

§ CellLocator()

vtkAbstractCellLocator* mirtk::RegisteredPointSet::CellLocator ( ) const

Get cell locator

Attention
The VTK cell locators are not thread-safe (at least up to VTK 6.3), not even after vtkLocator::BuildLocator has been called.

§ Edges()

const EdgeTable* mirtk::RegisteredPointSet::Edges ( ) const

Get edge table of point set mesh

Not thread-safe unless _EdgeTable is already initialized (cf. BuildEdgeTables).

§ Initialize()

void mirtk::RegisteredPointSet::Initialize ( bool  deep_copy_points = false)

Initialize (transformed) point set after input and parameters are set

Parameters
[in]deep_copy_pointsWhether to force a deep copy of the input points. If false, the points of the output points is only made when Update transforms the input points.

§ IsSurface()

bool mirtk::RegisteredPointSet::IsSurface ( ) const
inline

Whether (input) point set is a polygonal surface mesh Otherwise, the surface of the point set is extracted by Initialize.

Definition at line 537 of file RegisteredPointSet.h.

§ mirtkPublicAttributeMacro()

mirtk::RegisteredPointSet::mirtkPublicAttributeMacro ( ImageAttributes  ,
Domain   
)
protected

Domain on which to evaluate transformation if it requires caching The obtained deformation field is interpolated linearly.

§ mirtkReadOnlyAttributeMacro()

mirtk::RegisteredPointSet::mirtkReadOnlyAttributeMacro ( class PointSet  ,
InputPoints   
)
protected

(Cached) Untransformed input points used by energy terms for gradient calculation

§ Neighbors()

const NodeNeighbors* mirtk::RegisteredPointSet::Neighbors ( int  = -1) const

Get edge-connectivity table of point set node neighbors

Not thread-safe unless _NodeNeighbors is already initialized with a neighborhood radius greater or equal the requested minimum radius (cf. BuildNeighborhoodTables).

§ PointsChanged()

void mirtk::RegisteredPointSet::PointsChanged ( )

Called when the output points have been modified (cf. DeformableSurfaceModel without FFD)

§ SharedEdgeTable()

SharedPtr<const EdgeTable> mirtk::RegisteredPointSet::SharedEdgeTable ( ) const

Get shared pointer to edge table

Not thread-safe unless _EdgeTable is already initialized (cf. BuildEdgeTables).

§ SharedSurfaceEdgeTable()

SharedPtr<const EdgeTable> mirtk::RegisteredPointSet::SharedSurfaceEdgeTable ( ) const

Get shared pointer to surface edge table

Not thread-safe unless _SurfaceEdgeTable (or _EdgeTable if input point set is a surface mesh) is already initialized (cf. BuildEdgeTables).

§ SurfaceCellLocator()

vtkAbstractCellLocator* mirtk::RegisteredPointSet::SurfaceCellLocator ( ) const

Get surface cell locator

Attention
The VTK cell locators are not thread-safe (at least up to VTK 6.3), not even after vtkLocator::BuildLocator has been called.

§ SurfaceEdges()

const EdgeTable* mirtk::RegisteredPointSet::SurfaceEdges ( ) const

Get edge table of point set surface mesh

Not thread-safe unless _SurfaceEdgeTable (or _EdgeTable if input point set is a surface mesh) is already initialized (cf. BuildEdgeTables).

§ SurfaceFaceNormals()

vtkDataArray* mirtk::RegisteredPointSet::SurfaceFaceNormals ( ) const

Get output surface (cell) normals

Not thread-safe unless _UpdateSurfaceFaceNormals is false, i.e., when this function was called by main thread after Update.

§ SurfaceNeighbors()

const NodeNeighbors* mirtk::RegisteredPointSet::SurfaceNeighbors ( int  = -1) const

Get edge-connectivity table of point set surface node neighbors

Not thread-safe unless _SurfaceNodeNeighbors is already initialized with a neighborhood radius greater or equal the requested minimum radius (cf. BuildNeighborhoodTables).

§ SurfaceNormals()

vtkDataArray* mirtk::RegisteredPointSet::SurfaceNormals ( ) const

Get output surface (point) normals

Not thread-safe unless _UpdateSurfaceNormals is false, i.e., when this function was called by main thread after Update.

§ Update()

void mirtk::RegisteredPointSet::Update ( bool  force = false)

Update (transformed) dataset

This function only updates the output points if the self-update attribute is enabled and only if a (changing) transformation is set. If the dataset is not transformed or only mapped by a fixed transformation, this function does nothing. Use force=true to initialize this point set even if it does not change over the course of the registration.

Parameters
[in]forceForce update in any case.

Member Data Documentation

§ _InputSurfacePoints

class PointSet* mirtk::RegisteredPointSet::_InputSurfacePoints
protected

(Cached) Untransformed input surface points used by energy terms for gradient calculation

Definition at line 123 of file RegisteredPointSet.h.


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