20 #ifndef MIRTK_RegisteredPointSet_H 21 #define MIRTK_RegisteredPointSet_H 23 #include "mirtk/Object.h" 25 #include "mirtk/Array.h" 26 #include "mirtk/PointSet.h" 27 #include "mirtk/Transformation.h" 28 #include "mirtk/EdgeTable.h" 29 #include "mirtk/EdgeConnectivity.h" 31 #include "vtkSmartPointer.h" 32 #include "vtkPointSet.h" 33 #include "vtkPolyData.h" 34 #include "vtkAbstractPointLocator.h" 35 #include "vtkAbstractCellLocator.h" 36 #include "vtkIdTypeArray.h" 235 void Initialize(
bool deep_copy_points =
false);
334 operator vtkDataSet *()
const;
337 operator vtkPointSet *()
const;
340 vtkPoints *
Points()
const;
345 const EdgeTable *
Edges()
const;
357 const NodeNeighbors *
Neighbors(
int = -1)
const;
363 vtkDataArray *
Status()
const;
375 void GetPoint(
int,
double &,
double &,
double &)
const;
468 void Update(
bool force =
false);
477 void Write(
const char *, vtkAbstractArray * = NULL, vtkAbstractArray * = NULL)
const;
480 void Write(
const char *, vtkAbstractArray **,
int, vtkAbstractArray ** = NULL,
int = 0)
const;
495 return const_cast<vtkPointSet *
>(_InputPointSet.GetPointer())->GetNumberOfPoints();
501 return const_cast<vtkPointSet *
>(_InputPointSet.GetPointer())->GetNumberOfCells();
507 return Edges()->NumberOfEdges();
514 _InputPointSet->GetPoints()->GetPoint(i, p);
515 x = p[0], y = p[1], z = p[2];
521 _InputPointSet->GetPoints()->GetPoint(i, p);
528 _InputPointSet->GetPoints()->GetPoint(i, p);
529 pt.
_x = p[0], pt.
_y = p[1], pt.
_z = p[2];
539 return _IsSurfaceMesh;
545 return const_cast<vtkPolyData *
>(_InputSurface.GetPointer())->GetNumberOfPoints();
551 return const_cast<vtkPolyData *
>(_InputSurface.GetPointer())->GetNumberOfCells();
564 _InputSurface->GetPoints()->GetPoint(i, p);
565 x = p[0], y = p[1], z = p[2];
571 _InputSurface->GetPoints()->GetPoint(i, p);
578 _InputSurface->GetPoints()->GetPoint(i, p);
579 pt.
_x = p[0], pt.
_y = p[1], pt.
_z = p[2];
593 inline RegisteredPointSet::operator vtkDataSet *()
const 595 return _OutputPointSet.GetPointer();
599 inline RegisteredPointSet::operator vtkPointSet *()
const 601 return _OutputPointSet.GetPointer();
607 return _OutputPointSet.GetPointer();
613 return _OutputPointSet->GetPoints();
620 _OutputPointSet->GetPoints()->GetPoint(i, p);
621 x = p[0], y = p[1], z = p[2];
627 _OutputPointSet->GetPoints()->GetPoint(i, p);
634 _OutputPointSet->GetPoints()->GetPoint(i, p);
635 pt.
_x = p[0], pt.
_y = p[1], pt.
_z = p[2];
645 return _OutputSurface.GetPointer();
651 return _OutputSurface->GetPoints();
658 _OutputSurface->GetPoints()->GetPoint(i, p);
659 x = p[0], y = p[1], z = p[2];
665 _OutputSurface->GetPoints()->GetPoint(i, p);
672 _OutputSurface->GetPoints()->GetPoint(i, p);
673 pt.
_x = p[0], pt.
_y = p[1], pt.
_z = p[2];
679 #endif // MIRTK_RegisteredPointSet_H double _SurfaceArea
Point set surface area (computed on demand)
EdgeConnectivity NodeNeighbors
Table of n-connected node neighbors.
vtkSmartPointer< vtkAbstractPointLocator > _SurfacePointLocator
Surface point locator (built on demand)
SharedPtr< const EdgeTable > SharedSurfaceEdgeTable() const
vtkSmartPointer< vtkAbstractCellLocator > _CellLocator
Cell locator (built on demand)
void GetSurfacePoints(class PointSet &) const
Get point set surface points.
double _Intercept
Intercept of linear scaling function.
void GetInputPoint(int, double &, double &, double &) const
Get untransformed input point with specified index.
vtkPolyData * Surface() const
Get output surface.
mirtk::EdgeTable EdgeTable
Adjacency matrix with edge IDs.
double SurfaceArea() const
Area of point set surface.
vtkPointSet * PointSet() const
Get (transformed) point set.
mirtkReadOnlyAttributeMacro(vtkSmartPointer< vtkPolyData >, InputSurface)
Untransformed surface of input point set.
SharedPtr< const EdgeTable > _SurfaceEdgeTable
Edge table of point set surface (computed on demand)
vtkDataArray * SurfaceNormals() const
vtkAbstractCellLocator * CellLocator() const
double _x
x coordinate of Point
vtkDataArray * SurfaceFaceNormals() const
mirtkPublicAggregateMacro(const class Transformation, Transformation)
Current transformation estimate.
vtkPoints * Points() const
Get points of point set.
vtkIdTypeArray * OriginalSurfacePointIds() const
Get array which stores for each surface point the input point set point ID.
NodeNeighbors _SurfaceNodeNeighbors
Edge-connectivities / neighborhood of point set surface nodes (computed on demand) ...
void CopyAttributes(const RegisteredPointSet &)
Copy attributes of this class from another instance.
vtkAbstractPointLocator * PointLocator() const
Get point locator.
int NumberOfCells() const
Get number of cells.
Array< ScalingFunction > ScalingFunctions
Indices and scaling function parameters of transformed point data.
vtkDataArray * Status() const
Get point status array if any.
int _InputIndex
Feature point data index in input dataset.
vtkDataArray * InitialSurfaceStatus() const
Get point status array if any.
double _Slope
Slope of linear scaling function.
int NumberOfSurfaceCells() const
Get number of surface cells.
void BuildNeighborhoodTables(int n=-1)
const char * DefaultExtension() const
Default file name extension.
int NumberOfSurfaceEdges() const
Number of (input) surface edges.
vtkIdTypeArray * OriginalSurfaceCellIds() const
Get array which stores for each surface cell the input point set cell ID.
vtkAbstractPointLocator * SurfacePointLocator() const
Get surface point locator.
const class PointSet & InputSurfacePoints() const
Untransformed points of input point set surface.
void GetPoint(int, double &, double &, double &) const
Get point with specified index.
vtkDataArray * InitialStatus() const
Get initial point status array if any.
void Initialize(bool deep_copy_points=false)
void Write(const char *, vtkAbstractArray *=NULL, vtkAbstractArray *=NULL) const
Write transformed dataset to file.
void GetInputSurfacePoints(class PointSet &) const
Get untransformed points of input point set surface.
void GetInputSurfacePoint(int, double &, double &, double &) const
Get untransformed input surface point with specified index.
NodeNeighbors _NodeNeighbors
Edge-connectivities / neighborhood of point set nodes (computed on demand)
RegisteredPointSet(vtkPointSet *=NULL, const class Transformation *=NULL)
Constructor.
vtkSmartPointer< vtkAbstractPointLocator > _PointLocator
Point locator (built on demand)
vtkPoints * SurfacePoints() const
Get points of point set surface.
mirtkComponentMacro(GenericImage< double >, Displacement)
Cached displacement field evaluated at each lattice point of _Domain.
void GetSurfacePoint(int, double &, double &, double &) const
Get point with specified index.
int _OutputIndex
Feature point data index in output dataset.
~RegisteredPointSet()
Destructor.
void InputPointsChanged()
Re-copy input point set/surface points.
class PointSet * _InputSurfacePoints
const NodeNeighbors * Neighbors(int=-1) const
SharedPtr< const EdgeTable > SharedEdgeTable() const
const EdgeTable * Edges() const
RegisteredPointSet & operator=(const RegisteredPointSet &)
Assignment operator.
int NumberOfEdges() const
Number of (input) point set edges.
Feature scaling function parameters.
mirtkPublicAttributeMacro(vtkSmartPointer< vtkPointSet >, InputPointSet)
Untransformed input point set.
double InputSurfaceArea() const
Area of input point set surface.
double _z
z coordinate of Point
vtkDataArray * SurfaceStatus() const
Get point status array if any.
const EdgeTable * SurfaceEdges() const
double _InputSurfaceArea
Input point set surface area (computed on demand)
double _y
y coordinate of Point
SharedPtr< const EdgeTable > _EdgeTable
Edge table of point set (computed on demand)
void Update(bool force=false)
int NumberOfSurfacePoints() const
Get number of surface points.
const NodeNeighbors * SurfaceNeighbors(int=-1) const
int NumberOfPoints() const
Get number of points.
vtkSmartPointer< vtkAbstractCellLocator > _SurfaceCellLocator
Surface cell locator (built on demand)
bool IsSurfaceMesh(vtkDataSet *)
Determine whether a point set is a surface mesh.
void BuildLocators()
Pre-initialize point/cell locators.
vtkAbstractCellLocator * SurfaceCellLocator() const
void GetPoints(class PointSet &) const
Get points of point set.
void GetInputPoints(class PointSet &) const
Get untransformed points of input data set.