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

Extract a set of vessel (cross) sections n-spheres away (upstream and downstream) from a bifurctation. More...

#include <vtkvmtkPolyDataBifurcationSections.h>

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

Public Types

typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkPolyDataBifurcationSections * 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 SetBifurcationSectionPointArrayName (const char *)
virtual char * GetBifurcationSectionPointArrayName ()
virtual void SetBifurcationSectionNormalArrayName (const char *)
virtual char * GetBifurcationSectionNormalArrayName ()
virtual void SetBifurcationSectionAreaArrayName (const char *)
virtual char * GetBifurcationSectionAreaArrayName ()
virtual void SetBifurcationSectionMinSizeArrayName (const char *)
virtual char * GetBifurcationSectionMinSizeArrayName ()
virtual void SetBifurcationSectionMaxSizeArrayName (const char *)
virtual char * GetBifurcationSectionMaxSizeArrayName ()
virtual void SetBifurcationSectionShapeArrayName (const char *)
virtual char * GetBifurcationSectionShapeArrayName ()
virtual void SetBifurcationSectionGroupIdsArrayName (const char *)
virtual char * GetBifurcationSectionGroupIdsArrayName ()
virtual void SetBifurcationSectionBifurcationGroupIdsArrayName (const char *)
virtual char * GetBifurcationSectionBifurcationGroupIdsArrayName ()
virtual void SetBifurcationSectionOrientationArrayName (const char *)
virtual char * GetBifurcationSectionOrientationArrayName ()
virtual void SetBifurcationSectionDistanceSpheresArrayName (const char *)
virtual char * GetBifurcationSectionDistanceSpheresArrayName ()
virtual void SetBifurcationSectionClosedArrayName (const char *)
virtual char * GetBifurcationSectionClosedArrayName ()
virtual void SetNumberOfDistanceSpheres (int)
virtual int GetNumberOfDistanceSpheres ()

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkPolyDataBifurcationSections ()
 ~vtkvmtkPolyDataBifurcationSections ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void ComputeBifurcationSections (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 * BifurcationSectionGroupIdsArrayName
char * BifurcationSectionBifurcationGroupIdsArrayName
char * BifurcationSectionOrientationArrayName
char * BifurcationSectionDistanceSpheresArrayName
char * BifurcationSectionPointArrayName
char * BifurcationSectionNormalArrayName
char * BifurcationSectionAreaArrayName
char * BifurcationSectionMinSizeArrayName
char * BifurcationSectionMaxSizeArrayName
char * BifurcationSectionShapeArrayName
char * BifurcationSectionClosedArrayName
int NumberOfDistanceSpheres

Detailed Description

Extract a set of vessel (cross) sections n-spheres away (upstream and downstream) from a bifurctation.

Takes as input a surface and centerlines that have both already been split into branches. This is the filter behind the vmtkbifurcationsections pype script.

See also
vtkvmtkPolyDataBranchSections, vtkvmtkPolyDataBifurcationProfiles

The set of vessel sections contain the profile as well as the the following information about the section:

  • Bifurcation Section Group Ids
  • Bifurcation Section Bifurcation Group Ids
  • Bifurcation Section Orientation
  • Bifurcation Section Distance Spheres
  • Bifurcation Section Point
  • Bifurcation Section Normal
  • Bifurcation Section Area
  • Bifurcation Section Min Size
  • Bifurcation Section Max Size
  • Bifurcation Section Shape
  • Bifurcation Section Closed

Definition at line 50 of file vtkvmtkPolyDataBifurcationSections.h.

Member Typedef Documentation

◆ Superclass

typedef vtkPolyDataAlgorithm vtkvmtkPolyDataBifurcationSections::Superclass

Definition at line 53 of file vtkvmtkPolyDataBifurcationSections.h.

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataBifurcationSections()

vtkvmtkPolyDataBifurcationSections::vtkvmtkPolyDataBifurcationSections ( )
protected

Definition at line 43 of file vtkvmtkPolyDataBifurcationSections.cxx.

44{
45 this->GroupIdsArrayName = NULL;
46
47 this->Centerlines = NULL;
48
49 this->CenterlineRadiusArrayName = NULL;
50 this->CenterlineGroupIdsArrayName = NULL;
51 this->CenterlineIdsArrayName = NULL;
52 this->CenterlineTractIdsArrayName = NULL;
53 this->BlankingArrayName = NULL;
54
66
68}

◆ ~vtkvmtkPolyDataBifurcationSections()

vtkvmtkPolyDataBifurcationSections::~vtkvmtkPolyDataBifurcationSections ( )
protected

Definition at line 70 of file vtkvmtkPolyDataBifurcationSections.cxx.

71{
72 if (this->GroupIdsArrayName)
73 {
74 delete[] this->GroupIdsArrayName;
75 this->GroupIdsArrayName = NULL;
76 }
77
78 if (this->Centerlines)
79 {
80 this->Centerlines->Delete();
81 this->Centerlines = NULL;
82 }
83
85 {
86 delete[] this->CenterlineRadiusArrayName;
87 this->CenterlineRadiusArrayName = NULL;
88 }
89
91 {
92 delete[] this->CenterlineGroupIdsArrayName;
93 this->CenterlineGroupIdsArrayName = NULL;
94 }
95
96 if (this->CenterlineIdsArrayName)
97 {
98 delete[] this->CenterlineIdsArrayName;
99 this->CenterlineIdsArrayName = NULL;
100 }
101
103 {
104 delete[] this->CenterlineTractIdsArrayName;
105 this->CenterlineTractIdsArrayName = NULL;
106 }
107
108 if (this->BlankingArrayName)
109 {
110 delete[] this->BlankingArrayName;
111 this->BlankingArrayName = NULL;
112 }
113
115 {
118 }
119
121 {
124 }
125
127 {
130 }
131
133 {
136 }
137
139 {
140 delete[] this->BifurcationSectionAreaArrayName;
142 }
143
145 {
148 }
149
151 {
154 }
155
157 {
160 }
161
163 {
166 }
167
169 {
172 }
173
175 {
178 }
179}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataBifurcationSections::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkPolyDataBifurcationSections * vtkvmtkPolyDataBifurcationSections::NewInstance ( ) const

◆ PrintSelf()

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

Definition at line 634 of file vtkvmtkPolyDataBifurcationSections.cxx.

635{
636 this->Superclass::PrintSelf(os,indent);
637}

◆ New()

vtkvmtkPolyDataBifurcationSections * vtkvmtkPolyDataBifurcationSections::New ( )
static

◆ SetGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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 vtkvmtkPolyDataBifurcationSections::SetCenterlines ( vtkPolyData * )
virtual

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

◆ GetCenterlines()

virtual vtkPolyData * vtkvmtkPolyDataBifurcationSections::GetCenterlines ( )
virtual

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

◆ SetCenterlineRadiusArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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 vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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 vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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 vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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 vtkvmtkPolyDataBifurcationSections::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 * vtkvmtkPolyDataBifurcationSections::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".

◆ SetBifurcationSectionPointArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionPointArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the (x,y,z) point at which each section was cut is stored. Commonly named "BifurcationSectionPoint".

◆ GetBifurcationSectionPointArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionPointArrayName ( )
virtual

Set/Get the name of the output cell data array where the (x,y,z) point at which each section was cut is stored. Commonly named "BifurcationSectionPoint".

◆ SetBifurcationSectionNormalArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionNormalArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the cutting plane normal of each section is stored. Commonly named "BifurcationSectionNormal".

◆ GetBifurcationSectionNormalArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionNormalArrayName ( )
virtual

Set/Get the name of the output cell data array where the cutting plane normal of each section is stored. Commonly named "BifurcationSectionNormal".

◆ SetBifurcationSectionAreaArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionAreaArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the cross-sectional area of each section is stored. Commonly named "BifurcationSectionArea".

◆ GetBifurcationSectionAreaArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionAreaArrayName ( )
virtual

Set/Get the name of the output cell data array where the cross-sectional area of each section is stored. Commonly named "BifurcationSectionArea".

◆ SetBifurcationSectionMinSizeArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionMinSizeArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the minimum diameter of each section is stored. Commonly named "BifurcationSectionMinSize".

◆ GetBifurcationSectionMinSizeArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionMinSizeArrayName ( )
virtual

Set/Get the name of the output cell data array where the minimum diameter of each section is stored. Commonly named "BifurcationSectionMinSize".

◆ SetBifurcationSectionMaxSizeArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionMaxSizeArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the maximum diameter of each section is stored. Commonly named "BifurcationSectionMaxSize".

◆ GetBifurcationSectionMaxSizeArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionMaxSizeArrayName ( )
virtual

Set/Get the name of the output cell data array where the maximum diameter of each section is stored. Commonly named "BifurcationSectionMaxSize".

◆ SetBifurcationSectionShapeArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionShapeArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the shape index of each section (the ratio between its minimum and maximum diameter) is stored. Commonly named "BifurcationSectionShape".

◆ GetBifurcationSectionShapeArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionShapeArrayName ( )
virtual

Set/Get the name of the output cell data array where the shape index of each section (the ratio between its minimum and maximum diameter) is stored. Commonly named "BifurcationSectionShape".

◆ SetBifurcationSectionGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionGroupIdsArrayName ( const char * )
virtual

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

◆ GetBifurcationSectionGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionGroupIdsArrayName ( )
virtual

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

◆ SetBifurcationSectionBifurcationGroupIdsArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionBifurcationGroupIdsArrayName ( const char * )
virtual

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

◆ GetBifurcationSectionBifurcationGroupIdsArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionBifurcationGroupIdsArrayName ( )
virtual

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

◆ SetBifurcationSectionOrientationArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionOrientationArrayName ( const char * )
virtual

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

◆ GetBifurcationSectionOrientationArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionOrientationArrayName ( )
virtual

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

◆ SetBifurcationSectionDistanceSpheresArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionDistanceSpheresArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where the number of touching spheres (see NumberOfDistanceSpheres) each section was cut at is stored. Commonly named "BifurcationSectionDistanceSpheres".

◆ GetBifurcationSectionDistanceSpheresArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionDistanceSpheresArrayName ( )
virtual

Set/Get the name of the output cell data array where the number of touching spheres (see NumberOfDistanceSpheres) each section was cut at is stored. Commonly named "BifurcationSectionDistanceSpheres".

◆ SetBifurcationSectionClosedArrayName()

virtual void vtkvmtkPolyDataBifurcationSections::SetBifurcationSectionClosedArrayName ( const char * )
virtual

Set/Get the name of the output cell data array where, for each section, whether the cutting plane fully closes off the vessel lumen (1) or not (0, e.g. it also intersects a nearby bifurcation or free end) is stored. Commonly named "BifurcationSectionClosed".

◆ GetBifurcationSectionClosedArrayName()

virtual char * vtkvmtkPolyDataBifurcationSections::GetBifurcationSectionClosedArrayName ( )
virtual

Set/Get the name of the output cell data array where, for each section, whether the cutting plane fully closes off the vessel lumen (1) or not (0, e.g. it also intersects a nearby bifurcation or free end) is stored. Commonly named "BifurcationSectionClosed".

◆ SetNumberOfDistanceSpheres()

virtual void vtkvmtkPolyDataBifurcationSections::SetNumberOfDistanceSpheres ( int )
virtual

Set/Get the distance from each bifurcation at which sections are cut, expressed in number of touching inscribed spheres (each sphere touching the center of the previous one). Default: 1.

◆ GetNumberOfDistanceSpheres()

virtual int vtkvmtkPolyDataBifurcationSections::GetNumberOfDistanceSpheres ( )
virtual

Set/Get the distance from each bifurcation at which sections are cut, expressed in number of touching inscribed spheres (each sphere touching the center of the previous one). Default: 1.

◆ RequestData()

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

Definition at line 181 of file vtkvmtkPolyDataBifurcationSections.cxx.

185{
186 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
187 vtkInformation *outInfo = outputVector->GetInformationObject(0);
188
189 vtkPolyData *input = vtkPolyData::SafeDownCast(
190 inInfo->Get(vtkDataObject::DATA_OBJECT()));
191 vtkPolyData *output = vtkPolyData::SafeDownCast(
192 outInfo->Get(vtkDataObject::DATA_OBJECT()));
193
194 if (!this->GroupIdsArrayName)
195 {
196 vtkErrorMacro(<<"GroupIdsArrayName not specified");
197 return 1;
198 }
199
200 vtkDataArray* groupIdsArray = input->GetPointData()->GetArray(this->GroupIdsArrayName);
201
202 if (!groupIdsArray)
203 {
204 vtkErrorMacro(<<"GroupIdsArray with name specified does not exist");
205 return 1;
206 }
207
208 if (!this->Centerlines)
209 {
210 vtkErrorMacro(<<"Centerlines not set");
211 return 1;
212 }
213
214 if (!this->CenterlineRadiusArrayName)
215 {
216 vtkErrorMacro(<<"CenterlineRadiusArrayName not specified");
217 return 1;
218 }
219
220 vtkDataArray* centerlineRadiusArray = this->Centerlines->GetPointData()->GetArray(this->CenterlineRadiusArrayName);
221
222 if (!centerlineRadiusArray)
223 {
224 vtkErrorMacro(<<"CenterlineRadiusArray with name specified does not exist");
225 return 1;
226 }
227
229 {
230 vtkErrorMacro(<<"CenterlineGroupIdsArrayName not specified");
231 return 1;
232 }
233
234 vtkDataArray* centerlineGroupIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineGroupIdsArrayName);
235
236 if (!centerlineGroupIdsArray)
237 {
238 vtkErrorMacro(<<"CenterlineGroupIdsArray with name specified does not exist");
239 return 1;
240 }
241
242 if (!this->CenterlineIdsArrayName)
243 {
244 vtkErrorMacro(<<"CenterlineIdsArrayName not specified");
245 return 1;
246 }
247
248 vtkDataArray* centerlineIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineIdsArrayName);
249
250 if (!centerlineIdsArray)
251 {
252 vtkErrorMacro(<<"CenterlineIdsArray with name specified does not exist");
253 return 1;
254 }
255
257 {
258 vtkErrorMacro(<<"CenterlineTractIdsArrayName not specified");
259 return 1;
260 }
261
262 vtkDataArray* centerlineTractIdsArray = this->Centerlines->GetCellData()->GetArray(this->CenterlineTractIdsArrayName);
263
264 if (!centerlineTractIdsArray)
265 {
266 vtkErrorMacro(<<"CenterlineTractIdsArray with name specified does not exist");
267 return 1;
268 }
269
270 if (!this->BlankingArrayName)
271 {
272 vtkErrorMacro(<<"BlankingArrayName not specified");
273 return 1;
274 }
275
276 vtkDataArray* blankingArray = this->Centerlines->GetCellData()->GetArray(this->BlankingArrayName);
277
278 if (!blankingArray)
279 {
280 vtkErrorMacro(<<"BlankingArray with name specified does not exist");
281 return 1;
282 }
283
285 {
286 vtkErrorMacro(<<"BifurcationSectionGroupIdsArrayName not specified");
287 return 1;
288 }
289
291 {
292 vtkErrorMacro(<<"BifurcationSectionBifurcationGroupIdsArrayName not specified");
293 return 1;
294 }
295
297 {
298 vtkErrorMacro(<<"BifurcationSectionPointArrayName not specified");
299 return 1;
300 }
301
303 {
304 vtkErrorMacro(<<"BifurcationSectionNormalArrayName not specified");
305 return 1;
306 }
307
309 {
310 vtkErrorMacro(<<"BifurcationSectionAreaArrayName not specified");
311 return 1;
312 }
313
315 {
316 vtkErrorMacro(<<"BifurcationSectionMinSizeArrayName not specified");
317 return 1;
318 }
319
321 {
322 vtkErrorMacro(<<"BifurcationSectionMaxSizeArrayName not specified");
323 return 1;
324 }
325
327 {
328 vtkErrorMacro(<<"BifurcationSectionShapeArrayName not specified");
329 return 1;
330 }
331
333 {
334 vtkErrorMacro(<<"BifurcationSectionClosedArrayName not specified");
335 return 1;
336 }
337
339 {
340 vtkErrorMacro(<<"BifurcationSectionOrientationArrayName not specified");
341 return 1;
342 }
343
345 {
346 vtkErrorMacro(<<"BifurcationSectionDistanceSpheresArrayName not specified");
347 return 1;
348 }
349
350 vtkIntArray* bifurcationSectionGroupIdsArray = vtkIntArray::New();
351 bifurcationSectionGroupIdsArray->SetName(this->BifurcationSectionGroupIdsArrayName);
352
353 vtkIntArray* bifurcationSectionBifurcationGroupIdsArray = vtkIntArray::New();
354 bifurcationSectionBifurcationGroupIdsArray->SetName(this->BifurcationSectionBifurcationGroupIdsArrayName);
355
356 vtkDoubleArray* bifurcationSectionPointArray = vtkDoubleArray::New();
357 bifurcationSectionPointArray->SetName(this->BifurcationSectionPointArrayName);
358 bifurcationSectionPointArray->SetNumberOfComponents(3);
359
360 vtkDoubleArray* bifurcationSectionNormalArray = vtkDoubleArray::New();
361 bifurcationSectionNormalArray->SetName(this->BifurcationSectionNormalArrayName);
362 bifurcationSectionNormalArray->SetNumberOfComponents(3);
363
364 vtkDoubleArray* bifurcationSectionAreaArray = vtkDoubleArray::New();
365 bifurcationSectionAreaArray->SetName(this->BifurcationSectionAreaArrayName);
366
367 vtkDoubleArray* bifurcationSectionShapeArray = vtkDoubleArray::New();
368 bifurcationSectionShapeArray->SetName(this->BifurcationSectionShapeArrayName);
369
370 vtkDoubleArray* bifurcationSectionMinSizeArray = vtkDoubleArray::New();
371 bifurcationSectionMinSizeArray->SetName(this->BifurcationSectionMinSizeArrayName);
372
373 vtkDoubleArray* bifurcationSectionMaxSizeArray = vtkDoubleArray::New();
374 bifurcationSectionMaxSizeArray->SetName(this->BifurcationSectionMaxSizeArrayName);
375
376 vtkIntArray* bifurcationSectionClosedArray = vtkIntArray::New();
377 bifurcationSectionClosedArray->SetName(this->BifurcationSectionClosedArrayName);
378
379 vtkIntArray* bifurcationSectionOrientationArray = vtkIntArray::New();
380 bifurcationSectionOrientationArray->SetName(this->BifurcationSectionOrientationArrayName);
381
382 vtkIntArray* bifurcationSectionDistanceSpheresArray = vtkIntArray::New();
383 bifurcationSectionDistanceSpheresArray->SetName(this->BifurcationSectionDistanceSpheresArrayName);
384
385 output->GetCellData()->AddArray(bifurcationSectionGroupIdsArray);
386 output->GetCellData()->AddArray(bifurcationSectionBifurcationGroupIdsArray);
387 output->GetCellData()->AddArray(bifurcationSectionPointArray);
388 output->GetCellData()->AddArray(bifurcationSectionNormalArray);
389 output->GetCellData()->AddArray(bifurcationSectionAreaArray);
390 output->GetCellData()->AddArray(bifurcationSectionMinSizeArray);
391 output->GetCellData()->AddArray(bifurcationSectionMaxSizeArray);
392 output->GetCellData()->AddArray(bifurcationSectionShapeArray);
393 output->GetCellData()->AddArray(bifurcationSectionClosedArray);
394 output->GetCellData()->AddArray(bifurcationSectionOrientationArray);
395 output->GetCellData()->AddArray(bifurcationSectionDistanceSpheresArray);
396
397 vtkPoints* outputPoints = vtkPoints::New();
398 vtkCellArray* outputPolys = vtkCellArray::New();
399
400 output->SetPoints(outputPoints);
401 output->SetPolys(outputPolys);
402
403 vtkIdList* blankedGroupIds = vtkIdList::New();
405 int i;
406 for (i=0; i<blankedGroupIds->GetNumberOfIds(); i++)
407 {
408 vtkIdType bifurcationGroupId = blankedGroupIds->GetId(i);
409
410 //compute quantities and insert proper values in arrays
411 vtkIdList* upStreamGroupIds = vtkIdList::New();
412 vtkIdList* downStreamGroupIds = vtkIdList::New();
413
415
416 this->ComputeBifurcationSections(input,bifurcationGroupId,upStreamGroupIds,downStreamGroupIds,output);
417
418 upStreamGroupIds->Delete();
419 downStreamGroupIds->Delete();
420 }
421
422 blankedGroupIds->Delete();
423
424 outputPoints->Delete();
425 outputPolys->Delete();
426
427 bifurcationSectionGroupIdsArray->Delete();
428 bifurcationSectionBifurcationGroupIdsArray->Delete();
429 bifurcationSectionPointArray->Delete();
430 bifurcationSectionNormalArray->Delete();
431 bifurcationSectionAreaArray->Delete();
432 bifurcationSectionShapeArray->Delete();
433 bifurcationSectionMinSizeArray->Delete();
434 bifurcationSectionMaxSizeArray->Delete();
435 bifurcationSectionClosedArray->Delete();
436 bifurcationSectionOrientationArray->Delete();
437 bifurcationSectionDistanceSpheresArray->Delete();
438
439 return 1;
440}
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 ComputeBifurcationSections(vtkPolyData *input, int bifurcationGroupId, vtkIdList *upStreamGroupIds, vtkIdList *downStreamGroupIds, vtkPolyData *output)

◆ ComputeBifurcationSections()

void vtkvmtkPolyDataBifurcationSections::ComputeBifurcationSections ( vtkPolyData * input,
int bifurcationGroupId,
vtkIdList * upStreamGroupIds,
vtkIdList * downStreamGroupIds,
vtkPolyData * output )
protected

Definition at line 442 of file vtkvmtkPolyDataBifurcationSections.cxx.

443{
444 vtkDataArray* radiusArray = this->Centerlines->GetPointData()->GetArray(this->CenterlineRadiusArrayName);
445 vtkPoints* outputPoints = output->GetPoints();
446 vtkCellArray* outputPolys = output->GetPolys();
447 vtkDoubleArray* bifurcationSectionPointArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionPointArrayName));
448 vtkDoubleArray* bifurcationSectionNormalArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionNormalArrayName));
449 vtkDoubleArray* bifurcationSectionAreaArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionAreaArrayName));
450 vtkDoubleArray* bifurcationSectionMinSizeArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionMinSizeArrayName));
451 vtkDoubleArray* bifurcationSectionMaxSizeArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionMaxSizeArrayName));
452 vtkDoubleArray* bifurcationSectionShapeArray = vtkDoubleArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionShapeArrayName));
453 vtkIntArray* bifurcationSectionClosedArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionClosedArrayName));
454 vtkIntArray* bifurcationSectionOrientationArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionOrientationArrayName));
455 vtkIntArray* bifurcationSectionDistanceSpheresArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionDistanceSpheresArrayName));
456 vtkIntArray* bifurcationSectionGroupIdsArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionGroupIdsArrayName));
457 vtkIntArray* bifurcationSectionBifurcationGroupIdsArray = vtkIntArray::SafeDownCast(output->GetCellData()->GetArray(this->BifurcationSectionBifurcationGroupIdsArrayName));
458
459 vtkIdList* bifurcationSectionGroupIds = vtkIdList::New();
460 vtkIntArray* bifurcationSectionOrientations = vtkIntArray::New();
461
462 int numberOfUpStreamGroupIds = upStreamGroupIds->GetNumberOfIds();
463 int numberOfDownStreamGroupIds = downStreamGroupIds->GetNumberOfIds();
464 int i;
465 for (i=0; i<numberOfUpStreamGroupIds; i++)
466 {
467 bifurcationSectionGroupIds->InsertNextId(upStreamGroupIds->GetId(i));
468 bifurcationSectionOrientations->InsertNextValue(vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_UPSTREAM_ORIENTATION);
469 }
470 for (i=0; i<numberOfDownStreamGroupIds; i++)
471 {
472 bifurcationSectionGroupIds->InsertNextId(downStreamGroupIds->GetId(i));
473 bifurcationSectionOrientations->InsertNextValue(vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_DOWNSTREAM_ORIENTATION);
474 }
475
476 int numberOfBifurcationSections = bifurcationSectionGroupIds->GetNumberOfIds();
477
478 for (i=0; i<numberOfBifurcationSections; i++)
479 {
480 int bifurcationSectionGroupId = bifurcationSectionGroupIds->GetId(i);
481 int bifurcationSectionOrientation = bifurcationSectionOrientations->GetValue(i);
482
483 double averagePoint[3];
484 averagePoint[0] = averagePoint[1] = averagePoint[2] = 0.0;
485
486 double averageTangent[3];
487 averageTangent[0] = averageTangent[1] = averageTangent[2] = 0.0;
488
489 double weightSum = 0.0;
490
491 int j;
492 bool anyPoint = false;
493 vtkIdList* groupCellIds = vtkIdList::New();
494 vtkvmtkCenterlineUtilities::GetGroupUniqueCellIds(this->Centerlines,this->CenterlineGroupIdsArrayName,bifurcationSectionGroupId,groupCellIds);
495 for (j=0; j<groupCellIds->GetNumberOfIds(); j++)
496 {
497 vtkIdType cellId = groupCellIds->GetId(j);
498 vtkCell* cell = this->Centerlines->GetCell(cellId);
499 int numberOfCellPoints = cell->GetNumberOfPoints();
500
501 vtkIdType touchingSubId = -1;
502 double touchingPCoord = 0.0;
503
504 vtkIdType pointSubId = -1;
505 double pointPCoord = 0.0;
506 bool forward = true;
507
508 double lastPoint[3];
509 double lastPointRadius = 0.0;
510
512 {
513 pointSubId = numberOfCellPoints-2;
514 pointPCoord = 1.0;
515 forward = true;
516 cell->GetPoints()->GetPoint(numberOfCellPoints-1,lastPoint);
517 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(numberOfCellPoints-1),0);
518 }
519 else if (bifurcationSectionOrientation == vtkvmtkCenterlineBifurcationVectors::VTK_VMTK_DOWNSTREAM_ORIENTATION)
520 {
521 pointSubId = 0;
522 pointPCoord = 0.0;
523 forward = false;
524 cell->GetPoints()->GetPoint(0,lastPoint);
525 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(0),0);
526 }
527 else
528 {
529 vtkErrorMacro("Error: invalid BifurcationVectorOrientation");
530 return;
531 }
532
533 vtkvmtkCenterlineSphereDistance::FindNTouchingSphereCenter(this->Centerlines,this->CenterlineRadiusArrayName,cellId,pointSubId,pointPCoord,this->NumberOfDistanceSpheres,touchingSubId,touchingPCoord,forward);
534
535 if (touchingSubId == -1)
536 {
537 continue;
538 }
539
540 anyPoint = true;
541 double touchingPoint[3];
542 vtkvmtkCenterlineUtilities::InterpolatePoint(this->Centerlines,cellId,touchingSubId,touchingPCoord,touchingPoint);
543
544 double touchingPoint0[3], touchingPoint1[3];
545 this->Centerlines->GetCell(cellId)->GetPoints()->GetPoint(touchingSubId,touchingPoint0);
546 this->Centerlines->GetCell(cellId)->GetPoints()->GetPoint(touchingSubId+1,touchingPoint1);
547
548 double touchingPointTangent[3];
549 touchingPointTangent[0] = touchingPoint1[0] - touchingPoint0[0];
550 touchingPointTangent[1] = touchingPoint1[1] - touchingPoint0[1];
551 touchingPointTangent[2] = touchingPoint1[2] - touchingPoint0[2];
552
553 vtkMath::Normalize(touchingPointTangent);
554 double touchingPointRadius = 0.0;
555 vtkvmtkCenterlineUtilities::InterpolateTuple1(this->Centerlines,this->CenterlineRadiusArrayName,cellId,touchingSubId,touchingPCoord,touchingPointRadius);
556
557 averagePoint[0] += touchingPointRadius * touchingPointRadius * touchingPoint[0];
558 averagePoint[1] += touchingPointRadius * touchingPointRadius * touchingPoint[1];
559 averagePoint[2] += touchingPointRadius * touchingPointRadius * touchingPoint[2];
560
561 averageTangent[0] += touchingPointRadius * touchingPointRadius * touchingPointTangent[0];
562 averageTangent[1] += touchingPointRadius * touchingPointRadius * touchingPointTangent[1];
563 averageTangent[2] += touchingPointRadius * touchingPointRadius * touchingPointTangent[2];
564
565 weightSum += touchingPointRadius * touchingPointRadius;
566 }
567
568 if (!anyPoint)
569 {
570 continue;
571 }
572
573 averagePoint[0] /= weightSum;
574 averagePoint[1] /= weightSum;
575 averagePoint[2] /= weightSum;
576
577 averageTangent[0] /= weightSum;
578 averageTangent[1] /= weightSum;
579 averageTangent[2] /= weightSum;
580
581 vtkMath::Normalize(averageTangent);
582
583 //now cut branch with plane and get section. Compute section properties and store them.
584
585 vtkPolyData* cylinder = vtkPolyData::New();
586 vtkvmtkPolyDataBranchUtilities::ExtractGroup(input,this->GroupIdsArrayName,bifurcationSectionGroupId,false,cylinder);
587
588 vtkPolyData* section = vtkPolyData::New();
589 bool closed = false;
590 vtkvmtkPolyDataBranchSections::ExtractCylinderSection(cylinder,averagePoint,averageTangent,section,closed);
591
592 section->BuildCells();
593 if (section->GetNumberOfCells() == 0)
594 {
595 cylinder->Delete();
596 section->Delete();
597 continue;
598 }
599 vtkPoints* sectionCellPoints = section->GetCell(0)->GetPoints();
600 int numberOfSectionCellPoints = sectionCellPoints->GetNumberOfPoints();
601 outputPolys->InsertNextCell(numberOfSectionCellPoints);
602 for (j=0; j<numberOfSectionCellPoints; j++)
603 {
604 vtkIdType pointId = outputPoints->InsertNextPoint(sectionCellPoints->GetPoint(j));
605 outputPolys->InsertCellPoint(pointId);
606 }
607
609 double sizeRange[2];
610 double shape = vtkvmtkPolyDataBranchSections::ComputeBranchSectionShape(section,averagePoint,sizeRange);
611 int closedValue = closed ? 1 : 0;
612
613 bifurcationSectionGroupIdsArray->InsertNextValue(bifurcationSectionGroupId);
614 bifurcationSectionBifurcationGroupIdsArray->InsertNextValue(bifurcationGroupId);
615 bifurcationSectionPointArray->InsertNextTuple(averagePoint);
616 bifurcationSectionNormalArray->InsertNextTuple(averageTangent);
617 bifurcationSectionAreaArray->InsertNextValue(area);
618 bifurcationSectionMinSizeArray->InsertNextValue(sizeRange[0]);
619 bifurcationSectionMaxSizeArray->InsertNextValue(sizeRange[1]);
620 bifurcationSectionShapeArray->InsertNextValue(shape);
621 bifurcationSectionClosedArray->InsertNextValue(closedValue);
622 bifurcationSectionOrientationArray->InsertNextValue(bifurcationSectionOrientation);
623 bifurcationSectionDistanceSpheresArray->InsertNextValue(this->NumberOfDistanceSpheres);
624
625 groupCellIds->Delete();
626 cylinder->Delete();
627 section->Delete();
628 }
629
630 bifurcationSectionGroupIds->Delete();
631 bifurcationSectionOrientations->Delete();
632}
static void FindNTouchingSphereCenter(vtkPolyData *centerlines, const char *radiusArrayName, vtkIdType cellId, vtkIdType subId, double pcoord, int numberOfTouchingSpheres, vtkIdType &touchingSubId, double &touchingPCoord, bool forward=true)
static void InterpolatePoint(vtkPolyData *centerlines, int cellId, int subId, double pcoord, double interpolatedPoint[3])
static void GetGroupUniqueCellIds(vtkPolyData *centerlines, const char *groupIdsArrayName, vtkIdType groupId, vtkIdList *groupCellIds)
static void InterpolateTuple1(vtkPolyData *centerlines, const char *arrayName, int cellId, int subId, double pcoord, double &interpolatedTuple1)
static double ComputeBranchSectionArea(vtkPolyData *branchSection)
static void ExtractCylinderSection(vtkPolyData *cylinder, double origin[3], double normal[3], vtkPolyData *section, bool &closed, const char *idsArrayName=nullptr)
static double ComputeBranchSectionShape(vtkPolyData *branchSection, double center[3], double sizeRange[2])
static void ExtractGroup(vtkPolyData *surface, const char *groupIdsArrayName, vtkIdType groupId, bool cleanGroupSurface, vtkPolyData *groupSurface)

Member Data Documentation

◆ Centerlines

vtkPolyData* vtkvmtkPolyDataBifurcationSections::Centerlines
protected

Definition at line 252 of file vtkvmtkPolyDataBifurcationSections.h.

◆ GroupIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::GroupIdsArrayName
protected

Definition at line 254 of file vtkvmtkPolyDataBifurcationSections.h.

◆ CenterlineRadiusArrayName

char* vtkvmtkPolyDataBifurcationSections::CenterlineRadiusArrayName
protected

Definition at line 255 of file vtkvmtkPolyDataBifurcationSections.h.

◆ CenterlineGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::CenterlineGroupIdsArrayName
protected

Definition at line 256 of file vtkvmtkPolyDataBifurcationSections.h.

◆ CenterlineIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::CenterlineIdsArrayName
protected

Definition at line 257 of file vtkvmtkPolyDataBifurcationSections.h.

◆ CenterlineTractIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::CenterlineTractIdsArrayName
protected

Definition at line 258 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BlankingArrayName

char* vtkvmtkPolyDataBifurcationSections::BlankingArrayName
protected

Definition at line 259 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionGroupIdsArrayName
protected

Definition at line 261 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionBifurcationGroupIdsArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionBifurcationGroupIdsArrayName
protected

Definition at line 262 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionOrientationArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionOrientationArrayName
protected

Definition at line 263 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionDistanceSpheresArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionDistanceSpheresArrayName
protected

Definition at line 264 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionPointArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionPointArrayName
protected

Definition at line 265 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionNormalArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionNormalArrayName
protected

Definition at line 266 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionAreaArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionAreaArrayName
protected

Definition at line 267 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionMinSizeArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionMinSizeArrayName
protected

Definition at line 268 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionMaxSizeArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionMaxSizeArrayName
protected

Definition at line 269 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionShapeArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionShapeArrayName
protected

Definition at line 270 of file vtkvmtkPolyDataBifurcationSections.h.

◆ BifurcationSectionClosedArrayName

char* vtkvmtkPolyDataBifurcationSections::BifurcationSectionClosedArrayName
protected

Definition at line 271 of file vtkvmtkPolyDataBifurcationSections.h.

◆ NumberOfDistanceSpheres

int vtkvmtkPolyDataBifurcationSections::NumberOfDistanceSpheres
protected

Definition at line 273 of file vtkvmtkPolyDataBifurcationSections.h.


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