VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyDataBifurcationProfiles Class Reference

Compute bifurcation profiles (the bifurcation splitting lines) from an input surface and grouped and split centerlines. More...

#include <vtkvmtkPolyDataBifurcationProfiles.h>

Inheritance diagram for vtkvmtkPolyDataBifurcationProfiles:
[legend]
Collaboration diagram for vtkvmtkPolyDataBifurcationProfiles:
[legend]

Public Types

typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkPolyDataBifurcationProfiles * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
virtual void SetGroupIdsArrayName (const char *)
virtual char * GetGroupIdsArrayName ()
virtual void SetCenterlines (vtkPolyData *)
virtual vtkPolyData * GetCenterlines ()
virtual void SetCenterlineRadiusArrayName (const char *)
virtual char * GetCenterlineRadiusArrayName ()
virtual void SetCenterlineGroupIdsArrayName (const char *)
virtual char * GetCenterlineGroupIdsArrayName ()
virtual void SetCenterlineIdsArrayName (const char *)
virtual char * GetCenterlineIdsArrayName ()
virtual void SetCenterlineTractIdsArrayName (const char *)
virtual char * GetCenterlineTractIdsArrayName ()
virtual void SetBlankingArrayName (const char *)
virtual char * GetBlankingArrayName ()
virtual void SetBifurcationProfileGroupIdsArrayName (const char *)
virtual char * GetBifurcationProfileGroupIdsArrayName ()
virtual void SetBifurcationProfileBifurcationGroupIdsArrayName (const char *)
virtual char * GetBifurcationProfileBifurcationGroupIdsArrayName ()
virtual void SetBifurcationProfileOrientationArrayName (const char *)
virtual char * GetBifurcationProfileOrientationArrayName ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkPolyDataBifurcationProfiles * SafeDownCast (vtkObjectBase *o)
static vtkvmtkPolyDataBifurcationProfiles * New ()

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkPolyDataBifurcationProfiles ()
 ~vtkvmtkPolyDataBifurcationProfiles ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void ComputeBifurcationProfiles (vtkPolyData *input, int bifurcationGroupId, vtkIdList *upStreamGroupIds, vtkIdList *downStreamGroupIds, vtkPolyData *output)

Protected Attributes

vtkPolyData * Centerlines
char * GroupIdsArrayName
char * CenterlineRadiusArrayName
char * CenterlineGroupIdsArrayName
char * CenterlineIdsArrayName
char * CenterlineTractIdsArrayName
char * BlankingArrayName
char * BifurcationProfileGroupIdsArrayName
char * BifurcationProfileBifurcationGroupIdsArrayName
char * BifurcationProfileOrientationArrayName

Detailed Description

Compute bifurcation profiles (the bifurcation splitting lines) from an input surface and grouped and split centerlines.

Used to extract the bifurcation group, the orientation, and label the group as either coming from an upstream source or leading to a downstream centerline branch.

Takes as input a surface and centerlines that have both already been split into branches (see vtkvmtkCenterlineSplittingAndGroupingFilter, vtkvmtkPolyDataCenterlineGroupsClipper). This is the filter behind the vmtkbifurcationprofiles pype script.

See also
vtkvmtkPolyDataBifurcationSections, vtkvmtkCenterlineSplittingAndGroupingFilter

Definition at line 40 of file vtkvmtkPolyDataBifurcationProfiles.h.

Member Typedef Documentation

◆ Superclass

typedef vtkPolyDataAlgorithm vtkvmtkPolyDataBifurcationProfiles::Superclass

Definition at line 43 of file vtkvmtkPolyDataBifurcationProfiles.h.

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataBifurcationProfiles()

vtkvmtkPolyDataBifurcationProfiles::vtkvmtkPolyDataBifurcationProfiles ( )
protected

Definition at line 46 of file vtkvmtkPolyDataBifurcationProfiles.cxx.

47{
48 this->GroupIdsArrayName = NULL;
49
50 this->Centerlines = NULL;
51
52 this->CenterlineRadiusArrayName = NULL;
53 this->CenterlineGroupIdsArrayName = NULL;
54 this->CenterlineIdsArrayName = NULL;
55 this->CenterlineTractIdsArrayName = NULL;
56 this->BlankingArrayName = NULL;
57
61}

◆ ~vtkvmtkPolyDataBifurcationProfiles()

vtkvmtkPolyDataBifurcationProfiles::~vtkvmtkPolyDataBifurcationProfiles ( )
protected

Definition at line 63 of file vtkvmtkPolyDataBifurcationProfiles.cxx.

64{
65 if (this->GroupIdsArrayName)
66 {
67 delete[] this->GroupIdsArrayName;
68 this->GroupIdsArrayName = NULL;
69 }
70
71 if (this->Centerlines)
72 {
73 this->Centerlines->Delete();
74 this->Centerlines = NULL;
75 }
76
78 {
79 delete[] this->CenterlineRadiusArrayName;
80 this->CenterlineRadiusArrayName = NULL;
81 }
82
84 {
85 delete[] this->CenterlineGroupIdsArrayName;
86 this->CenterlineGroupIdsArrayName = NULL;
87 }
88
89 if (this->CenterlineIdsArrayName)
90 {
91 delete[] this->CenterlineIdsArrayName;
92 this->CenterlineIdsArrayName = NULL;
93 }
94
96 {
97 delete[] this->CenterlineTractIdsArrayName;
98 this->CenterlineTractIdsArrayName = NULL;
99 }
100
101 if (this->BlankingArrayName)
102 {
103 delete[] this->BlankingArrayName;
104 this->BlankingArrayName = NULL;
105 }
106
108 {
111 }
112
114 {
117 }
118
120 {
123 }
124}

Member Function Documentation

◆ IsTypeOf()

int vtkvmtkPolyDataBifurcationProfiles::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkPolyDataBifurcationProfiles::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkPolyDataBifurcationProfiles * vtkvmtkPolyDataBifurcationProfiles::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataBifurcationProfiles::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkPolyDataBifurcationProfiles * vtkvmtkPolyDataBifurcationProfiles::NewInstance ( ) const

◆ PrintSelf()

void vtkvmtkPolyDataBifurcationProfiles::PrintSelf ( std::ostream & os,
vtkIndent indent )
override

Definition at line 420 of file vtkvmtkPolyDataBifurcationProfiles.cxx.

421{
422 this->Superclass::PrintSelf(os,indent);
423}

◆ New()

vtkvmtkPolyDataBifurcationProfiles * vtkvmtkPolyDataBifurcationProfiles::New ( )
static

◆ SetGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of the input surface holding the branch group id of each cell. Required input. Commonly named "GroupIds".

◆ GetGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetGroupIdsArrayName ( )
virtual

Set/Get the name of the cell data array of the input surface holding the branch group id of each cell. Required input. Commonly named "GroupIds".

◆ SetCenterlines()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetCenterlines ( vtkPolyData * )
virtual

Set/Get the split, grouped centerlines corresponding to the input surface. Required input.

◆ GetCenterlines()

virtual vtkPolyData * vtkvmtkPolyDataBifurcationProfiles::GetCenterlines ( )
virtual

Set/Get the split, grouped centerlines corresponding to the input surface. Required input.

◆ SetCenterlineRadiusArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetCenterlineRadiusArrayName ( const char * )
virtual

Set/Get the name of the point data array of Centerlines holding the maximum inscribed sphere radius at each point. Commonly named "MaximumInscribedSphereRadius".

◆ GetCenterlineRadiusArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetCenterlineRadiusArrayName ( )
virtual

Set/Get the name of the point data array of Centerlines holding the maximum inscribed sphere radius at each point. Commonly named "MaximumInscribedSphereRadius".

◆ SetCenterlineGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetCenterlineGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the branch group id of each cell. Commonly named "GroupIds".

◆ GetCenterlineGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetCenterlineGroupIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the branch group id of each cell. Commonly named "GroupIds".

◆ SetCenterlineIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetCenterlineIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the id of the original, unsplit centerline that each cell belongs to. Commonly named "CenterlineIds".

◆ GetCenterlineIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetCenterlineIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the id of the original, unsplit centerline that each cell belongs to. Commonly named "CenterlineIds".

◆ SetCenterlineTractIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetCenterlineTractIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding the tract id of each cell. Commonly named "TractIds".

◆ GetCenterlineTractIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetCenterlineTractIdsArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding the tract id of each cell. Commonly named "TractIds".

◆ SetBlankingArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetBlankingArrayName ( const char * )
virtual

Set/Get the name of the cell data array of Centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract. Commonly named "Blanking".

◆ GetBlankingArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetBlankingArrayName ( )
virtual

Set/Get the name of the cell data array of Centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract. Commonly named "Blanking".

◆ SetBifurcationProfileGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetBifurcationProfileGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the group id that each bifurcation profile belongs to is stored. Commonly named "BifurcationProfileGroupIds".

◆ GetBifurcationProfileGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetBifurcationProfileGroupIdsArrayName ( )
virtual

Set/Get the name of the output cell data array where the group id that each bifurcation profile belongs to is stored. Commonly named "BifurcationProfileGroupIds".

◆ SetBifurcationProfileBifurcationGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetBifurcationProfileBifurcationGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the group id of the bifurcation that each profile belongs to is stored. Commonly named "BifurcationProfileBifurcationGroupIds".

◆ GetBifurcationProfileBifurcationGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetBifurcationProfileBifurcationGroupIdsArrayName ( )
virtual

Set/Get the name of the output cell data array where the group id of the bifurcation that each profile belongs to is stored. Commonly named "BifurcationProfileBifurcationGroupIds".

◆ SetBifurcationProfileOrientationArrayName()

virtual void vtkvmtkPolyDataBifurcationProfiles::SetBifurcationProfileOrientationArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the orientation of each profile is stored: 0 if the profile lies upstream of its bifurcation, 1 if downstream. Commonly named "BifurcationProfileOrientation".

◆ GetBifurcationProfileOrientationArrayName()

virtual char * vtkvmtkPolyDataBifurcationProfiles::GetBifurcationProfileOrientationArrayName ( )
virtual

Set/Get the name of the output cell data array where the orientation of each profile is stored: 0 if the profile lies upstream of its bifurcation, 1 if downstream. Commonly named "BifurcationProfileOrientation".

◆ RequestData()

int vtkvmtkPolyDataBifurcationProfiles::RequestData ( vtkInformation * ,
vtkInformationVector ** ,
vtkInformationVector *  )
overrideprotectedvirtual

Definition at line 126 of file vtkvmtkPolyDataBifurcationProfiles.cxx.

130{
131 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
132 vtkInformation *outInfo = outputVector->GetInformationObject(0);
133
134 vtkPolyData *input = vtkPolyData::SafeDownCast(
135 inInfo->Get(vtkDataObject::DATA_OBJECT()));
136 vtkPolyData *output = vtkPolyData::SafeDownCast(
137 outInfo->Get(vtkDataObject::DATA_OBJECT()));
138
139 if (!this->GroupIdsArrayName)
140 {
141 vtkErrorMacro(<<"GroupIdsArrayName not specified");
142 return 1;
143 }
144
145 vtkDataArray* groupIdsArray = input->GetPointData()->GetArray(this->GroupIdsArrayName);
146
147 if (!groupIdsArray)
148 {
149 vtkErrorMacro(<<"GroupIdsArray with name specified does not exist");
150 return 1;
151 }
152
153 if (!this->Centerlines)
154 {
155 vtkErrorMacro(<<"Centerlines not set");
156 return 1;
157 }
158
159 if (!this->CenterlineRadiusArrayName)
160 {
161 vtkErrorMacro(<<"CenterlineRadiusArrayName not specified");
162 return 1;
163 }
164
165 vtkDataArray* centerlineRadiusArray = this->Centerlines->GetPointData()->GetArray(this->CenterlineRadiusArrayName);
166
167 if (!centerlineRadiusArray)
168 {
169 vtkErrorMacro(<<"CenterlineRadiusArray with name specified does not exist");
170 return 1;
171 }
172
174 {
175 vtkErrorMacro(<<"CenterlineGroupIdsArrayName not specified");
176 return 1;
177 }
178
179 vtkDataArray* centerlineGroupIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineGroupIdsArrayName);
180
181 if (!centerlineGroupIdsArray)
182 {
183 vtkErrorMacro(<<"CenterlineGroupIdsArray with name specified does not exist");
184 return 1;
185 }
186
187 if (!this->CenterlineIdsArrayName)
188 {
189 vtkErrorMacro(<<"CenterlineIdsArrayName not specified");
190 return 1;
191 }
192
193 vtkDataArray* centerlineIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineIdsArrayName);
194
195 if (!centerlineIdsArray)
196 {
197 vtkErrorMacro(<<"CenterlineIdsArray with name specified does not exist");
198 return 1;
199 }
200
202 {
203 vtkErrorMacro(<<"CenterlineTractIdsArrayName not specified");
204 return 1;
205 }
206
207 vtkDataArray* centerlineTractIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineTractIdsArrayName);
208
209 if (!centerlineTractIdsArray)
210 {
211 vtkErrorMacro(<<"CenterlineTractIdsArray with name specified does not exist");
212 return 1;
213 }
214
215 if (!this->BlankingArrayName)
216 {
217 vtkErrorMacro(<<"BlankingArrayName not specified");
218 return 1;
219 }
220
221 vtkDataArray* blankingArray = this->Centerlines->GetCellData()->GetArray(this->BlankingArrayName);
222
223 if (!blankingArray)
224 {
225 vtkErrorMacro(<<"BlankingArray with name specified does not exist");
226 return 1;
227 }
228
230 {
231 vtkErrorMacro(<<"BifurcationProfileGroupIdsArrayName not specified");
232 return 1;
233 }
234
236 {
237 vtkErrorMacro(<<"BifurcationProfileBifurcationGroupIdsArrayName not specified");
238 return 1;
239 }
240
242 {
243 vtkErrorMacro(<<"BifurcationProfileOrientationArrayName not specified");
244 return 1;
245 }
246
247 vtkIntArray* bifurcationProfileGroupIdsArray = vtkIntArray::New();
248 bifurcationProfileGroupIdsArray->SetName(this->BifurcationProfileGroupIdsArrayName);
249
250 vtkIntArray* bifurcationProfileBifurcationGroupIdsArray = vtkIntArray::New();
251 bifurcationProfileBifurcationGroupIdsArray->SetName(this->BifurcationProfileBifurcationGroupIdsArrayName);
252
253 vtkIntArray* bifurcationProfileOrientationArray = vtkIntArray::New();
254 bifurcationProfileOrientationArray->SetName(this->BifurcationProfileOrientationArrayName);
255
256 output->GetCellData()->AddArray(bifurcationProfileGroupIdsArray);
257 output->GetCellData()->AddArray(bifurcationProfileBifurcationGroupIdsArray);
258 output->GetCellData()->AddArray(bifurcationProfileOrientationArray);
259
260 vtkPoints* outputPoints = vtkPoints::New();
261 vtkCellArray* outputLines = vtkCellArray::New();
262
263 output->SetPoints(outputPoints);
264 output->SetLines(outputLines);
265
266 vtkIdList* blankedGroupIds = vtkIdList::New();
268 int i;
269 for (i=0; i<blankedGroupIds->GetNumberOfIds(); i++)
270 {
271 vtkIdType bifurcationGroupId = blankedGroupIds->GetId(i);
272
273 //compute quantities and insert proper values in arrays
274 vtkIdList* upStreamGroupIds = vtkIdList::New();
275 vtkIdList* downStreamGroupIds = vtkIdList::New();
276
278
279 this->ComputeBifurcationProfiles(input,bifurcationGroupId,upStreamGroupIds,downStreamGroupIds,output);
280
281 upStreamGroupIds->Delete();
282 downStreamGroupIds->Delete();
283 }
284
285 blankedGroupIds->Delete();
286
287 outputPoints->Delete();
288 outputLines->Delete();
289
290 bifurcationProfileGroupIdsArray->Delete();
291 bifurcationProfileBifurcationGroupIdsArray->Delete();
292 bifurcationProfileOrientationArray->Delete();
293
294 return 1;
295}
static void GetBlankedGroupsIdList(vtkPolyData *centerlines, const char *groupIdsArrayName, const char *blankingArrayName, vtkIdList *groupIds)
static void FindAdjacentCenterlineGroupIds(vtkPolyData *centerlines, const char *groupIdsArrayName, const char *centerlineIdsArrayName, const char *tractIdsArrayName, vtkIdType groupId, vtkIdList *upStreamGroupIds, vtkIdList *downStreamGroupIds)
void ComputeBifurcationProfiles(vtkPolyData *input, int bifurcationGroupId, vtkIdList *upStreamGroupIds, vtkIdList *downStreamGroupIds, vtkPolyData *output)

◆ ComputeBifurcationProfiles()

void vtkvmtkPolyDataBifurcationProfiles::ComputeBifurcationProfiles ( vtkPolyData * input,
int bifurcationGroupId,
vtkIdList * upStreamGroupIds,
vtkIdList * downStreamGroupIds,
vtkPolyData * output )
protected

Definition at line 297 of file vtkvmtkPolyDataBifurcationProfiles.cxx.

298{
299 vtkDataArray* radiusArray = this->Centerlines->GetPointData()->GetArray(this->CenterlineRadiusArrayName);
300 vtkPoints* outputPoints = output->GetPoints();
301 vtkCellArray* outputLines = output->GetLines();
302 vtkIntArray* bifurcationProfileOrientationArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationProfileOrientationArrayName));
303 vtkIntArray* bifurcationProfileGroupIdsArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationProfileGroupIdsArrayName));
304 vtkIntArray* bifurcationProfileBifurcationGroupIdsArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationProfileBifurcationGroupIdsArrayName));
305
306 vtkIdList* bifurcationProfileGroupIds = vtkIdList::New();
307 vtkIntArray* bifurcationProfileOrientations = vtkIntArray::New();
308
309 int numberOfUpStreamGroupIds = upStreamGroupIds->GetNumberOfIds();
310 int numberOfDownStreamGroupIds = downStreamGroupIds->GetNumberOfIds();
311 int i;
312 for (i=0; i<numberOfUpStreamGroupIds; i++)
313 {
314 bifurcationProfileGroupIds->InsertNextId(upStreamGroupIds->GetId(i));
315 bifurcationProfileOrientations->InsertNextValue(vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_UPSTREAM_ORIENTATION);
316 }
317 for (i=0; i<numberOfDownStreamGroupIds; i++)
318 {
319 bifurcationProfileGroupIds->InsertNextId(downStreamGroupIds->GetId(i));
320 bifurcationProfileOrientations->InsertNextValue(vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_DOWNSTREAM_ORIENTATION);
321 }
322
323 int numberOfBifurcationProfiles = bifurcationProfileGroupIds->GetNumberOfIds();
324
325 for (i=0; i<numberOfBifurcationProfiles; i++)
326 {
327 int bifurcationProfileGroupId = bifurcationProfileGroupIds->GetId(i);
328 int bifurcationProfileOrientation = bifurcationProfileOrientations->GetValue(i);
329
330 double averagePoint[3];
331 averagePoint[0] = averagePoint[1] = averagePoint[2] = 0.0;
332
333 double weightSum = 0.0;
334
335 int j;
336 vtkIdList* groupCellIds = vtkIdList::New();
337 vtkvmtkCenterlineUtilities::GetGroupUniqueCellIds(this->Centerlines,this->CenterlineGroupIdsArrayName,bifurcationProfileGroupId,groupCellIds);
338 for (j=0; j<groupCellIds->GetNumberOfIds(); j++)
339 {
340 vtkIdType cellId = groupCellIds->GetId(j);
341 vtkCell* cell = this->Centerlines->GetCell(cellId);
342 int numberOfCellPoints = cell->GetNumberOfPoints();
343
344 double lastPoint[3];
345 double lastPointRadius = 0.0;
346
348 {
349 cell->GetPoints()->GetPoint(numberOfCellPoints-1,lastPoint);
350 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(numberOfCellPoints-1),0);
351 }
352 else if (bifurcationProfileOrientation == vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_DOWNSTREAM_ORIENTATION)
353 {
354 cell->GetPoints()->GetPoint(0,lastPoint);
355 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(0),0);
356 }
357 else
358 {
359 vtkErrorMacro("Error: invalid BifurcationVectorOrientation");
360 return;
361 }
362
363 averagePoint[0] += lastPointRadius * lastPointRadius * lastPoint[0];
364 averagePoint[1] += lastPointRadius * lastPointRadius * lastPoint[1];
365 averagePoint[2] += lastPointRadius * lastPointRadius * lastPoint[2];
366
367 weightSum += lastPointRadius * lastPointRadius;
368 }
369
370 averagePoint[0] /= weightSum;
371 averagePoint[1] /= weightSum;
372 averagePoint[2] /= weightSum;
373
374 vtkPolyData* cylinder = vtkPolyData::New();
375 vtkvmtkPolyDataBranchUtilities::ExtractGroup(input,this->GroupIdsArrayName,bifurcationProfileGroupId,false,cylinder);
376
377 vtkvmtkPolyDataBoundaryExtractor* boundaryExtractor = vtkvmtkPolyDataBoundaryExtractor::New();
378 boundaryExtractor->SetInputData(cylinder);
379 boundaryExtractor->Update();
380
381 vtkPolyData* profile = boundaryExtractor->GetOutput();
382
383 int numberOfCells = profile->GetNumberOfCells();
384 int closestCellId = -1;
385 double minDistance = VTK_VMTK_LARGE_DOUBLE;
386 for (j=0; j<numberOfCells; j++)
387 {
388 double barycenter[3];
389 vtkvmtkBoundaryReferenceSystems::ComputeBoundaryBarycenter(profile->GetCell(j)->GetPoints(),barycenter);
390 double barycenterDistance = vtkMath::Distance2BetweenPoints(barycenter,averagePoint);
391 if (barycenterDistance < minDistance)
392 {
393 closestCellId = j;
394 minDistance = barycenterDistance;
395 }
396 }
397
398 vtkPoints* profileCellPoints = profile->GetCell(closestCellId)->GetPoints();
399 int numberOfProfileCellPoints = profileCellPoints->GetNumberOfPoints();
400 outputLines->InsertNextCell(numberOfProfileCellPoints);
401 for (j=0; j<numberOfProfileCellPoints; j++)
402 {
403 vtkIdType pointId = outputPoints->InsertNextPoint(profileCellPoints->GetPoint(j));
404 outputLines->InsertCellPoint(pointId);
405 }
406
407 bifurcationProfileGroupIdsArray->InsertNextValue(bifurcationProfileGroupId);
408 bifurcationProfileBifurcationGroupIdsArray->InsertNextValue(bifurcationGroupId);
409 bifurcationProfileOrientationArray->InsertNextValue(bifurcationProfileOrientation);
410
411 groupCellIds->Delete();
412 cylinder->Delete();
413 boundaryExtractor->Delete();
414 }
415
416 bifurcationProfileGroupIds->Delete();
417 bifurcationProfileOrientations->Delete();
418}
static void ComputeBoundaryBarycenter(vtkPoints *points, double barycenter[3])
static void GetGroupUniqueCellIds(vtkPolyData *centerlines, const char *groupIdsArrayName, vtkIdType groupId, vtkIdList *groupCellIds)
static vtkvmtkPolyDataBoundaryExtractor * New()
static void ExtractGroup(vtkPolyData *surface, const char *groupIdsArrayName, vtkIdType groupId, bool cleanGroupSurface, vtkPolyData *groupSurface)
#define VTK_VMTK_LARGE_DOUBLE

Member Data Documentation

◆ Centerlines

vtkPolyData* vtkvmtkPolyDataBifurcationProfiles::Centerlines
protected

Definition at line 152 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ GroupIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::GroupIdsArrayName
protected

Definition at line 154 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ CenterlineRadiusArrayName

char* vtkvmtkPolyDataBifurcationProfiles::CenterlineRadiusArrayName
protected

Definition at line 155 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ CenterlineGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::CenterlineGroupIdsArrayName
protected

Definition at line 156 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ CenterlineIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::CenterlineIdsArrayName
protected

Definition at line 157 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ CenterlineTractIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::CenterlineTractIdsArrayName
protected

Definition at line 158 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ BlankingArrayName

char* vtkvmtkPolyDataBifurcationProfiles::BlankingArrayName
protected

Definition at line 159 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ BifurcationProfileGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::BifurcationProfileGroupIdsArrayName
protected

Definition at line 161 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ BifurcationProfileBifurcationGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationProfiles::BifurcationProfileBifurcationGroupIdsArrayName
protected

Definition at line 162 of file vtkvmtkPolyDataBifurcationProfiles.h.

◆ BifurcationProfileOrientationArrayName

char* vtkvmtkPolyDataBifurcationProfiles::BifurcationProfileOrientationArrayName
protected

Definition at line 163 of file vtkvmtkPolyDataBifurcationProfiles.h.


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