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

Move the abscissa metric such that its zero point is at a bifurcation center and rotate parallel transport normals such that they are normal to the bifurcation plane. More...

#include <vtkvmtkCenterlineReferenceSystemAttributesOffset.h>

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

Public Types

typedef vtkPolyDataAlgorithm Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkCenterlineReferenceSystemAttributesOffset * NewInstance () const
void PrintSelf (std::ostream &os, vtkIndent indent) override
virtual void SetOffsetAbscissasArrayName (const char *)
virtual char * GetOffsetAbscissasArrayName ()
virtual void SetOffsetNormalsArrayName (const char *)
virtual char * GetOffsetNormalsArrayName ()
virtual void SetAbscissasArrayName (const char *)
virtual char * GetAbscissasArrayName ()
virtual void SetNormalsArrayName (const char *)
virtual char * GetNormalsArrayName ()
virtual void SetGroupIdsArrayName (const char *)
virtual char * GetGroupIdsArrayName ()
virtual void SetCenterlineIdsArrayName (const char *)
virtual char * GetCenterlineIdsArrayName ()
virtual void SetReferenceSystems (vtkPolyData *)
virtual vtkPolyData * GetReferenceSystems ()
virtual void SetReferenceSystemsNormalArrayName (const char *)
virtual char * GetReferenceSystemsNormalArrayName ()
virtual void SetReferenceSystemsGroupIdsArrayName (const char *)
virtual char * GetReferenceSystemsGroupIdsArrayName ()
virtual void SetReferenceGroupId (int)
virtual int GetReferenceGroupId ()

Static Public Member Functions

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

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkCenterlineReferenceSystemAttributesOffset ()
 ~vtkvmtkCenterlineReferenceSystemAttributesOffset ()
virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) override

Protected Attributes

char * OffsetAbscissasArrayName
char * OffsetNormalsArrayName
char * AbscissasArrayName
char * NormalsArrayName
char * GroupIdsArrayName
char * CenterlineIdsArrayName
vtkPolyData * ReferenceSystems
char * ReferenceSystemsNormalArrayName
char * ReferenceSystemsGroupIdsArrayName
int ReferenceGroupId

Detailed Description

Move the abscissa metric such that its zero point is at a bifurcation center and rotate parallel transport normals such that they are normal to the bifurcation plane.

Abscissa to be set to 0 at the bifurcation. We twist the entire parallel transport reference framing (rigidly) around the centerline so that the parallel transport normals are normal to the bifurcation plane at the bifurcation. this is useful for analyses that may be conducted later on comparing vessel torsion to the parallel transport normal

Takes as input centerlines already carrying abscissa/parallel-transport-normal attributes (see vtkvmtkCenterlineAttributesFilter) and a set of bifurcation reference systems (see vtkvmtkCenterlineBifurcationReferenceSystems); this is the filter behind the vmtkcenterlineoffsetattributes pype script.

See also
vtkvmtkCenterlineAttributesFilter, vtkvmtkCenterlineBifurcationReferenceSystems

Definition at line 44 of file vtkvmtkCenterlineReferenceSystemAttributesOffset.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkCenterlineReferenceSystemAttributesOffset()

vtkvmtkCenterlineReferenceSystemAttributesOffset::vtkvmtkCenterlineReferenceSystemAttributesOffset ( )
protected

Definition at line 41 of file vtkvmtkCenterlineReferenceSystemAttributesOffset.cxx.

42{
43 this->OffsetAbscissasArrayName = NULL;
44 this->OffsetNormalsArrayName = NULL;
45
46 this->AbscissasArrayName = NULL;
47 this->NormalsArrayName = NULL;
48 this->GroupIdsArrayName = NULL;
49 this->CenterlineIdsArrayName = NULL;
50
51 this->ReferenceSystems = NULL;
52
55
56 this->ReferenceGroupId = 0;
57}

◆ ~vtkvmtkCenterlineReferenceSystemAttributesOffset()

vtkvmtkCenterlineReferenceSystemAttributesOffset::~vtkvmtkCenterlineReferenceSystemAttributesOffset ( )
protected

Definition at line 59 of file vtkvmtkCenterlineReferenceSystemAttributesOffset.cxx.

60{
62 {
63 delete[] this->OffsetAbscissasArrayName;
64 this->OffsetAbscissasArrayName = NULL;
65 }
66
67 if (this->OffsetNormalsArrayName)
68 {
69 delete[] this->OffsetNormalsArrayName;
70 this->OffsetNormalsArrayName = NULL;
71 }
72
73 if (this->AbscissasArrayName)
74 {
75 delete[] this->AbscissasArrayName;
76 this->AbscissasArrayName = NULL;
77 }
78
79 if (this->NormalsArrayName)
80 {
81 delete[] this->NormalsArrayName;
82 this->NormalsArrayName = NULL;
83 }
84
85 if (this->GroupIdsArrayName)
86 {
87 delete[] this->GroupIdsArrayName;
88 this->GroupIdsArrayName = NULL;
89 }
90
91 if (this->CenterlineIdsArrayName)
92 {
93 delete[] this->CenterlineIdsArrayName;
94 this->CenterlineIdsArrayName = NULL;
95 }
96
97 if (this->NormalsArrayName)
98 {
99 delete[] this->NormalsArrayName;
100 this->NormalsArrayName = NULL;
101 }
102
103 if (this->ReferenceSystems)
104 {
105 this->ReferenceSystems->Delete();
106 this->ReferenceSystems = NULL;
107 }
108
110 {
111 delete[] this->ReferenceSystemsNormalArrayName;
113 }
114
116 {
119 }
120}

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkCenterlineReferenceSystemAttributesOffset::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkCenterlineReferenceSystemAttributesOffset * vtkvmtkCenterlineReferenceSystemAttributesOffset::NewInstance ( ) const

◆ PrintSelf()

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

Definition at line 407 of file vtkvmtkCenterlineReferenceSystemAttributesOffset.cxx.

408{
409 this->Superclass::PrintSelf(os,indent);
410}

◆ New()

vtkvmtkCenterlineReferenceSystemAttributesOffset * vtkvmtkCenterlineReferenceSystemAttributesOffset::New ( )
static

◆ SetOffsetAbscissasArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetOffsetAbscissasArrayName ( const char * )
virtual

Set/Get the name of the output point data array where the offset abscissa is stored. May be the same as AbscissasArrayName to overwrite it in place, or a different name to preserve the original alongside the offset one. Commonly named "Abscissas".

◆ GetOffsetAbscissasArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetOffsetAbscissasArrayName ( )
virtual

Set/Get the name of the output point data array where the offset abscissa is stored. May be the same as AbscissasArrayName to overwrite it in place, or a different name to preserve the original alongside the offset one. Commonly named "Abscissas".

◆ SetOffsetNormalsArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetOffsetNormalsArrayName ( const char * )
virtual

Set/Get the name of the output 3-component point data array where the rotated (offset) parallel transport normals are stored. May be the same as NormalsArrayName to overwrite it in place, or a different name to preserve the original alongside the offset one. Commonly named "ParallelTransportNormals", "OffsetNormals", "Normals", or "IoletNormals", depending on context.

◆ GetOffsetNormalsArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetOffsetNormalsArrayName ( )
virtual

Set/Get the name of the output 3-component point data array where the rotated (offset) parallel transport normals are stored. May be the same as NormalsArrayName to overwrite it in place, or a different name to preserve the original alongside the offset one. Commonly named "ParallelTransportNormals", "OffsetNormals", "Normals", or "IoletNormals", depending on context.

◆ SetAbscissasArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetAbscissasArrayName ( const char * )
virtual

Set/Get the name of the input point data array holding the (unoffset) centerline abscissa, as produced by vtkvmtkCenterlineAttributesFilter. Required input. Commonly named "Abscissas".

◆ GetAbscissasArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetAbscissasArrayName ( )
virtual

Set/Get the name of the input point data array holding the (unoffset) centerline abscissa, as produced by vtkvmtkCenterlineAttributesFilter. Required input. Commonly named "Abscissas".

◆ SetNormalsArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetNormalsArrayName ( const char * )
virtual

Set/Get the name of the input 3-component point data array holding the (unrotated) parallel transport normals, as produced by vtkvmtkCenterlineAttributesFilter. Required input. Commonly named "ParallelTransportNormals".

◆ GetNormalsArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetNormalsArrayName ( )
virtual

Set/Get the name of the input 3-component point data array holding the (unrotated) parallel transport normals, as produced by vtkvmtkCenterlineAttributesFilter. Required input. Commonly named "ParallelTransportNormals".

◆ SetGroupIdsArrayName()

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

◆ SetReferenceSystems()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetReferenceSystems ( vtkPolyData * )
virtual

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

◆ GetReferenceSystems()

virtual vtkPolyData * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetReferenceSystems ( )
virtual

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

◆ SetReferenceSystemsNormalArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetReferenceSystemsNormalArrayName ( const char * )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation plane normal vector that the parallel transport normals are rotated to align with. Commonly named "Normal".

◆ GetReferenceSystemsNormalArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetReferenceSystemsNormalArrayName ( )
virtual

Set/Get the name of the point data array of ReferenceSystems holding the bifurcation plane normal vector that the parallel transport normals are rotated to align with. Commonly named "Normal".

◆ SetReferenceSystemsGroupIdsArrayName()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetReferenceSystemsGroupIdsArrayName ( 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".

◆ GetReferenceSystemsGroupIdsArrayName()

virtual char * vtkvmtkCenterlineReferenceSystemAttributesOffset::GetReferenceSystemsGroupIdsArrayName ( )
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".

◆ SetReferenceGroupId()

virtual void vtkvmtkCenterlineReferenceSystemAttributesOffset::SetReferenceGroupId ( int )
virtual

Set/Get the group id of the bifurcation reference system to offset to. Default: 0. If explicitly set to -1, the first reference system found in ReferenceSystems is used automatically, and the resolved group id can be retrieved afterward with GetReferenceGroupId.

◆ GetReferenceGroupId()

virtual int vtkvmtkCenterlineReferenceSystemAttributesOffset::GetReferenceGroupId ( )
virtual

Set/Get the group id of the bifurcation reference system to offset to. Default: 0. If explicitly set to -1, the first reference system found in ReferenceSystems is used automatically, and the resolved group id can be retrieved afterward with GetReferenceGroupId.

◆ RequestData()

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

Definition at line 122 of file vtkvmtkCenterlineReferenceSystemAttributesOffset.cxx.

126{
127 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
128 vtkInformation *outInfo = outputVector->GetInformationObject(0);
129
130 vtkPolyData *input = vtkPolyData::SafeDownCast(
131 inInfo->Get(vtkDataObject::DATA_OBJECT()));
132 vtkPolyData *output = vtkPolyData::SafeDownCast(
133 outInfo->Get(vtkDataObject::DATA_OBJECT()));
134
135 if (!this->OffsetAbscissasArrayName)
136 {
137 vtkErrorMacro(<<"OffsetAbscissasArrayName not specified");
138 return 1;
139 }
140
141 if (!this->OffsetNormalsArrayName)
142 {
143 vtkErrorMacro(<<"OffsetNormalsArrayName not specified");
144 return 1;
145 }
146
147 if (!this->AbscissasArrayName)
148 {
149 vtkErrorMacro(<<"AbscissasArrayName not specified");
150 return 1;
151 }
152
153 vtkDataArray* abscissasArray = input->GetPointData()->GetArray(this->AbscissasArrayName);
154
155 if (!abscissasArray)
156 {
157 vtkErrorMacro(<<"AbscissasArray with name specified does not exist");
158 return 1;
159 }
160
161 if (!this->NormalsArrayName)
162 {
163 vtkErrorMacro(<<"NormalsArrayName not specified");
164 return 1;
165 }
166
167 vtkDataArray* normalsArray = input->GetPointData()->GetArray(this->NormalsArrayName);
168
169 if (!normalsArray)
170 {
171 vtkErrorMacro(<<"NormalsArray with name specified does not exist");
172 return 1;
173 }
174
175 if (!this->GroupIdsArrayName)
176 {
177 vtkErrorMacro(<<"GroupIdsArrayName not specified");
178 return 1;
179 }
180
181 vtkDataArray* groupIdsArray = input->GetCellData()->GetArray(this->GroupIdsArrayName);
182
183 if (!groupIdsArray)
184 {
185 vtkErrorMacro(<<"GroupIdsArray with name specified does not exist");
186 return 1;
187 }
188
189 if (!this->CenterlineIdsArrayName)
190 {
191 vtkErrorMacro(<<"CenterlineIdsArrayName not specified");
192 return 1;
193 }
194
195 vtkDataArray* centerlineIdsArray = input->GetCellData()->GetArray(this->CenterlineIdsArrayName);
196
197 if (!centerlineIdsArray)
198 {
199 vtkErrorMacro(<<"CenterlineIdsArray with name specified does not exist");
200 return 1;
201 }
202
203 if (!this->ReferenceSystems)
204 {
205 vtkErrorMacro(<<"ReferenceSystems not specified");
206 return 1;
207 }
208
209 if (this->ReferenceSystems->GetNumberOfPoints() == 0)
210 {
211 vtkErrorMacro(<<"ReferenceSystems empty");
212 return 1;
213 }
214
216 {
217 vtkErrorMacro(<<"ReferenceSystemsNormalArrayName not specified");
218 return 1;
219 }
220
221 vtkDataArray* referenceSystemsNormalArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemsNormalArrayName);
222
223 if (!referenceSystemsNormalArray)
224 {
225 vtkErrorMacro(<<"ReferenceSystemNormalsArray with name specified does not exist");
226 return 1;
227 }
228
230 {
231 vtkErrorMacro(<<"ReferenceSystemsGroupIdsArrayName not specified");
232 return 1;
233 }
234
235 vtkDataArray* referenceSystemsGroupIdsArray = this->ReferenceSystems->GetPointData()->GetArray(this->ReferenceSystemsGroupIdsArrayName);
236
237 if (!referenceSystemsGroupIdsArray)
238 {
239 vtkErrorMacro(<<"ReferenceSystemsGroupIdsArray with name specified does not exist");
240 return 1;
241 }
242
243 output->DeepCopy(input);
244
245 vtkDoubleArray* offsetAbscissasArray = vtkDoubleArray::New();
246 offsetAbscissasArray->SetName(this->OffsetAbscissasArrayName);
247 offsetAbscissasArray->SetNumberOfComponents(1);
248 offsetAbscissasArray->SetNumberOfTuples(input->GetNumberOfPoints());
249
250 vtkDoubleArray* offsetNormalsArray = vtkDoubleArray::New();
251 offsetNormalsArray->SetName(this->OffsetNormalsArrayName);
252 offsetNormalsArray->SetNumberOfComponents(3);
253 offsetNormalsArray->SetNumberOfTuples(input->GetNumberOfPoints());
254
255 // For each branch in the reference group, compute nearest point. Get abscissa and normal at that point.
256 // Compute abscissa offset and normal offset rotation.
257 // Apply abscissa offset and normal offset rotation to each branch in the centerline.
258
259 vtkvmtkPolyBallLine* tube = vtkvmtkPolyBallLine::New();
260 tube->SetInput(input);
262
263 vtkIdList* tubeInputCellIds = vtkIdList::New();
264
265 double referenceSystemOrigin[3], referenceSystemNormal[3];
266
267 if (this->ReferenceGroupId == -1)
268 {
269 this->ReferenceGroupId = static_cast<int>(referenceSystemsGroupIdsArray->GetComponent(0,0));
270 }
271
273
274 if (referenceSystemPointId == -1)
275 {
276 vtkErrorMacro(<<"Invalid ReferenceGroupId");
277 return 1;
278 }
279
280 this->ReferenceSystems->GetPoint(referenceSystemPointId,referenceSystemOrigin);
281 referenceSystemsNormalArray->GetTuple(referenceSystemPointId,referenceSystemNormal);
282
283 vtkIdList* groupCellIds = vtkIdList::New();
285 for (int i=0; i<groupCellIds->GetNumberOfIds(); i++)
286 {
287 vtkIdType currentCellId = groupCellIds->GetId(i);
288
289 vtkIdType centerlineId = static_cast<int>(centerlineIdsArray->GetComponent(currentCellId,0));
290 tubeInputCellIds->Initialize();
291 tubeInputCellIds->InsertNextId(currentCellId);
292 tube->SetInputCellIds(tubeInputCellIds);
293
294 tube->EvaluateFunction(referenceSystemOrigin);
295
296 vtkIdType cellId = tube->GetLastPolyBallCellId();
297 vtkIdType subId = tube->GetLastPolyBallCellSubId();
298 double pcoord = tube->GetLastPolyBallCellPCoord();
299
300 double abscissa = 0.0;
301 vtkvmtkCenterlineUtilities::InterpolateTuple1(input,this->AbscissasArrayName,cellId,subId,pcoord,abscissa);
302 double abscissaOffset = - abscissa;
303
304 double normal[3];
305 vtkvmtkCenterlineUtilities::InterpolateTuple3(input,this->NormalsArrayName,cellId,subId,pcoord,normal);
306 vtkMath::Normalize(normal);
307
308 double point0[3], point1[3], tangent[3];
309 input->GetCell(cellId)->GetPoints()->GetPoint(subId,point0);
310 input->GetCell(cellId)->GetPoints()->GetPoint(subId+1,point1);
311 tangent[0] = point1[0] - point0[0];
312 tangent[1] = point1[1] - point0[1];
313 tangent[2] = point1[2] - point0[2];
314 double normalDot = vtkMath::Dot(tangent,normal);
315 tangent[0] -= normalDot * normal[0];
316 tangent[1] -= normalDot * normal[1];
317 tangent[2] -= normalDot * normal[2];
318 vtkMath::Normalize(tangent);
319
320 double dot = vtkMath::Dot(tangent,referenceSystemNormal);
321 double projectedReferenceSystemNormal[3];
322 projectedReferenceSystemNormal[0] = referenceSystemNormal[0] - dot * tangent[0];
323 projectedReferenceSystemNormal[1] = referenceSystemNormal[1] - dot * tangent[1];
324 projectedReferenceSystemNormal[2] = referenceSystemNormal[2] - dot * tangent[2];
325 vtkMath::Normalize(projectedReferenceSystemNormal);
326
327 double angle = vtkvmtkMath::AngleBetweenNormals(normal,projectedReferenceSystemNormal);
328
329 double cross[3];
330 vtkMath::Cross(projectedReferenceSystemNormal,normal,cross);
331 double tangentDot = vtkMath::Dot(tangent,cross);
332
333 if (tangentDot < 0.0)
334 {
335 angle *= -1.0;
336 }
337
338 double angleOffset = -angle;
339
340 vtkIdList* centerlineCellIds = vtkIdList::New();
341 vtkvmtkCenterlineUtilities::GetCenterlineCellIds(input,this->CenterlineIdsArrayName,centerlineId,centerlineCellIds);
342 for (int j=0; j<centerlineCellIds->GetNumberOfIds(); j++)
343 {
344 vtkCell* branchCell = input->GetCell(centerlineCellIds->GetId(j));
345 int numberOfBranchPoints = branchCell->GetNumberOfPoints();
346 for (int k=0; k<numberOfBranchPoints; k++)
347 {
348 vtkIdType branchPointId = branchCell->GetPointId(k);
349 double branchPointAbscissa = abscissasArray->GetComponent(branchPointId,0);
350 double offsetBranchPointAbscissa = branchPointAbscissa + abscissaOffset;
351 offsetAbscissasArray->SetComponent(branchPointId,0,offsetBranchPointAbscissa);
352
353 double branchPointNormal[3];
354 normalsArray->GetTuple(branchPointId,branchPointNormal);
355 double branchPoint[3];
356 branchCell->GetPoints()->GetPoint(k,branchPoint);
357 double branchTangent[3];
358 branchTangent[0] = branchTangent[1] = branchTangent[2] = 0.0;
359 if (k > 0)
360 {
361 double branchPoint0[3];
362 branchCell->GetPoints()->GetPoint(k-1,branchPoint0);
363 branchTangent[0] += branchPoint[0] - branchPoint0[0];
364 branchTangent[1] += branchPoint[1] - branchPoint0[1];
365 branchTangent[2] += branchPoint[2] - branchPoint0[2];
366 }
367 if (k < numberOfBranchPoints-1)
368 {
369 double branchPoint1[3];
370 branchCell->GetPoints()->GetPoint(k+1,branchPoint1);
371 branchTangent[0] += branchPoint1[0] - branchPoint[0];
372 branchTangent[1] += branchPoint1[1] - branchPoint[1];
373 branchTangent[2] += branchPoint1[2] - branchPoint[2];
374 }
375 double branchNormalDot = vtkMath::Dot(branchTangent,branchPointNormal);
376 branchTangent[0] -= branchNormalDot * branchPointNormal[0];
377 branchTangent[1] -= branchNormalDot * branchPointNormal[1];
378 branchTangent[2] -= branchNormalDot * branchPointNormal[2];
379 vtkMath::Normalize(branchTangent);
380
381 vtkTransform* transform = vtkTransform::New();
382 transform->RotateWXYZ(angleOffset/vtkMath::Pi()*180.0,branchTangent);
383
384 double offsetBranchPointNormal[3];
385 transform->TransformNormal(branchPointNormal,offsetBranchPointNormal);
386 offsetNormalsArray->SetTuple(branchPointId,offsetBranchPointNormal);
387
388 transform->Delete();
389 }
390 }
391 centerlineCellIds->Delete();
392 }
393
394 groupCellIds->Delete();
395
396 output->GetPointData()->AddArray(offsetAbscissasArray);
397 output->GetPointData()->AddArray(offsetNormalsArray);
398
399 offsetAbscissasArray->Delete();
400 offsetNormalsArray->Delete();
401 tube->Delete();
402 tubeInputCellIds->Delete();
403
404 return 1;
405}
static void GetCenterlineCellIds(vtkPolyData *centerlines, const char *centerlineIdsArrayName, vtkIdType centerlineId, vtkIdList *centerlineCellIds)
static void GetGroupCellIds(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 void InterpolateTuple3(vtkPolyData *centerlines, const char *arrayName, int cellId, int subId, double pcoord, double interpolatedTuple3[3])
static double AngleBetweenNormals(double normal0[3], double normal1[3])
virtual double GetLastPolyBallCellPCoord()
virtual void SetInput(vtkPolyData *)
virtual void SetInputCellIds(vtkIdList *)
virtual vtkIdType GetLastPolyBallCellId()
static vtkvmtkPolyBallLine * New()
double EvaluateFunction(double x[3]) override
virtual vtkIdType GetLastPolyBallCellSubId()
virtual void UseRadiusInformationOff()
static vtkIdType GetReferenceSystemPointId(vtkPolyData *referenceSystems, const char *groupIdsArrayName, vtkIdType groupId)

Member Data Documentation

◆ OffsetAbscissasArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::OffsetAbscissasArrayName
protected

◆ OffsetNormalsArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::OffsetNormalsArrayName
protected

◆ AbscissasArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::AbscissasArrayName
protected

◆ NormalsArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::NormalsArrayName
protected

◆ GroupIdsArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::GroupIdsArrayName
protected

◆ CenterlineIdsArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::CenterlineIdsArrayName
protected

◆ ReferenceSystems

vtkPolyData* vtkvmtkCenterlineReferenceSystemAttributesOffset::ReferenceSystems
protected

◆ ReferenceSystemsNormalArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::ReferenceSystemsNormalArrayName
protected

◆ ReferenceSystemsGroupIdsArrayName

char* vtkvmtkCenterlineReferenceSystemAttributesOffset::ReferenceSystemsGroupIdsArrayName
protected

◆ ReferenceGroupId

int vtkvmtkCenterlineReferenceSystemAttributesOffset::ReferenceGroupId
protected

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