Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkProjectMarkupsCurvePointsFilter.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkProjectMarkupsCurvePointsFilter_h
19#define __vtkProjectMarkupsCurvePointsFilter_h
20
21#include "vtkMRMLExport.h"
22
23#include <vtkInformation.h>
24#include <vtkPolyDataAlgorithm.h>
25#include <vtkWeakPointer.h>
26
27class vtkDoubleArray;
28class vtkOBBTree;
29class vtkPointLocator;
30class vtkPoints;
31class vtkPolyData;
32
35
46class VTK_MRML_EXPORT vtkProjectMarkupsCurvePointsFilter : public vtkPolyDataAlgorithm
47{
48public:
49 vtkTypeMacro(vtkProjectMarkupsCurvePointsFilter, vtkPolyDataAlgorithm);
51
65
74 using vtkPolyDataAlgorithm::SetInputConnection;
75 using vtkPolyDataAlgorithm::SetInputData;
77
89 static bool ConstrainPointsToSurface(vtkPoints* originalPoints,
90 vtkDoubleArray* normalVectors,
91 vtkPolyData* surfacePolydata,
92 vtkPoints* surfacePoints,
93 double maximumSearchRadiusTolerance);
94
102 void SetMaximumSearchRadiusTolerance(double maximumSearchRadiusTolerance);
105
106protected:
107 int FillInputPortInformation(int port, vtkInformation* info) override;
108 int RequestData(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) override;
109
111
112private:
113 vtkWeakPointer<vtkMRMLMarkupsCurveNode> InputCurveNode;
114 double MaximumSearchRadiusTolerance;
115
116 bool ProjectPointsToSurface(vtkMRMLModelNode* modelNode, double maximumSearchRadiusTolerance, vtkPoints* interpolatedPoints, vtkPoints* outputPoints);
117 static bool ConstrainPointsToSurfaceImpl(vtkOBBTree* surfaceObbTree,
118 vtkPointLocator* pointLocator,
119 vtkPoints* originalPoints,
120 vtkDoubleArray* normalVectors,
121 vtkPolyData* surfacePolydata,
122 vtkPoints* surfacePoints,
123 double maximumSearchRadius = .25);
124
125 class PointProjectionHelper
126 {
127 public:
128 PointProjectionHelper();
129 void SetModel(vtkMRMLModelNode* model);
132 vtkSmartPointer<vtkDoubleArray> GetPointNormals(vtkPoints* points, vtkPoints* controlPoints);
133 vtkPointLocator* GetPointLocator();
134 vtkOBBTree* GetObbTree();
135 vtkPolyData* GetSurfacePolyData();
136
137 private:
138 vtkMRMLModelNode* Model;
139 vtkMTimeType LastModelModifiedTime;
140 vtkMTimeType LastTransformModifiedTime;
141 vtkSmartPointer<vtkDataArray> ModelNormalVectorArray;
142 vtkSmartPointer<vtkPointLocator> ModelPointLocator;
143 vtkSmartPointer<vtkOBBTree> ModelObbTree;
144 vtkSmartPointer<vtkPolyData> SurfacePolyData;
145
146 bool UpdateAll();
147 static vtkIdType GetClosestControlPointIndex(const double point[3], vtkPoints* controlPoints);
148 };
149
150 PointProjectionHelper PointProjection;
151};
152
153#endif
MRML node to represent a curve markup Curve Markups nodes contain N control points....
MRML node to represent a 3D surface model.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
double GetMaximumSearchRadiusTolerance() const
static vtkProjectMarkupsCurvePointsFilter * New()
void SetMaximumSearchRadiusTolerance(double maximumSearchRadiusTolerance)
void SetInputCurveNode(vtkMRMLMarkupsCurveNode *inputCurveNode)
int FillInputPortInformation(int port, vtkInformation *info) override
static bool ConstrainPointsToSurface(vtkPoints *originalPoints, vtkDoubleArray *normalVectors, vtkPolyData *surfacePolydata, vtkPoints *surfacePoints, double maximumSearchRadiusTolerance)