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

Compute vectors which represent the orientation of branches involved within a bifurcation from a split centerline and bifurcation reference system. More...

#include <vtkvmtkCenterlineBifurcationVectors.h>

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

Public Types

enum  { VTK_VMTK_UPSTREAM_ORIENTATION = 0 , VTK_VMTK_DOWNSTREAM_ORIENTATION }
typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkCenterlineBifurcationVectors * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
virtual void SetRadiusArrayName (const char *)
virtual char * GetRadiusArrayName ()
virtual void SetGroupIdsArrayName (const char *)
virtual char * GetGroupIdsArrayName ()
virtual void SetCenterlineIdsArrayName (const char *)
virtual char * GetCenterlineIdsArrayName ()
virtual void SetTractIdsArrayName (const char *)
virtual char * GetTractIdsArrayName ()
virtual void SetBlankingArrayName (const char *)
virtual char * GetBlankingArrayName ()
virtual void SetReferenceSystems (vtkPolyData *)
virtual vtkPolyData * GetReferenceSystems ()
virtual void SetReferenceSystemGroupIdsArrayName (const char *)
virtual char * GetReferenceSystemGroupIdsArrayName ()
virtual void SetReferenceSystemNormalArrayName (const char *)
virtual char * GetReferenceSystemNormalArrayName ()
virtual void SetReferenceSystemUpNormalArrayName (const char *)
virtual char * GetReferenceSystemUpNormalArrayName ()
virtual void SetBifurcationVectorsArrayName (const char *)
virtual char * GetBifurcationVectorsArrayName ()
virtual void SetInPlaneBifurcationVectorsArrayName (const char *)
virtual char * GetInPlaneBifurcationVectorsArrayName ()
virtual void SetOutOfPlaneBifurcationVectorsArrayName (const char *)
virtual char * GetOutOfPlaneBifurcationVectorsArrayName ()
virtual void SetInPlaneBifurcationVectorAnglesArrayName (const char *)
virtual char * GetInPlaneBifurcationVectorAnglesArrayName ()
virtual void SetOutOfPlaneBifurcationVectorAnglesArrayName (const char *)
virtual char * GetOutOfPlaneBifurcationVectorAnglesArrayName ()
virtual void SetBifurcationVectorsOrientationArrayName (const char *)
virtual char * GetBifurcationVectorsOrientationArrayName ()
virtual void SetBifurcationGroupIdsArrayName (const char *)
virtual char * GetBifurcationGroupIdsArrayName ()
virtual void SetNormalizeBifurcationVectors (int)
virtual int GetNormalizeBifurcationVectors ()
virtual void NormalizeBifurcationVectorsOn ()
virtual void NormalizeBifurcationVectorsOff ()

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkCenterlineBifurcationVectors ()
 ~vtkvmtkCenterlineBifurcationVectors ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void ComputeBifurcationVectors (vtkPolyData *input, int bifurcationGroupId, vtkIdList *bifurcationVectorsGroupIds, vtkIntArray *bifurcationVectorsOrientation, vtkDoubleArray *bifurcationVectors, vtkPoints *bifurcationVectorsPoints)
void ComputeBifurcationVectorComponents (int bifurcationGroupId, vtkDoubleArray *bifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectors, vtkDoubleArray *outOfPlaneBifurcationVectors)
void ComputeBifurcationVectorAngles (int bifurcationGroupId, vtkDoubleArray *bifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectors, vtkDoubleArray *outOfPlaneBifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectorAngles, vtkDoubleArray *outOfPlaneBifurcationVectorAngles)

Protected Attributes

char * RadiusArrayName
char * GroupIdsArrayName
char * CenterlineIdsArrayName
char * TractIdsArrayName
char * BlankingArrayName
vtkPolyData * ReferenceSystems
char * ReferenceSystemGroupIdsArrayName
char * ReferenceSystemNormalArrayName
char * ReferenceSystemUpNormalArrayName
char * BifurcationVectorsArrayName
char * InPlaneBifurcationVectorsArrayName
char * OutOfPlaneBifurcationVectorsArrayName
char * BifurcationVectorsOrientationArrayName
char * InPlaneBifurcationVectorAnglesArrayName
char * OutOfPlaneBifurcationVectorAnglesArrayName
char * BifurcationGroupIdsArrayName
int NormalizeBifurcationVectors

Detailed Description

Compute vectors which represent the orientation of branches involved within a bifurcation from a split centerline and bifurcation reference system.

For each branch of a bifurcation we compute bifurcation vectors, bifurcation vector components, and bifurcation vector angles. These represent both the in-plane and out-of-plane orientation of the bifurcation branches (which is why we need the bifurcation reference system). This allows us to later compute factors which characterize the bifurcation such as: relationship between the angle of upstream vs downstream vessels entering/leaving the bifurcation, how broad is the bifurcation, how tight is the bifurcation.

This class Computes vectors which are stored as results for the following data arrays:

  • BifurcationVectors
  • InPlaneBifurcationVectors
  • OutOfPlaneBifurcationVectors
  • InPlaneBifurcationVectorAngles (the angle between the InPlaneBifurcationVectors and the bifurcation UpNormal, in radians, from -pi to pi, zero for a UpNormal oriented vector, positive in the clockwise direction with respect to the bifurcation Normal)
  • OutOfPlaneBifurcationVectorAngles (the angle between the BifurcationVectors and the bifurcation plane, in radians, positive if the OutOfPLaneBifurcationVector is directed as the bifurcation Normal)
  • BifurcationVectorsOrientation (flag accounting for the role played by the branch in the bifurcation, 0 for upstream, 1 for downstream the bifurcation)
  • GroupIds (the groupId of the branch described by the vector)
  • BifurcationGroupIds (the groupId of the bifurcation)

Takes as input split, grouped centerlines and the corresponding bifurcation reference systems (see vtkvmtkCenterlineBifurcationReferenceSystems); this is the filter behind the vmtkbifurcationvectors pype script.

See also
vtkvmtkCenterlineBifurcationReferenceSystems, vtkvmtkCenterlineSplittingAndGroupingFilter

Definition at line 54 of file vtkvmtkCenterlineBifurcationVectors.h.

Member Typedef Documentation

◆ Superclass

Definition at line 57 of file vtkvmtkCenterlineBifurcationVectors.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Values stored in the BifurcationVectorsOrientationArrayName output array, flagging whether a branch is the parent (upstream) or a daughter (downstream) branch of its bifurcation.

Enumerator
VTK_VMTK_UPSTREAM_ORIENTATION 
VTK_VMTK_DOWNSTREAM_ORIENTATION 

Definition at line 240 of file vtkvmtkCenterlineBifurcationVectors.h.

Constructor & Destructor Documentation

◆ vtkvmtkCenterlineBifurcationVectors()

vtkvmtkCenterlineBifurcationVectors::vtkvmtkCenterlineBifurcationVectors ( )
protected

Definition at line 44 of file vtkvmtkCenterlineBifurcationVectors.cxx.

45{
46 this->RadiusArrayName = NULL;
47 this->GroupIdsArrayName = NULL;
48 this->CenterlineIdsArrayName = NULL;
49 this->TractIdsArrayName = NULL;
50 this->BlankingArrayName = NULL;
51
52 this->ReferenceSystems = NULL;
53
57
58 this->BifurcationVectorsArrayName = NULL;
63
66
67 this->NormalizeBifurcationVectors = false;
68}

◆ ~vtkvmtkCenterlineBifurcationVectors()

vtkvmtkCenterlineBifurcationVectors::~vtkvmtkCenterlineBifurcationVectors ( )
protected

Definition at line 70 of file vtkvmtkCenterlineBifurcationVectors.cxx.

71{
72 if (this->RadiusArrayName)
73 {
74 delete[] this->RadiusArrayName;
75 this->RadiusArrayName = NULL;
76 }
77
78 if (this->GroupIdsArrayName)
79 {
80 delete[] this->GroupIdsArrayName;
81 this->GroupIdsArrayName = NULL;
82 }
83
84 if (this->CenterlineIdsArrayName)
85 {
86 delete[] this->CenterlineIdsArrayName;
87 this->CenterlineIdsArrayName = NULL;
88 }
89
90 if (this->TractIdsArrayName)
91 {
92 delete[] this->TractIdsArrayName;
93 this->TractIdsArrayName = NULL;
94 }
95
96 if (this->BlankingArrayName)
97 {
98 delete[] this->BlankingArrayName;
99 this->BlankingArrayName = NULL;
100 }
101
102 if (this->ReferenceSystems)
103 {
104 this->ReferenceSystems->Delete();
105 }
106
108 {
111 }
112
114 {
115 delete[] this->ReferenceSystemNormalArrayName;
117 }
118
120 {
123 }
124
126 {
127 delete[] this->BifurcationVectorsArrayName;
128 this->BifurcationVectorsArrayName = NULL;
129 }
130
132 {
135 }
136
138 {
141 }
142
144 {
147 }
148
150 {
153 }
154
156 {
159 }
160
162 {
163 delete[] this->BifurcationGroupIdsArrayName;
164 this->BifurcationGroupIdsArrayName = NULL;
165 }
166}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkCenterlineBifurcationVectors::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkCenterlineBifurcationVectors * vtkvmtkCenterlineBifurcationVectors::NewInstance ( ) const

◆ PrintSelf()

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

Definition at line 687 of file vtkvmtkCenterlineBifurcationVectors.cxx.

688{
689 this->Superclass::PrintSelf(os,indent);
690}

◆ New()

vtkvmtkCenterlineBifurcationVectors * vtkvmtkCenterlineBifurcationVectors::New ( )
static

◆ SetRadiusArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetRadiusArrayName ( const char * )
virtual

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

◆ GetRadiusArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetRadiusArrayName ( )
virtual

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

◆ SetGroupIdsArrayName()

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

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

◆ GetGroupIdsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetGroupIdsArrayName ( )
virtual

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

◆ SetCenterlineIdsArrayName()

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

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

◆ GetCenterlineIdsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetCenterlineIdsArrayName ( )
virtual

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

◆ SetTractIdsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetTractIdsArrayName ( const char * )
virtual

Set/Get the name of the cell data array of the input centerlines holding the tract id (position of a cell along its original centerline) of each cell. Commonly named "TractIds".

◆ GetTractIdsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetTractIdsArrayName ( )
virtual

Set/Get the name of the cell data array of the input centerlines holding the tract id (position of a cell along its original centerline) of each cell. Commonly named "TractIds".

◆ SetBlankingArrayName()

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

Set/Get the name of the cell data array of the input centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract introduced by splitting – blanked cells are excluded when identifying the branches meeting at each bifurcation. Commonly named "Blanking".

◆ GetBlankingArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetBlankingArrayName ( )
virtual

Set/Get the name of the cell data array of the input centerlines holding, for each cell, whether it is a "blanked" (redundant, overlapping) tract introduced by splitting – blanked cells are excluded when identifying the branches meeting at each bifurcation. Commonly named "Blanking".

◆ SetReferenceSystems()

virtual void vtkvmtkCenterlineBifurcationVectors::SetReferenceSystems ( vtkPolyData * )
virtual

Set/Get the bifurcation reference systems (one vertex point per bifurcation, with normal/ upnormal point data arrays) computed by vtkvmtkCenterlineBifurcationReferenceSystems. Required input.

◆ GetReferenceSystems()

virtual vtkPolyData * vtkvmtkCenterlineBifurcationVectors::GetReferenceSystems ( )
virtual

Set/Get the bifurcation reference systems (one vertex point per bifurcation, with normal/ upnormal point data arrays) computed by vtkvmtkCenterlineBifurcationReferenceSystems. Required input.

◆ SetReferenceSystemGroupIdsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetReferenceSystemGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the group id that each reference system (bifurcation) refers to. Commonly named "GroupIds".

◆ GetReferenceSystemGroupIdsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetReferenceSystemGroupIdsArrayName ( )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the group id that each reference system (bifurcation) refers to. Commonly named "GroupIds".

◆ SetReferenceSystemNormalArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetReferenceSystemNormalArrayName ( const char * )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation plane normal vector. Commonly named "Normal".

◆ GetReferenceSystemNormalArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetReferenceSystemNormalArrayName ( )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation plane normal vector. Commonly named "Normal".

◆ SetReferenceSystemUpNormalArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetReferenceSystemUpNormalArrayName ( const char * )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation "upnormal" vector (perpendicular to the normal, pointing downstream from the parent branch). Commonly named "UpNormal".

◆ GetReferenceSystemUpNormalArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetReferenceSystemUpNormalArrayName ( )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation "upnormal" vector (perpendicular to the normal, pointing downstream from the parent branch). Commonly named "UpNormal".

◆ SetBifurcationVectorsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetBifurcationVectorsArrayName ( const char * )
virtual

Set/Get the name of the 3-component output point data array where the full bifurcation vector (from the bifurcation origin to the branch's reference point) is stored for each branch. Commonly named "BifurcationVectors".

◆ GetBifurcationVectorsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetBifurcationVectorsArrayName ( )
virtual

Set/Get the name of the 3-component output point data array where the full bifurcation vector (from the bifurcation origin to the branch's reference point) is stored for each branch. Commonly named "BifurcationVectors".

◆ SetInPlaneBifurcationVectorsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetInPlaneBifurcationVectorsArrayName ( const char * )
virtual

Set/Get the name of the 3-component output point data array where the in-plane component of each bifurcation vector (its projection onto the bifurcation plane) is stored. Commonly named "InPlaneBifurcationVectors".

◆ GetInPlaneBifurcationVectorsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetInPlaneBifurcationVectorsArrayName ( )
virtual

Set/Get the name of the 3-component output point data array where the in-plane component of each bifurcation vector (its projection onto the bifurcation plane) is stored. Commonly named "InPlaneBifurcationVectors".

◆ SetOutOfPlaneBifurcationVectorsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetOutOfPlaneBifurcationVectorsArrayName ( const char * )
virtual

Set/Get the name of the 3-component output point data array where the out-of-plane component of each bifurcation vector (its projection onto the bifurcation normal) is stored. Commonly named "OutOfPlaneBifurcationVectors".

◆ GetOutOfPlaneBifurcationVectorsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetOutOfPlaneBifurcationVectorsArrayName ( )
virtual

Set/Get the name of the 3-component output point data array where the out-of-plane component of each bifurcation vector (its projection onto the bifurcation normal) is stored. Commonly named "OutOfPlaneBifurcationVectors".

◆ SetInPlaneBifurcationVectorAnglesArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetInPlaneBifurcationVectorAnglesArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the angle (in radians, in [-pi,pi]) between each InPlaneBifurcationVectors entry and the bifurcation UpNormal is stored: zero for a vector aligned with UpNormal, positive in the clockwise direction with respect to the bifurcation Normal. Commonly named "InPlaneBifurcationVectorAngles".

◆ GetInPlaneBifurcationVectorAnglesArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetInPlaneBifurcationVectorAnglesArrayName ( )
virtual

Set/Get the name of the output point data array where the angle (in radians, in [-pi,pi]) between each InPlaneBifurcationVectors entry and the bifurcation UpNormal is stored: zero for a vector aligned with UpNormal, positive in the clockwise direction with respect to the bifurcation Normal. Commonly named "InPlaneBifurcationVectorAngles".

◆ SetOutOfPlaneBifurcationVectorAnglesArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetOutOfPlaneBifurcationVectorAnglesArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the angle (in radians) between each BifurcationVectors entry and the bifurcation plane is stored: positive if the out-of-plane component is directed as the bifurcation Normal. Commonly named "OutOfPlaneBifurcationVectorAngles".

◆ GetOutOfPlaneBifurcationVectorAnglesArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetOutOfPlaneBifurcationVectorAnglesArrayName ( )
virtual

Set/Get the name of the output point data array where the angle (in radians) between each BifurcationVectors entry and the bifurcation plane is stored: positive if the out-of-plane component is directed as the bifurcation Normal. Commonly named "OutOfPlaneBifurcationVectorAngles".

◆ SetBifurcationVectorsOrientationArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetBifurcationVectorsOrientationArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the role played by each branch in its bifurcation is stored: VTK_VMTK_UPSTREAM_ORIENTATION (0) for the parent branch, or VTK_VMTK_DOWNSTREAM_ORIENTATION (1) for a daughter branch. Commonly named "BifurcationVectorsOrientation".

◆ GetBifurcationVectorsOrientationArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetBifurcationVectorsOrientationArrayName ( )
virtual

Set/Get the name of the output point data array where the role played by each branch in its bifurcation is stored: VTK_VMTK_UPSTREAM_ORIENTATION (0) for the parent branch, or VTK_VMTK_DOWNSTREAM_ORIENTATION (1) for a daughter branch. Commonly named "BifurcationVectorsOrientation".

◆ SetBifurcationGroupIdsArrayName()

virtual void vtkvmtkCenterlineBifurcationVectors::SetBifurcationGroupIdsArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the group id of the bifurcation each vector belongs to is stored. Commonly named "BifurcationGroupIds".

◆ GetBifurcationGroupIdsArrayName()

virtual char * vtkvmtkCenterlineBifurcationVectors::GetBifurcationGroupIdsArrayName ( )
virtual

Set/Get the name of the output point data array where the group id of the bifurcation each vector belongs to is stored. Commonly named "BifurcationGroupIds".

◆ SetNormalizeBifurcationVectors()

virtual void vtkvmtkCenterlineBifurcationVectors::SetNormalizeBifurcationVectors ( int )
virtual

Toggle normalizing BifurcationVectors (and its in-plane/out-of-plane components) to unit length before computing angles and storing the output arrays. Default: off.

◆ GetNormalizeBifurcationVectors()

virtual int vtkvmtkCenterlineBifurcationVectors::GetNormalizeBifurcationVectors ( )
virtual

Toggle normalizing BifurcationVectors (and its in-plane/out-of-plane components) to unit length before computing angles and storing the output arrays. Default: off.

◆ NormalizeBifurcationVectorsOn()

virtual void vtkvmtkCenterlineBifurcationVectors::NormalizeBifurcationVectorsOn ( )
virtual

Toggle normalizing BifurcationVectors (and its in-plane/out-of-plane components) to unit length before computing angles and storing the output arrays. Default: off.

◆ NormalizeBifurcationVectorsOff()

virtual void vtkvmtkCenterlineBifurcationVectors::NormalizeBifurcationVectorsOff ( )
virtual

Toggle normalizing BifurcationVectors (and its in-plane/out-of-plane components) to unit length before computing angles and storing the output arrays. Default: off.

◆ RequestData()

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

Definition at line 168 of file vtkvmtkCenterlineBifurcationVectors.cxx.

172{
173 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
174 vtkInformation *outInfo = outputVector->GetInformationObject(0);
175
176 vtkPolyData *input = vtkPolyData::SafeDownCast(
177 inInfo->Get(vtkDataObject::DATA_OBJECT()));
178 vtkPolyData *output = vtkPolyData::SafeDownCast(
179 outInfo->Get(vtkDataObject::DATA_OBJECT()));
180
181 if (!this->RadiusArrayName)
182 {
183 vtkErrorMacro(<<"RadiusArrayName not specified");
184 return 1;
185 }
186
187 vtkDataArray* radiusArray = input->GetPointData()->GetArray(this->RadiusArrayName);
188
189 if (!radiusArray)
190 {
191 vtkErrorMacro(<<"RadiusArray with name specified does not exist");
192 return 1;
193 }
194
195 if (!this->GroupIdsArrayName)
196 {
197 vtkErrorMacro(<<"GroupIdsArrayName not specified");
198 return 1;
199 }
200
201 vtkDataArray* groupIdsArray = input->GetCellData()->GetArray(this->GroupIdsArrayName);
202
203 if (!groupIdsArray)
204 {
205 vtkErrorMacro(<<"GroupIdsArray with name specified does not exist");
206 return 1;
207 }
208
209 if (!this->CenterlineIdsArrayName)
210 {
211 vtkErrorMacro(<<"CenterlineIdsArrayName not specified");
212 return 1;
213 }
214
215 vtkDataArray* centerlineIdsArray = input->GetCellData()->GetArray(this->CenterlineIdsArrayName);
216
217 if (!centerlineIdsArray)
218 {
219 vtkErrorMacro(<<"CenterlineIdsArray with name specified does not exist");
220 return 1;
221 }
222
223 if (!this->TractIdsArrayName)
224 {
225 vtkErrorMacro(<<"TractIdsArrayName not specified");
226 return 1;
227 }
228
229 vtkDataArray* tractIdsArray = input->GetCellData()->GetArray(this->TractIdsArrayName);
230
231 if (!tractIdsArray)
232 {
233 vtkErrorMacro(<<"TractIdsArray with name specified does not exist");
234 return 1;
235 }
236
237 if (!this->BlankingArrayName)
238 {
239 vtkErrorMacro(<<"BlankingArrayName not specified");
240 return 1;
241 }
242
243 vtkDataArray* blankingArray = input->GetCellData()->GetArray(this->BlankingArrayName);
244
245 if (!blankingArray)
246 {
247 vtkErrorMacro(<<"BlankingArray with name specified does not exist");
248 return 1;
249 }
250
252 {
253 vtkErrorMacro(<<"ReferenceSystemGroupIdsArrayName not specified");
254 return 1;
255 }
256
257 vtkDataArray* referenceSystemGroupIdsArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemGroupIdsArrayName);
258
259 if (!referenceSystemGroupIdsArray)
260 {
261 vtkErrorMacro(<<"ReferenceSystemGroupIdsArray with name specified does not exist");
262 return 1;
263 }
264
266 {
267 vtkErrorMacro(<<"ReferenceSystemNormalArrayName not specified");
268 return 1;
269 }
270
271 vtkDataArray* referenceSystemNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemNormalArrayName);
272
273 if (!referenceSystemNormalArray)
274 {
275 vtkErrorMacro(<<"ReferenceSystemNormalArray with name specified does not exist");
276 return 1;
277 }
278
280 {
281 vtkErrorMacro(<<"ReferenceSystemUpNormalArrayName not specified");
282 return 1;
283 }
284
285 vtkDataArray* referenceSystemUpNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemUpNormalArrayName);
286
287 if (!referenceSystemUpNormalArray)
288 {
289 vtkErrorMacro(<<"ReferenceSystemUpNormalArray with name specified does not exist");
290 return 1;
291 }
292
294 {
295 vtkErrorMacro(<<"BifurcationVectorsArrayName not specified");
296 return 1;
297 }
298
300 {
301 vtkErrorMacro(<<"InPlaneBifurcationVectorsArrayName not specified");
302 return 1;
303 }
304
306 {
307 vtkErrorMacro(<<"OutOfPlaneBifurcationVectorsArrayName not specified");
308 return 1;
309 }
310
312 {
313 vtkErrorMacro(<<"BifurcationVectorsOrientationArrayName not specified");
314 return 1;
315 }
316
318 {
319 vtkErrorMacro(<<"BifurcationGroupIdsArrayName not specified");
320 return 1;
321 }
322
324 {
325 vtkErrorMacro(<<"InPlaneBifurcationVectorAnglesArrayName not specified");
326 return 1;
327 }
328
330 {
331 vtkErrorMacro(<<"OutOfPlaneBifurcationVectorAnglesArrayName not specified");
332 return 1;
333 }
334
335 vtkPoints* outputPoints = vtkPoints::New();
336 vtkCellArray* outputVerts = vtkCellArray::New();
337
338 output->SetPoints(outputPoints);
339 output->SetVerts(outputVerts);
340
341 vtkDoubleArray* bifurcationVectorsArray = vtkDoubleArray::New();
342 bifurcationVectorsArray->SetName(this->BifurcationVectorsArrayName);
343 bifurcationVectorsArray->SetNumberOfComponents(3);
344
345 vtkDoubleArray* inPlaneBifurcationVectorsArray = vtkDoubleArray::New();
346 inPlaneBifurcationVectorsArray->SetName(this->InPlaneBifurcationVectorsArrayName);
347 inPlaneBifurcationVectorsArray->SetNumberOfComponents(3);
348
349 vtkDoubleArray* outOfPlaneBifurcationVectorsArray = vtkDoubleArray::New();
350 outOfPlaneBifurcationVectorsArray->SetName(this->OutOfPlaneBifurcationVectorsArrayName);
351 outOfPlaneBifurcationVectorsArray->SetNumberOfComponents(3);
352
353 vtkDoubleArray* inPlaneBifurcationVectorAnglesArray = vtkDoubleArray::New();
354 inPlaneBifurcationVectorAnglesArray->SetName(this->InPlaneBifurcationVectorAnglesArrayName);
355 inPlaneBifurcationVectorAnglesArray->SetNumberOfComponents(1);
356
357 vtkDoubleArray* outOfPlaneBifurcationVectorAnglesArray = vtkDoubleArray::New();
358 outOfPlaneBifurcationVectorAnglesArray->SetName(this->OutOfPlaneBifurcationVectorAnglesArrayName);
359 outOfPlaneBifurcationVectorAnglesArray->SetNumberOfComponents(1);
360
361 vtkIntArray* bifurcationVectorsOrientationArray = vtkIntArray::New();
362 bifurcationVectorsOrientationArray->SetName(this->BifurcationVectorsOrientationArrayName);
363 bifurcationVectorsOrientationArray->SetNumberOfComponents(1);
364
365 vtkIntArray* bifurcationVectorsGroupIdsArray = vtkIntArray::New();
366 bifurcationVectorsGroupIdsArray->SetName(this->GroupIdsArrayName);
367 bifurcationVectorsGroupIdsArray->SetNumberOfComponents(1);
368
369 vtkIntArray* bifurcationVectorsBifurcationGroupIdsArray = vtkIntArray::New();
370 bifurcationVectorsBifurcationGroupIdsArray->SetName(this->BifurcationGroupIdsArrayName);
371 bifurcationVectorsBifurcationGroupIdsArray->SetNumberOfComponents(1);
372
373 output->GetPointData()->AddArray(bifurcationVectorsArray);
374 output->GetPointData()->AddArray(inPlaneBifurcationVectorsArray);
375 output->GetPointData()->AddArray(outOfPlaneBifurcationVectorsArray);
376 output->GetPointData()->AddArray(inPlaneBifurcationVectorAnglesArray);
377 output->GetPointData()->AddArray(outOfPlaneBifurcationVectorAnglesArray);
378 output->GetPointData()->AddArray(bifurcationVectorsOrientationArray);
379 output->GetPointData()->AddArray(bifurcationVectorsGroupIdsArray);
380 output->GetPointData()->AddArray(bifurcationVectorsBifurcationGroupIdsArray);
381
382 vtkIdList* blankedGroupIds = vtkIdList::New();
384 int i;
385 for (i=0; i<blankedGroupIds->GetNumberOfIds(); i++)
386 {
387 vtkIdType bifurcationGroupId = blankedGroupIds->GetId(i);
388
389 vtkIdList* groupBifurcationVectorsGroupIds = vtkIdList::New();
390 vtkIntArray* groupBifurcationVectorsOrientation = vtkIntArray::New();
391 vtkDoubleArray* groupBifurcationVectors = vtkDoubleArray::New();
392 vtkPoints* groupBifurcationVectorsPoints = vtkPoints::New();
393 vtkDoubleArray* groupInPlaneBifurcationVectors = vtkDoubleArray::New();
394 vtkDoubleArray* groupOutOfPlaneBifurcationVectors = vtkDoubleArray::New();
395 vtkDoubleArray* groupInPlaneBifurcationVectorAngles = vtkDoubleArray::New();
396 vtkDoubleArray* groupOutOfPlaneBifurcationVectorAngles = vtkDoubleArray::New();
397
398 this->ComputeBifurcationVectors(input,bifurcationGroupId,groupBifurcationVectorsGroupIds,groupBifurcationVectorsOrientation,groupBifurcationVectors,groupBifurcationVectorsPoints);
399 this->ComputeBifurcationVectorComponents(bifurcationGroupId,groupBifurcationVectors,groupInPlaneBifurcationVectors,groupOutOfPlaneBifurcationVectors);
400 this->ComputeBifurcationVectorAngles(bifurcationGroupId,groupBifurcationVectors,groupInPlaneBifurcationVectors,groupOutOfPlaneBifurcationVectors,groupInPlaneBifurcationVectorAngles,groupOutOfPlaneBifurcationVectorAngles);
401
402 int j;
403 for (j=0; j<groupBifurcationVectorsGroupIds->GetNumberOfIds(); j++)
404 {
405 vtkIdType pointId = outputPoints->InsertNextPoint(groupBifurcationVectorsPoints->GetPoint(j));
406 outputVerts->InsertNextCell(1);
407 outputVerts->InsertCellPoint(pointId);
408
409 bifurcationVectorsArray->InsertNextTuple(groupBifurcationVectors->GetTuple(j));
410 inPlaneBifurcationVectorsArray->InsertNextTuple(groupInPlaneBifurcationVectors->GetTuple(j));
411 outOfPlaneBifurcationVectorsArray->InsertNextTuple(groupOutOfPlaneBifurcationVectors->GetTuple(j));
412 inPlaneBifurcationVectorAnglesArray->InsertNextTuple(groupInPlaneBifurcationVectorAngles->GetTuple(j));
413 outOfPlaneBifurcationVectorAnglesArray->InsertNextTuple(groupOutOfPlaneBifurcationVectorAngles->GetTuple(j));
414 bifurcationVectorsOrientationArray->InsertNextValue(groupBifurcationVectorsOrientation->GetValue(j));
415 bifurcationVectorsGroupIdsArray->InsertNextValue(groupBifurcationVectorsGroupIds->GetId(j));
416 bifurcationVectorsBifurcationGroupIdsArray->InsertNextValue(bifurcationGroupId);
417 }
418
419 groupBifurcationVectorsGroupIds->Delete();
420 groupBifurcationVectorsOrientation->Delete();
421 groupBifurcationVectors->Delete();
422 groupBifurcationVectorsPoints->Delete();
423 groupInPlaneBifurcationVectors->Delete();
424 groupOutOfPlaneBifurcationVectors->Delete();
425 groupInPlaneBifurcationVectorAngles->Delete();
426 groupOutOfPlaneBifurcationVectorAngles->Delete();
427 }
428
429 blankedGroupIds->Delete();
430
431 outputPoints->Delete();
432 outputVerts->Delete();
433
434 bifurcationVectorsArray->Delete();
435 inPlaneBifurcationVectorsArray->Delete();
436 outOfPlaneBifurcationVectorsArray->Delete();
437 inPlaneBifurcationVectorAnglesArray->Delete();
438 outOfPlaneBifurcationVectorAnglesArray->Delete();
439 bifurcationVectorsOrientationArray->Delete();
440 bifurcationVectorsGroupIdsArray->Delete();
441 bifurcationVectorsBifurcationGroupIdsArray->Delete();
442
443 return 1;
444}
void ComputeBifurcationVectorComponents(int bifurcationGroupId, vtkDoubleArray *bifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectors, vtkDoubleArray *outOfPlaneBifurcationVectors)
void ComputeBifurcationVectors(vtkPolyData *input, int bifurcationGroupId, vtkIdList *bifurcationVectorsGroupIds, vtkIntArray *bifurcationVectorsOrientation, vtkDoubleArray *bifurcationVectors, vtkPoints *bifurcationVectorsPoints)
void ComputeBifurcationVectorAngles(int bifurcationGroupId, vtkDoubleArray *bifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectors, vtkDoubleArray *outOfPlaneBifurcationVectors, vtkDoubleArray *inPlaneBifurcationVectorAngles, vtkDoubleArray *outOfPlaneBifurcationVectorAngles)
static void GetBlankedGroupsIdList(vtkPolyData *centerlines, const char *groupIdsArrayName, const char *blankingArrayName, vtkIdList *groupIds)

◆ ComputeBifurcationVectors()

void vtkvmtkCenterlineBifurcationVectors::ComputeBifurcationVectors ( vtkPolyData * input,
int bifurcationGroupId,
vtkIdList * bifurcationVectorsGroupIds,
vtkIntArray * bifurcationVectorsOrientation,
vtkDoubleArray * bifurcationVectors,
vtkPoints * bifurcationVectorsPoints )
protected

Definition at line 446 of file vtkvmtkCenterlineBifurcationVectors.cxx.

447{
448 vtkDataArray* radiusArray = input->GetPointData()->GetArray(this->RadiusArrayName);
449
450 bifurcationVectorsGroupIds->Initialize();
451 bifurcationVectorsOrientation->Initialize();
452
453 vtkIdList* upStreamGroupIds = vtkIdList::New();
454 vtkIdList* downStreamGroupIds = vtkIdList::New();
455
456 vtkvmtkCenterlineUtilities::FindAdjacentCenterlineGroupIds(input,this->GroupIdsArrayName,this->CenterlineIdsArrayName,this->TractIdsArrayName,bifurcationGroupId,upStreamGroupIds,downStreamGroupIds);
457
458 int numberOfUpStreamGroupIds = upStreamGroupIds->GetNumberOfIds();
459 int numberOfDownStreamGroupIds = downStreamGroupIds->GetNumberOfIds();
460
461 int i;
462 for (i=0; i<numberOfUpStreamGroupIds; i++)
463 {
464 bifurcationVectorsGroupIds->InsertNextId(upStreamGroupIds->GetId(i));
465 bifurcationVectorsOrientation->InsertNextValue(VTK_VMTK_UPSTREAM_ORIENTATION);
466 }
467 for (i=0; i<numberOfDownStreamGroupIds; i++)
468 {
469 bifurcationVectorsGroupIds->InsertNextId(downStreamGroupIds->GetId(i));
470 bifurcationVectorsOrientation->InsertNextValue(VTK_VMTK_DOWNSTREAM_ORIENTATION);
471 }
472
473 upStreamGroupIds->Delete();
474 downStreamGroupIds->Delete();
475
476 bifurcationVectors->Initialize();
477 bifurcationVectors->SetNumberOfComponents(3);
478
479 int numberOfBifurcationVectors = bifurcationVectorsGroupIds->GetNumberOfIds();
480
481 for (i=0; i<numberOfBifurcationVectors; i++)
482 {
483 int bifurcationVectorGroupId = bifurcationVectorsGroupIds->GetId(i);
484 int bifurcationVectorOrientation = bifurcationVectorsOrientation->GetValue(i);
485 double averageLastPoint[3], averageTouchingPoint[3];
486 averageLastPoint[0] = averageLastPoint[1] = averageLastPoint[2] = 0.0;
487 averageTouchingPoint[0] = averageTouchingPoint[1] = averageTouchingPoint[2] = 0.0;
488 double lastPointWeightSum = 0.0;
489 double touchingPointWeightSum = 0.0;
490 vtkIdList* groupCellIds = vtkIdList::New();
491 vtkvmtkCenterlineUtilities::GetGroupUniqueCellIds(input,this->GroupIdsArrayName,bifurcationVectorGroupId,groupCellIds);
492 for (int j=0; j<groupCellIds->GetNumberOfIds(); j++)
493 {
494 vtkIdType cellId = groupCellIds->GetId(j);
495 vtkCell* cell = input->GetCell(cellId);
496 int numberOfCellPoints = cell->GetNumberOfPoints();
497
498 vtkIdType touchingSubId = -1;
499 double touchingPCoord = 0.0;
500
501 vtkIdType pointSubId = -1;
502 double pointPCoord = 0.0;
503 bool forward = true;
504
505 double lastPoint[3];
506 double lastPointRadius = 0.0;
507
508 if (bifurcationVectorOrientation == VTK_VMTK_UPSTREAM_ORIENTATION)
509 {
510 pointSubId = numberOfCellPoints-2;
511 pointPCoord = 1.0;
512 forward = true;
513 cell->GetPoints()->GetPoint(numberOfCellPoints-1,lastPoint);
514 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(numberOfCellPoints-1),0);
515 }
516 else if (bifurcationVectorOrientation == VTK_VMTK_DOWNSTREAM_ORIENTATION)
517 {
518 pointSubId = 0;
519 pointPCoord = 0.0;
520 forward = false;
521 cell->GetPoints()->GetPoint(0,lastPoint);
522 lastPointRadius = radiusArray->GetComponent(cell->GetPointId(0),0);
523 }
524 else
525 {
526 vtkErrorMacro("Error: invalid BifurcationVectorOrientation");
527 return;
528 }
529
530 vtkvmtkCenterlineSphereDistance::FindTouchingSphereCenter(input,this->RadiusArrayName,cellId,pointSubId,pointPCoord,touchingSubId,touchingPCoord,forward);
531
532 if (touchingSubId == -1)
533 {
534 touchingSubId = numberOfCellPoints-2;
535 touchingPCoord = 1.0;
536 }
537
538 //accumulate last point and touching point (weighted with radius^2)
539
540 averageLastPoint[0] += lastPointRadius * lastPointRadius * lastPoint[0];
541 averageLastPoint[1] += lastPointRadius * lastPointRadius * lastPoint[1];
542 averageLastPoint[2] += lastPointRadius * lastPointRadius * lastPoint[2];
543
544 lastPointWeightSum += lastPointRadius * lastPointRadius;
545 double touchingPoint[3], touchingPointRadius;
546 vtkvmtkCenterlineUtilities::InterpolatePoint(input,cellId,touchingSubId,touchingPCoord,touchingPoint);
547 vtkvmtkCenterlineUtilities::InterpolateTuple(input,this->RadiusArrayName,cellId,touchingSubId,touchingPCoord,&touchingPointRadius);
548
549 averageTouchingPoint[0] += touchingPointRadius * touchingPointRadius * touchingPoint[0];
550 averageTouchingPoint[1] += touchingPointRadius * touchingPointRadius * touchingPoint[1];
551 averageTouchingPoint[2] += touchingPointRadius * touchingPointRadius * touchingPoint[2];
552
553 touchingPointWeightSum += touchingPointRadius * touchingPointRadius;
554 }
555 groupCellIds->Delete();
556
557 averageLastPoint[0] /= lastPointWeightSum;
558 averageLastPoint[1] /= lastPointWeightSum;
559 averageLastPoint[2] /= lastPointWeightSum;
560
561 averageTouchingPoint[0] /= touchingPointWeightSum;
562 averageTouchingPoint[1] /= touchingPointWeightSum;
563 averageTouchingPoint[2] /= touchingPointWeightSum;
564
565 //build and store bifurcationVector for this group
566
567 double bifurcationVector[3], bifurcationVectorPoint[3];
568
569 if (bifurcationVectorOrientation == VTK_VMTK_UPSTREAM_ORIENTATION)
570 {
571 bifurcationVector[0] = averageLastPoint[0] - averageTouchingPoint[0];
572 bifurcationVector[1] = averageLastPoint[1] - averageTouchingPoint[1];
573 bifurcationVector[2] = averageLastPoint[2] - averageTouchingPoint[2];
574 bifurcationVectorPoint[0] = averageTouchingPoint[0];
575 bifurcationVectorPoint[1] = averageTouchingPoint[1];
576 bifurcationVectorPoint[2] = averageTouchingPoint[2];
577 }
578 else if (bifurcationVectorOrientation == VTK_VMTK_DOWNSTREAM_ORIENTATION)
579 {
580 bifurcationVector[0] = averageTouchingPoint[0] - averageLastPoint[0];
581 bifurcationVector[1] = averageTouchingPoint[1] - averageLastPoint[1];
582 bifurcationVector[2] = averageTouchingPoint[2] - averageLastPoint[2];
583 bifurcationVectorPoint[0] = averageLastPoint[0];
584 bifurcationVectorPoint[1] = averageLastPoint[1];
585 bifurcationVectorPoint[2] = averageLastPoint[2];
586 }
587 else
588 {
589 vtkErrorMacro("Error: invalid BifurcationVectorOrientation");
590 return;
591 }
592
594 {
595 vtkMath::Normalize(bifurcationVector);
596 }
597
598 bifurcationVectors->InsertNextTuple(bifurcationVector);
599 bifurcationVectorsPoints->InsertNextPoint(bifurcationVectorPoint);
600 }
601}
static void FindTouchingSphereCenter(vtkPolyData *centerlines, const char *radiusArrayName, vtkIdType cellId, vtkIdType subId, double pcoord, 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 InterpolateTuple(vtkPolyData *centerlines, const char *arrayName, int cellId, int subId, double pcoord, double *interpolatedTuple)
static void FindAdjacentCenterlineGroupIds(vtkPolyData *centerlines, const char *groupIdsArrayName, const char *centerlineIdsArrayName, const char *tractIdsArrayName, vtkIdType groupId, vtkIdList *upStreamGroupIds, vtkIdList *downStreamGroupIds)

◆ ComputeBifurcationVectorComponents()

void vtkvmtkCenterlineBifurcationVectors::ComputeBifurcationVectorComponents ( int bifurcationGroupId,
vtkDoubleArray * bifurcationVectors,
vtkDoubleArray * inPlaneBifurcationVectors,
vtkDoubleArray * outOfPlaneBifurcationVectors )
protected

Definition at line 603 of file vtkvmtkCenterlineBifurcationVectors.cxx.

604{
605 // get the reference system, get the normal, project the angles.
606
607 vtkDataArray* referenceSystemNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemNormalArrayName);
608 vtkDataArray* referenceSystemUpNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemUpNormalArrayName);
609
610 inPlaneBifurcationVectors->Initialize();
611 inPlaneBifurcationVectors->SetNumberOfComponents(3);
612 outOfPlaneBifurcationVectors->Initialize();
613 outOfPlaneBifurcationVectors->SetNumberOfComponents(3);
614
616
617 double bifurcationPlaneNormal[3];
618 referenceSystemNormalArray->GetTuple(referenceSystemPointId,bifurcationPlaneNormal);
619
620 double bifurcationUpNormal[3];
621 referenceSystemUpNormalArray->GetTuple(referenceSystemPointId,bifurcationUpNormal);
622
623 double bifurcationVector[3], inPlaneBifurcationVector[3], outOfPlaneBifurcationVector[3];
624
625 int numberOfBifurcationVectors = bifurcationVectors->GetNumberOfTuples();
626
627 int j;
628 for (j=0; j<numberOfBifurcationVectors; j++)
629 {
630 bifurcationVectors->GetTuple(j,bifurcationVector);
631
632 double dot = vtkMath::Dot(bifurcationVector,bifurcationPlaneNormal);
633
634 outOfPlaneBifurcationVector[0] = dot * bifurcationPlaneNormal[0];
635 outOfPlaneBifurcationVector[1] = dot * bifurcationPlaneNormal[1];
636 outOfPlaneBifurcationVector[2] = dot * bifurcationPlaneNormal[2];
637
638 inPlaneBifurcationVector[0] = bifurcationVector[0] - outOfPlaneBifurcationVector[0];
639 inPlaneBifurcationVector[1] = bifurcationVector[1] - outOfPlaneBifurcationVector[1];
640 inPlaneBifurcationVector[2] = bifurcationVector[2] - outOfPlaneBifurcationVector[2];
641
642 inPlaneBifurcationVectors->InsertNextTuple(inPlaneBifurcationVector);
643 outOfPlaneBifurcationVectors->InsertNextTuple(outOfPlaneBifurcationVector);
644 }
645}
static vtkIdType GetReferenceSystemPointId(vtkPolyData *referenceSystems, const char *groupIdsArrayName, vtkIdType groupId)

◆ ComputeBifurcationVectorAngles()

void vtkvmtkCenterlineBifurcationVectors::ComputeBifurcationVectorAngles ( int bifurcationGroupId,
vtkDoubleArray * bifurcationVectors,
vtkDoubleArray * inPlaneBifurcationVectors,
vtkDoubleArray * outOfPlaneBifurcationVectors,
vtkDoubleArray * inPlaneBifurcationVectorAngles,
vtkDoubleArray * outOfPlaneBifurcationVectorAngles )
protected

Definition at line 647 of file vtkvmtkCenterlineBifurcationVectors.cxx.

648{
649 vtkDataArray* referenceSystemNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemNormalArrayName);
650 vtkDataArray* referenceSystemUpNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemUpNormalArrayName);
651
653
654 double bifurcationPlaneNormal[3], bifurcationUpNormal[3];
655
656 referenceSystemNormalArray->GetTuple(referenceSystemPointId,bifurcationPlaneNormal);
657 referenceSystemUpNormalArray->GetTuple(referenceSystemPointId,bifurcationUpNormal);
658
659 int numberOfBifurcationVectors = bifurcationVectors->GetNumberOfTuples();
660 int i;
661 for (i=0; i<numberOfBifurcationVectors; i++)
662 {
663 double bifurcationVector[3], inPlaneBifurcationVector[3], outOfPlaneBifurcationVector[3];
664
665 bifurcationVectors->GetTuple(i,bifurcationVector);
666 inPlaneBifurcationVectors->GetTuple(i,inPlaneBifurcationVector);
667 outOfPlaneBifurcationVectors->GetTuple(i,outOfPlaneBifurcationVector);
668
669 vtkMath::Normalize(bifurcationVector);
670 vtkMath::Normalize(inPlaneBifurcationVector);
671
672 double inPlaneBifurcationVectorAngle = vtkvmtkMath::AngleBetweenNormals(inPlaneBifurcationVector,bifurcationUpNormal);
673 double cross[3];
674 vtkMath::Cross(inPlaneBifurcationVector,bifurcationUpNormal,cross);
675 if (vtkMath::Dot(cross,bifurcationPlaneNormal) < 0.0)
676 {
677 inPlaneBifurcationVectorAngle *= -1.0;
678 }
679
680 double outOfPlaneBifurcationVectorAngle = vtkMath::Pi()/2.0 - vtkvmtkMath::AngleBetweenNormals(bifurcationVector,bifurcationPlaneNormal);
681
682 inPlaneBifurcationVectorAngles->InsertNextValue(inPlaneBifurcationVectorAngle);
683 outOfPlaneBifurcationVectorAngles->InsertNextValue(outOfPlaneBifurcationVectorAngle);
684 }
685}
static double AngleBetweenNormals(double normal0[3], double normal1[3])

Member Data Documentation

◆ RadiusArrayName

char* vtkvmtkCenterlineBifurcationVectors::RadiusArrayName
protected

Definition at line 258 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ GroupIdsArrayName

char* vtkvmtkCenterlineBifurcationVectors::GroupIdsArrayName
protected

Definition at line 259 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ CenterlineIdsArrayName

char* vtkvmtkCenterlineBifurcationVectors::CenterlineIdsArrayName
protected

Definition at line 260 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ TractIdsArrayName

char* vtkvmtkCenterlineBifurcationVectors::TractIdsArrayName
protected

Definition at line 261 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ BlankingArrayName

char* vtkvmtkCenterlineBifurcationVectors::BlankingArrayName
protected

Definition at line 262 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ ReferenceSystems

vtkPolyData* vtkvmtkCenterlineBifurcationVectors::ReferenceSystems
protected

Definition at line 264 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ ReferenceSystemGroupIdsArrayName

char* vtkvmtkCenterlineBifurcationVectors::ReferenceSystemGroupIdsArrayName
protected

Definition at line 266 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ ReferenceSystemNormalArrayName

char* vtkvmtkCenterlineBifurcationVectors::ReferenceSystemNormalArrayName
protected

Definition at line 267 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ ReferenceSystemUpNormalArrayName

char* vtkvmtkCenterlineBifurcationVectors::ReferenceSystemUpNormalArrayName
protected

Definition at line 268 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ BifurcationVectorsArrayName

char* vtkvmtkCenterlineBifurcationVectors::BifurcationVectorsArrayName
protected

Definition at line 270 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ InPlaneBifurcationVectorsArrayName

char* vtkvmtkCenterlineBifurcationVectors::InPlaneBifurcationVectorsArrayName
protected

Definition at line 271 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ OutOfPlaneBifurcationVectorsArrayName

char* vtkvmtkCenterlineBifurcationVectors::OutOfPlaneBifurcationVectorsArrayName
protected

Definition at line 272 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ BifurcationVectorsOrientationArrayName

char* vtkvmtkCenterlineBifurcationVectors::BifurcationVectorsOrientationArrayName
protected

Definition at line 273 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ InPlaneBifurcationVectorAnglesArrayName

char* vtkvmtkCenterlineBifurcationVectors::InPlaneBifurcationVectorAnglesArrayName
protected

Definition at line 275 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ OutOfPlaneBifurcationVectorAnglesArrayName

char* vtkvmtkCenterlineBifurcationVectors::OutOfPlaneBifurcationVectorAnglesArrayName
protected

Definition at line 276 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ BifurcationGroupIdsArrayName

char* vtkvmtkCenterlineBifurcationVectors::BifurcationGroupIdsArrayName
protected

Definition at line 278 of file vtkvmtkCenterlineBifurcationVectors.h.

◆ NormalizeBifurcationVectors

int vtkvmtkCenterlineBifurcationVectors::NormalizeBifurcationVectors
protected

Definition at line 280 of file vtkvmtkCenterlineBifurcationVectors.h.


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