VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataNetworkExtraction.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16=========================================================================*/
32
33#ifndef __vtkvmtkPolyDataNetworkExtraction_h
34#define __vtkvmtkPolyDataNetworkExtraction_h
35
36#include "vtkPolyDataAlgorithm.h"
37#include "vtkvmtkWin32Header.h"
38
39class vtkPolyData;
40class vtkPolyDataCollection;
41class vtkIdTypeArray;
42class vtkCollection;
43class vtkPoints;
44
45class VTK_VMTK_MISC_EXPORT vtkvmtkPolyDataNetworkExtraction : public vtkPolyDataAlgorithm
46{
47 public:
48 vtkTypeMacro(vtkvmtkPolyDataNetworkExtraction,vtkPolyDataAlgorithm);
49 void PrintSelf(std::ostream& os, vtkIndent indent) override;
50
52
54
58 vtkSetStringMacro(MarksArrayName);
59 vtkGetStringMacro(MarksArrayName);
61
63
67 vtkSetStringMacro(RadiusArrayName);
68 vtkGetStringMacro(RadiusArrayName);
70
72
76 vtkSetStringMacro(TopologyArrayName);
77 vtkGetStringMacro(TopologyArrayName);
79
81
87 vtkSetMacro(AdvancementRatio,double);
88 vtkGetMacro(AdvancementRatio,double);
90
95 vtkGetMacro(TotalMarkedPoints,int);
96
101 vtkGetMacro(MinimumStep,double);
102
108 vtkGetObjectMacro(GraphLayout,vtkPolyData);
109
110//BTX
116 enum
117 {
123 };
124//ETX
125
126//BTX
131 enum
132 {
136 };
137//ETX
138
139protected:
142
143 void BoundaryExtractor (vtkPolyData* polyInput, vtkPolyData* boundary);
144 void BoundarySeparator(vtkPolyData* appendedBoundaries, vtkPolyDataCollection* boundaries);
145 void InsertInEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType pointId0, vtkIdType pointId1);
146 bool InsertUniqueInEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType pointId0, vtkIdType pointId1);
147 void GetFromEdgeTable(vtkIdTypeArray* edgeTable, vtkIdType position, vtkIdType edge[2]);
148 void UpdateEdgeTableCollectionReal(vtkPolyData* model,vtkPolyDataCollection* profiles,vtkCollection* edgeTables);
149 double Distance(double point1[3], double point2[3]);
150 double GetFurthestDistance (vtkPolyDataCollection* polyDataCollection, double fromPoint[3]);
151 void Barycenter (vtkPoints* points, double barycenter[3]);
152 void ProfileBarycenter (vtkPoints* points, double barycenter[3]);
153 void DefineVirtualSphere(vtkPolyDataCollection* baseProfiles, double center[3], double &radius, double ratio);
154 vtkIdType CurrentPointId(vtkPolyData* model,vtkIdType currentEdge[2]);
155 void InsertEdgeForNewProfiles(vtkPolyData* model, vtkIdType* edge, vtkIdTypeArray* edgeTable, vtkIdTypeArray* cellPairs, vtkIdList* pointIds);
156 bool LookForNeighbors(vtkPolyData* model, vtkIdType pointId, vtkIdList* notVisitedIds, vtkIdTypeArray* edgeTableForIncludedGlobalProfiles);
157 void PropagateFromBaseProfilePoint(vtkPolyData* model, vtkIdList* toVisitPointIds, double center[3], double radius, vtkIdTypeArray* edgeTableForNewProfiles, vtkIdTypeArray* cellPairsForNewProfiles, vtkIdList* pointIdsForNewProfiles, vtkPoints* markedPoints, vtkIdList* markedPointIds, vtkIdTypeArray* edgeTableForIncludedGlobalProfiles);
158 void LocateVirtualPoint(vtkIdType edge[2], double center[3], double radius, vtkIdList* pointIdsForNewProfiles, vtkPoints* pointsForNewProfiles, vtkDoubleArray* pointDistancesForNewProfiles, double virtualPoint[3]);
159 void ReconstructNewProfiles(vtkPoints* virtualPoints, vtkIdTypeArray* edgeTable, vtkIdTypeArray* cellPairs, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables);
160 void GenerateNewProfiles(vtkPolyData* model, double center[3], double radius, vtkIdTypeArray* edgeTableForNewProfiles, vtkIdTypeArray* cellPairsForNewProfiles, vtkIdList* pointIdsForNewProfiles, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables);
161 void UnmarkPoints(vtkPolyData* model, vtkIdList* markedPointIds);
162 double ComputeStepRadius(vtkPoints* points, double point1[3], double point2[3]);
163 double ComputeMeanRadius(vtkPoints* points, double point1[3]);
164 void PointsForRadius(vtkPoints *markedPoints, vtkPolyDataCollection *baseProfiles, vtkPolyDataCollection *newProfiles, vtkPoints *pointsForRadius);
165 void LookForIntersectingPoint(vtkPoints* segmentPoints, double center[3], double radius, vtkIdType &intersectingPointId);
166 vtkIdType StepIteration(vtkPolyData* model, vtkPolyDataCollection* baseProfiles, vtkCollection* baseProfilesEdgeTables, vtkPolyDataCollection* globalProfiles, vtkCollection* globalProfilesEdgeTables, vtkPolyDataCollection* newProfiles, vtkCollection* newProfilesEdgeTables, vtkPoints* segmentPoints, vtkDoubleArray* segmentRadii, vtkPoints* bifurcationPoints, vtkDoubleArray* bifurcationRadii, double oldCenter[3], double &oldRadius, double advancementRatio);
167 void MarkModelGlobalProfile(vtkPolyData* model, vtkIdTypeArray* newGlobalProfileEdgeTable);
168 void SegmentTopology(vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, double firstSegmentPoint[3], double lastSegmentPoint[3], double firstPoint[3], double &firstRadius, double lastPoint[3], double &lastRadius, vtkIdType segmentTopology[2]);
169 void BuildSegment(vtkPoints* segmentPoints, vtkDoubleArray* segmentRadii, vtkIdType segmentTopology[2], double firstPoint[3], double firstRadius, double lastPoint[3], double lastRadius, const double* centralPoint, vtkPolyData* segment);
170 void InsertNewBifurcation(vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, vtkPoints* bifurcationPoints, vtkDoubleArray* bifurcationRadii, vtkPolyDataCollection* additionalSegments);
171 void SegmentIteration(vtkPolyData* model, vtkPolyData* initialProfile, vtkIdTypeArray* initialProfileEdgeTable, vtkPolyDataCollection* globalProfiles, vtkCollection* globalProfilesEdgeTables, vtkCollection* bifurcations, vtkCollection* bifurcationsRadii, vtkPolyDataCollection* segments, double advancementRatio);
172 void JoinSegments (vtkPolyData* segment0, vtkPolyData* segment1, bool first0, bool first1, vtkPolyData* segment);
173 void RemoveDegenerateBifurcations(vtkPolyDataCollection* segments,vtkCollection* bifurcations);
174 void GlobalIteration(vtkPolyData* model, vtkPolyDataCollection* globalProfiles, vtkPolyData* network, double advancementRatio);
175 void MarkModelRealBoundary(vtkPolyData* model, vtkPolyData* modelBoundary);
176 void Graph(vtkPolyData* network, vtkPolyData* graphLayout);
177
178 virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
179
180 vtkPolyData* GraphLayout;
181
185
187
189
191
192 private:
194 void operator=(const vtkvmtkPolyDataNetworkExtraction&); // Not implemented.
195};
196
197#endif
Create an approximated network graph (preliminary to centerline) from an input surface with at least ...
static vtkvmtkPolyDataNetworkExtraction * New()
void PrintSelf(std::ostream &os, vtkIndent indent) override