52{
57
59 vtkIdList* centerlineGroupCellIds = vtkIdList::New();
60
65 {
67 }
68
69 double averageAbscissa = 0.0;
70 double weightSum = 0.0;
71
72 int numberOfCenterlineCells = this->
Centerlines->GetNumberOfCells();
73 for (int i=0; i<numberOfCenterlineCells; i++)
74 {
75 int centerlineGroupId = static_cast<int>(centerlineGroupIdsArray->GetComponent(i,0));
76 if (centerlineGroupId != groupId)
77 {
78 continue;
79 }
80
81 centerlineGroupCellIds->Initialize();
82 centerlineGroupCellIds->InsertNextId(i);
83
85 {
86 int centerlineId = static_cast<int>(centerlineIdsArray->GetComponent(i,0));
87 int centerlineTractId = static_cast<int>(centerlineTractIdsArray->GetComponent(i,0));
88
89 for (int j=0; j<numberOfCenterlineCells; j++)
90 {
91 if (j==i)
92 {
93 continue;
94 }
95
96 int adjacentCenterlineGroupId = static_cast<int>(centerlineGroupIdsArray->GetComponent(j,0));
97 int adjacentCenterlineId = static_cast<int>(centerlineIdsArray->GetComponent(j,0));
98 int adjacentCenterlineTractId = static_cast<int>(centerlineTractIdsArray->GetComponent(j,0));
99 int adjacentBlanking = static_cast<int>(blankingArray->GetComponent(j,0));
100
101 if (adjacentBlanking == 0)
102 {
103 continue;
104 }
105
106 if (adjacentCenterlineGroupId == centerlineGroupId)
107 {
108 continue;
109 }
110
111 if (adjacentCenterlineId != centerlineId)
112 {
113 continue;
114 }
115
116 if (!((adjacentCenterlineTractId == centerlineTractId - 1) ||
117 (adjacentCenterlineTractId == centerlineTractId + 1)))
118 {
119 continue;
120 }
121
122 centerlineGroupCellIds->InsertNextId(j);
123 }
124 }
125
127
131 double radius = 0.0;
133 double weight = radius * radius;
134 double abscissa = 0.0;
136
137 averageAbscissa += weight * abscissa;
138
139 weightSum += weight;
140 }
141
142 averageAbscissa /= weightSum;
143
144 metricArray->SetComponent(pointId,0,averageAbscissa);
145
146 centerlineGroupCellIds->Delete();
147 tube->Delete();
148}
static void InterpolateTuple1(vtkPolyData *centerlines, const char *arrayName, int cellId, int subId, double pcoord, double &interpolatedTuple1)
virtual double GetLastPolyBallCellPCoord()
virtual void SetInput(vtkPolyData *)
virtual void SetPolyBallRadiusArrayName(const char *)
virtual void SetInputCellIds(vtkIdList *)
virtual void SetUseRadiusInformation(int)
virtual vtkIdType GetLastPolyBallCellId()
static vtkvmtkPolyBallLine * New()
double EvaluateFunction(double x[3]) override
virtual vtkIdType GetLastPolyBallCellSubId()
char * CenterlineIdsArrayName
vtkPolyData * Centerlines
char * CenterlineGroupIdsArrayName
char * CenterlineTractIdsArrayName