RegisteredPointSet.h
1 /*
2  * Medical Image Registration ToolKit (MIRTK)
3  *
4  * Copyright 2013-2016 Imperial College London
5  * Copyright 2013-2016 Andreas Schuh
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef MIRTK_RegisteredPointSet_H
21 #define MIRTK_RegisteredPointSet_H
22 
23 #include "mirtk/Object.h"
24 
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"
30 
31 #include "vtkSmartPointer.h"
32 #include "vtkPointSet.h"
33 #include "vtkPolyData.h"
34 #include "vtkAbstractPointLocator.h"
35 #include "vtkAbstractCellLocator.h"
36 #include "vtkIdTypeArray.h"
37 
38 
39 namespace mirtk {
40 
41 
42 /**
43  * Registered point set
44  *
45  * A registered point set is aligned with another data set (i.e., an image or
46  * another point set) through a given transformation. If no transformation is
47  * set (i.e., NULL), the point set is fixed and usually serves as target for
48  * the registration. Given the pull-back character of image transformations,
49  * the point set which is being transformed is generally the one defined in
50  * the space of the target image (i.e., the fixed reference image). We therefore
51  * refer to the transformed point set as the "target" instead, whereas the
52  * "source" point set is usually not transformed. Eventually, however, both
53  * target and source point sets may be transformed, e.g., in case of a
54  * symmetric registration.
55  *
56  * Besides the geometry, i.e., point positions, a point set may also have a
57  * topological structure as in case of a tetrahedralized simplicial complex or
58  * a boundary surface mesh. Point set distance measures and constraints may be
59  * specialized for surface meshes only, such as the surface curvature constraint,
60  * for example (CurvatureConstraint). These objective function terms only
61  * consider the surface of a given point set which is provided by this class.
62  * If the input point set itself is already a vtkPolyData object, the point set
63  * and its surface are identical. Otherwise, an instance of this class extracts
64  * the surface of the point set using the vtkDataSetSurfaceFilter upon
65  * initialization and keeps the point positions and data of the registered point
66  * set and its corresponding surface in sync.
67  *
68  * \note VTK does not make use of the const keyword and none of the member
69  * functions are declared const. Therefore, returning a pointer to a
70  * const VTK object is useless. Thus, this class grants anyone non-const
71  * access to the internal VTK data objects even if these are not to be
72  * modified by the caller.
73  */
74 class RegisteredPointSet : public Object
75 {
76  mirtkObjectMacro(RegisteredPointSet);
77 
78  // ---------------------------------------------------------------------------
79  // Types
80 public:
81 
82  /// Feature scaling function parameters
84  {
85  int _InputIndex; ///< Feature point data index in input dataset
86  int _OutputIndex; ///< Feature point data index in output dataset
87  double _Slope; ///< Slope of linear scaling function
88  double _Intercept; ///< Intercept of linear scaling function
89  };
90 
91  /// Indices and scaling function parameters of transformed point data
92  typedef Array<ScalingFunction> ScalingFunctions;
93 
94  /// Adjacency matrix with edge IDs
96 
97  /// Table of n-connected node neighbors
99 
100  // ---------------------------------------------------------------------------
101  // Attributes
102 
103  /// Get (transformed) point set
104  vtkPointSet *PointSet() const;
105 
106 protected:
107 
108  /// Untransformed input point set
109  mirtkPublicAttributeMacro(vtkSmartPointer<vtkPointSet>, InputPointSet);
110 
111  /// Untransformed surface of input point set
112  mirtkReadOnlyAttributeMacro(vtkSmartPointer<vtkPolyData>, InputSurface);
113 
114  /// Whether this point is a surface mesh
116 
117  /// (Cached) Untransformed input points
118  /// used by energy terms for gradient calculation
119  mirtkReadOnlyAttributeMacro(class PointSet, InputPoints);
120 
121  /// (Cached) Untransformed input surface points
122  /// used by energy terms for gradient calculation
124 
125  /// Time point of input dataset
126  mirtkPublicAttributeMacro(double, InputTime);
127 
128  /// Time point of (transformed) dataset
129  mirtkPublicAttributeMacro(double, Time);
130 
131  /// Current transformation estimate
133 
134  /// Indices of point data to copy and (optionally) rescale/normalize
135  mirtkPublicAttributeMacro(ScalingFunctions, PointDataToCopy);
136 
137  /// Whether to copy all point and cell data
138  mirtkPublicAttributeMacro(bool, CopyAll);
139 
140  /// (Minimum) radius (maximum edge-connectivity) of node neighborhood
141  mirtkPublicAttributeMacro(int, NeighborhoodRadius);
142 
143  /// Average edge length of input point set
144  mirtkReadOnlyAttributeMacro(double, AverageInputEdgeLength);
145 
146  /// Average edge length of input surface
147  mirtkReadOnlyAttributeMacro(double, AverageInputSurfaceEdgeLength);
148 
149  /// Transformed output point set
150  mirtkReadOnlyAttributeMacro(vtkSmartPointer<vtkPointSet>, OutputPointSet);
151 
152  /// Transformed output surface
153  mirtkReadOnlyAttributeMacro(vtkSmartPointer<vtkPolyData>, OutputSurface);
154 
155  /// Length of diagonal of input point set bounding box
156  mirtkReadOnlyAttributeMacro(double, InputDiameter);
157 
158  /// Length of diagonal of point set bounding box
159  mirtkReadOnlyAttributeMacro(double, Diameter);
160 
161  /// Edge table of point set (computed on demand)
162  mutable SharedPtr<const EdgeTable> _EdgeTable;
163 
164  /// Edge table of point set surface (computed on demand)
165  mutable SharedPtr<const EdgeTable> _SurfaceEdgeTable;
166 
167  /// Edge-connectivities / neighborhood of point set nodes (computed on demand)
168  mutable NodeNeighbors _NodeNeighbors;
169 
170  /// Edge-connectivities / neighborhood of point set surface nodes (computed on demand)
171  mutable NodeNeighbors _SurfaceNodeNeighbors;
172 
173  /// Input point set surface area (computed on demand)
174  mutable double _InputSurfaceArea;
175 
176  /// Point set surface area (computed on demand)
177  mutable double _SurfaceArea;
178 
179  /// Point locator (built on demand)
180  vtkSmartPointer<vtkAbstractPointLocator> _PointLocator;
181 
182  /// Surface point locator (built on demand)
183  vtkSmartPointer<vtkAbstractPointLocator> _SurfacePointLocator;
184 
185  /// Cell locator (built on demand)
186  vtkSmartPointer<vtkAbstractCellLocator> _CellLocator;
187 
188  /// Surface cell locator (built on demand)
189  vtkSmartPointer<vtkAbstractCellLocator> _SurfaceCellLocator;
190 
191  /// Whether self-update is enabled
192  mirtkPublicAttributeMacro(bool, SelfUpdate);
193 
194  /// Whether point normals of output surface need to be recomputed (on demand)
195  mirtkPublicAttributeMacro(bool, UpdateSurfaceNormals);
196 
197  /// Whether face normals of output surface need to be recomputed (on demand)
198  mirtkPublicAttributeMacro(bool, UpdateSurfaceFaceNormals);
199 
200  /// Domain on which to evaluate transformation if it requires caching
201  /// The obtained deformation field is interpolated linearly.
203 
204  /// Externally pre-computed displacements to use
205  mirtkPublicAggregateMacro(GenericImage<double>, ExternalDisplacement);
206 
207  /// Cached displacement field evaluated at each lattice point of _Domain
209 
210  /// Copy attributes of this class from another instance
211  void CopyAttributes(const RegisteredPointSet &);
212 
213  // ---------------------------------------------------------------------------
214  // Construction/Destruction
215 public:
216 
217  /// Constructor
218  RegisteredPointSet(vtkPointSet * = NULL, const class Transformation * = NULL);
219 
220  /// Copy constructor
222 
223  /// Assignment operator
225 
226  /// Destructor
228 
229  /// Initialize (transformed) point set after input and parameters are set
230  ///
231  /// \param[in] deep_copy_points Whether to force a deep copy of the input
232  /// points. If \c false, the points of the
233  /// output points is only made when Update
234  /// transforms the input points.
235  void Initialize(bool deep_copy_points = false);
236 
237  /// Re-copy input point set/surface points
238  void InputPointsChanged();
239 
240  /// Called when the output points have been modified
241  /// (cf. DeformableSurfaceModel without FFD)
242  void PointsChanged();
243 
244  /// Pre-initialize edge tables
245  ///
246  /// The edge tables returned by the Edges and SurfaceEdges functions are
247  /// built upon demand when the respective function is called the first time.
248  /// If required, a pre-initialization of the edge tables can be requested by
249  /// calling this function.
250  void BuildEdgeTables();
251 
252  /// Pre-initialize node neighborhood tables
253  ///
254  /// The sets of node neighbors with the given maximum edge-connectivity
255  /// (or neighborhood radius) are determined on demand upon the first call
256  /// of the Neighbors and SurfaceNeighbors functions. If required,
257  /// a pre-initialization of the tables can be requested by calling this
258  /// function. Beforehand, the required minimum neighborhood radius must be
259  /// set using the NeighborhoodRadius(int) function unless the desired maximum
260  /// node connectivity of the neighbors is passed as argument.
261  void BuildNeighborhoodTables(int n = -1);
262 
263  /// Pre-initialize point/cell locators
264  void BuildLocators();
265 
266  // ---------------------------------------------------------------------------
267  // Input point set
268 
269  /// Get number of points
270  int NumberOfPoints() const;
271 
272  /// Get number of cells
273  int NumberOfCells() const;
274 
275  /// Number of (input) point set edges
276  int NumberOfEdges() const;
277 
278  /// Get untransformed input point with specified index
279  void GetInputPoint(int, double &, double &, double &) const;
280 
281  /// Get untransformed input point with specified index
282  void GetInputPoint(int, double *) const;
283 
284  /// Get untransformed input point with specified index
285  void GetInputPoint(int, Point &) const;
286 
287  /// Get untransformed points of input data set
288  void GetInputPoints(class PointSet &) const;
289 
290  // ---------------------------------------------------------------------------
291  // Input point set surface
292 
293  /// Whether (input) point set is a polygonal surface mesh
294  /// Otherwise, the surface of the point set is extracted by Initialize.
295  bool IsSurface() const;
296 
297  /// Get number of surface points
298  int NumberOfSurfacePoints() const;
299 
300  /// Get number of surface cells
301  int NumberOfSurfaceCells() const;
302 
303  /// Number of (input) surface edges
304  int NumberOfSurfaceEdges() const;
305 
306  /// Get array which stores for each surface point the input point set point ID
307  vtkIdTypeArray *OriginalSurfacePointIds() const;
308 
309  /// Get array which stores for each surface cell the input point set cell ID
310  vtkIdTypeArray *OriginalSurfaceCellIds() const;
311 
312  /// Get untransformed input surface point with specified index
313  void GetInputSurfacePoint(int, double &, double &, double &) const;
314 
315  /// Get untransformed input surface point with specified index
316  void GetInputSurfacePoint(int, double *) const;
317 
318  /// Get untransformed input surface point with specified index
319  void GetInputSurfacePoint(int, Point &) const;
320 
321  /// Get untransformed points of input point set surface
322  void GetInputSurfacePoints(class PointSet &) const;
323 
324  /// Untransformed points of input point set surface
325  const class PointSet &InputSurfacePoints() const;
326 
327  /// Area of input point set surface
328  double InputSurfaceArea() const;
329 
330  // ---------------------------------------------------------------------------
331  // Point set access
332 
333  /// Implicit conversion to vtkDataSet pointer
334  operator vtkDataSet *() const;
335 
336  /// Implicit conversion to vtkPointSet pointer
337  operator vtkPointSet *() const;
338 
339  /// Get points of point set
340  vtkPoints *Points() const;
341 
342  /// Get edge table of point set mesh
343  ///
344  /// Not thread-safe unless \c _EdgeTable is already initialized (cf. BuildEdgeTables).
345  const EdgeTable *Edges() const;
346 
347  /// Get shared pointer to edge table
348  ///
349  /// Not thread-safe unless \c _EdgeTable is already initialized (cf. BuildEdgeTables).
350  SharedPtr<const EdgeTable> SharedEdgeTable() const;
351 
352  /// Get edge-connectivity table of point set node neighbors
353  ///
354  /// Not thread-safe unless \c _NodeNeighbors is already initialized with a
355  /// neighborhood radius greater or equal the requested minimum radius
356  /// (cf. BuildNeighborhoodTables).
357  const NodeNeighbors *Neighbors(int = -1) const;
358 
359  /// Get initial point status array if any
360  vtkDataArray *InitialStatus() const;
361 
362  /// Get point status array if any
363  vtkDataArray *Status() const;
364 
365  /// Get point locator
366  vtkAbstractPointLocator *PointLocator() const;
367 
368  /// Get cell locator
369  ///
370  /// \attention The VTK cell locators are not thread-safe (at least up to VTK 6.3),
371  /// not even after vtkLocator::BuildLocator has been called.
372  vtkAbstractCellLocator *CellLocator() const;
373 
374  /// Get point with specified index
375  void GetPoint(int, double &, double &, double &) const;
376 
377  /// Get point with specified index
378  void GetPoint(int, double *) const;
379 
380  /// Get point with specified index
381  void GetPoint(int, Point &) const;
382 
383  /// Get points of point set
384  void GetPoints(class PointSet &) const;
385 
386  // ---------------------------------------------------------------------------
387  // Point set surface access
388 
389  /// Get output surface
390  vtkPolyData *Surface() const;
391 
392  /// Get points of point set surface
393  vtkPoints *SurfacePoints() const;
394 
395  /// Get output surface (point) normals
396  ///
397  /// Not thread-safe unless \c _UpdateSurfaceNormals is \c false,
398  /// i.e., when this function was called by main thread after Update.
399  vtkDataArray *SurfaceNormals() const;
400 
401  /// Get output surface (cell) normals
402  ///
403  /// Not thread-safe unless \c _UpdateSurfaceFaceNormals is \c false,
404  /// i.e., when this function was called by main thread after Update.
405  vtkDataArray *SurfaceFaceNormals() const;
406 
407  /// Get edge table of point set surface mesh
408  ///
409  /// Not thread-safe unless \c _SurfaceEdgeTable (or \c _EdgeTable if input
410  /// point set is a surface mesh) is already initialized (cf. BuildEdgeTables).
411  const EdgeTable *SurfaceEdges() const;
412 
413  /// Get shared pointer to surface edge table
414  ///
415  /// Not thread-safe unless \c _SurfaceEdgeTable (or \c _EdgeTable if input
416  /// point set is a surface mesh) is already initialized (cf. BuildEdgeTables).
417  SharedPtr<const EdgeTable> SharedSurfaceEdgeTable() const;
418 
419  /// Get edge-connectivity table of point set surface node neighbors
420  ///
421  /// Not thread-safe unless \c _SurfaceNodeNeighbors is already initialized
422  /// with a neighborhood radius greater or equal the requested minimum radius
423  /// (cf. BuildNeighborhoodTables).
424  const NodeNeighbors *SurfaceNeighbors(int = -1) const;
425 
426  /// Get point status array if any
427  vtkDataArray *InitialSurfaceStatus() const;
428 
429  /// Get point status array if any
430  vtkDataArray *SurfaceStatus() const;
431 
432  /// Area of point set surface
433  double SurfaceArea() const;
434 
435  /// Get surface point locator
436  vtkAbstractPointLocator *SurfacePointLocator() const;
437 
438  /// Get surface cell locator
439  ///
440  /// \attention The VTK cell locators are not thread-safe (at least up to VTK 6.3),
441  /// not even after vtkLocator::BuildLocator has been called.
442  vtkAbstractCellLocator *SurfaceCellLocator() const;
443 
444  /// Get point with specified index
445  void GetSurfacePoint(int, double &, double &, double &) const;
446 
447  /// Get point with specified index
448  void GetSurfacePoint(int, double *) const;
449 
450  /// Get point with specified index
451  void GetSurfacePoint(int, Point &) const;
452 
453  /// Get point set surface points
454  void GetSurfacePoints(class PointSet &) const;
455 
456  // ---------------------------------------------------------------------------
457  // Update
458 
459  /// Update (transformed) dataset
460  ///
461  /// This function only updates the output points if the self-update attribute
462  /// is enabled and only if a (changing) transformation is set. If the dataset
463  /// is not transformed or only mapped by a fixed transformation, this function
464  /// does nothing. Use \c force=true to initialize this point set even if it
465  /// does not change over the course of the registration.
466  ///
467  /// \param[in] force Force update in any case.
468  void Update(bool force = false);
469 
470  // ---------------------------------------------------------------------------
471  // Debugging
472 
473  /// Default file name extension
474  const char *DefaultExtension() const;
475 
476  /// Write transformed dataset to file
477  void Write(const char *, vtkAbstractArray * = NULL, vtkAbstractArray * = NULL) const;
478 
479  /// Write transformed dataset to file
480  void Write(const char *, vtkAbstractArray **, int, vtkAbstractArray ** = NULL, int = 0) const;
481 
482 };
483 
484 ////////////////////////////////////////////////////////////////////////////////
485 // Inline definitions
486 ////////////////////////////////////////////////////////////////////////////////
487 
488 // =============================================================================
489 // Input point set
490 // =============================================================================
491 
492 // -----------------------------------------------------------------------------
494 {
495  return const_cast<vtkPointSet *>(_InputPointSet.GetPointer())->GetNumberOfPoints();
496 }
497 
498 // -----------------------------------------------------------------------------
500 {
501  return const_cast<vtkPointSet *>(_InputPointSet.GetPointer())->GetNumberOfCells();
502 }
503 
504 // -----------------------------------------------------------------------------
506 {
507  return Edges()->NumberOfEdges();
508 }
509 
510 // -----------------------------------------------------------------------------
511 inline void RegisteredPointSet::GetInputPoint(int i, double &x, double &y, double &z) const
512 {
513  double p[3];
514  _InputPointSet->GetPoints()->GetPoint(i, p);
515  x = p[0], y = p[1], z = p[2];
516 }
517 
518 // -----------------------------------------------------------------------------
519 inline void RegisteredPointSet::GetInputPoint(int i, double *p) const
520 {
521  _InputPointSet->GetPoints()->GetPoint(i, p);
522 }
523 
524 // -----------------------------------------------------------------------------
525 inline void RegisteredPointSet::GetInputPoint(int i, Point &pt) const
526 {
527  double p[3];
528  _InputPointSet->GetPoints()->GetPoint(i, p);
529  pt._x = p[0], pt._y = p[1], pt._z = p[2];
530 }
531 
532 // =============================================================================
533 // Input point set surface
534 // =============================================================================
535 
536 // -----------------------------------------------------------------------------
537 inline bool RegisteredPointSet::IsSurface() const
538 {
539  return _IsSurfaceMesh;
540 }
541 
542 // -----------------------------------------------------------------------------
544 {
545  return const_cast<vtkPolyData *>(_InputSurface.GetPointer())->GetNumberOfPoints();
546 }
547 
548 // -----------------------------------------------------------------------------
550 {
551  return const_cast<vtkPolyData *>(_InputSurface.GetPointer())->GetNumberOfCells();
552 }
553 
554 // -----------------------------------------------------------------------------
556 {
557  return SurfaceEdges()->NumberOfEdges();
558 }
559 
560 // -----------------------------------------------------------------------------
561 inline void RegisteredPointSet::GetInputSurfacePoint(int i, double &x, double &y, double &z) const
562 {
563  double p[3];
564  _InputSurface->GetPoints()->GetPoint(i, p);
565  x = p[0], y = p[1], z = p[2];
566 }
567 
568 // -----------------------------------------------------------------------------
569 inline void RegisteredPointSet::GetInputSurfacePoint(int i, double *p) const
570 {
571  _InputSurface->GetPoints()->GetPoint(i, p);
572 }
573 
574 // -----------------------------------------------------------------------------
575 inline void RegisteredPointSet::GetInputSurfacePoint(int i, Point &pt) const
576 {
577  double p[3];
578  _InputSurface->GetPoints()->GetPoint(i, p);
579  pt._x = p[0], pt._y = p[1], pt._z = p[2];
580 }
581 
582 // -----------------------------------------------------------------------------
584 {
585  return *_InputSurfacePoints;
586 }
587 
588 // =============================================================================
589 // Point set
590 // =============================================================================
591 
592 // -----------------------------------------------------------------------------
593 inline RegisteredPointSet::operator vtkDataSet *() const
594 {
595  return _OutputPointSet.GetPointer();
596 }
597 
598 // -----------------------------------------------------------------------------
599 inline RegisteredPointSet::operator vtkPointSet *() const
600 {
601  return _OutputPointSet.GetPointer();
602 }
603 
604 // -----------------------------------------------------------------------------
605 inline vtkPointSet *RegisteredPointSet::PointSet() const
606 {
607  return _OutputPointSet.GetPointer();
608 }
609 
610 // -----------------------------------------------------------------------------
611 inline vtkPoints *RegisteredPointSet::Points() const
612 {
613  return _OutputPointSet->GetPoints();
614 }
615 
616 // -----------------------------------------------------------------------------
617 inline void RegisteredPointSet::GetPoint(int i, double &x, double &y, double &z) const
618 {
619  double p[3];
620  _OutputPointSet->GetPoints()->GetPoint(i, p);
621  x = p[0], y = p[1], z = p[2];
622 }
623 
624 // -----------------------------------------------------------------------------
625 inline void RegisteredPointSet::GetPoint(int i, double *p) const
626 {
627  _OutputPointSet->GetPoints()->GetPoint(i, p);
628 }
629 
630 // -----------------------------------------------------------------------------
631 inline void RegisteredPointSet::GetPoint(int i, Point &pt) const
632 {
633  double p[3];
634  _OutputPointSet->GetPoints()->GetPoint(i, p);
635  pt._x = p[0], pt._y = p[1], pt._z = p[2];
636 }
637 
638 // =============================================================================
639 // Point set surface
640 // =============================================================================
641 
642 // -----------------------------------------------------------------------------
643 inline vtkPolyData *RegisteredPointSet::Surface() const
644 {
645  return _OutputSurface.GetPointer();
646 }
647 
648 // -----------------------------------------------------------------------------
649 inline vtkPoints *RegisteredPointSet::SurfacePoints() const
650 {
651  return _OutputSurface->GetPoints();
652 }
653 
654 // -----------------------------------------------------------------------------
655 inline void RegisteredPointSet::GetSurfacePoint(int i, double &x, double &y, double &z) const
656 {
657  double p[3];
658  _OutputSurface->GetPoints()->GetPoint(i, p);
659  x = p[0], y = p[1], z = p[2];
660 }
661 
662 // -----------------------------------------------------------------------------
663 inline void RegisteredPointSet::GetSurfacePoint(int i, double *p) const
664 {
665  _OutputSurface->GetPoints()->GetPoint(i, p);
666 }
667 
668 // -----------------------------------------------------------------------------
669 inline void RegisteredPointSet::GetSurfacePoint(int i, Point &pt) const
670 {
671  double p[3];
672  _OutputSurface->GetPoints()->GetPoint(i, p);
673  pt._x = p[0], pt._y = p[1], pt._z = p[2];
674 }
675 
676 
677 } // namespace mirtk
678 
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
Definition: Point.h:46
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)
Definition: IOConfig.h:41
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
Definition: Point.h:48
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
Definition: Point.h:47
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.