@@ -34,7 +34,6 @@ vtkIdList* find_staircase_artifacts(vtkPolyData* pd, const double stack_orientat
34
34
35
35
double *ni;
36
36
vtkIdList *output = vtkIdList::New ();
37
- vtkDoubleArray *scalars = vtkDoubleArray::New ();
38
37
vtkIdList *idfaces;// idfaces = vtk.vtkIdList()
39
38
40
39
nv = pd->GetNumberOfPoints (); // Number of vertices.
@@ -71,15 +70,9 @@ vtkIdList* find_staircase_artifacts(vtkPolyData* pd, const double stack_orientat
71
70
// output
72
71
if ((abs (max_z - min_z) >= T) || (abs (max_y - min_y) >= T) || (abs (max_x - min_x) >= T)) {
73
72
output->InsertNextId (vid);
74
- scalars->InsertNextValue (1 );
75
- }
76
- else {
77
- scalars->InsertNextValue (0 );
78
73
}
79
74
idfaces->Delete ();
80
75
}
81
- vtkPointData* pointData = pd->GetPointData ();
82
- pointData->SetScalars (scalars);
83
76
return output;
84
77
}
85
78
@@ -162,7 +155,6 @@ vtkDoubleArray* calc_artifacts_weight(vtkPolyData* pd, vtkIdList* vertices_stair
162
155
int nid = vertices_staircase->GetNumberOfIds ();
163
156
vtkIdList* near_vertices;
164
157
vtkDoubleArray* weights = vtkDoubleArray::New ();
165
- vtkDataArray* scalars = pd->GetPointData ()->GetScalars ();
166
158
for (int i=0 ; i < pd->GetNumberOfPoints (); i++){
167
159
weights->InsertNextValue (0 );
168
160
}
@@ -180,14 +172,11 @@ vtkDoubleArray* calc_artifacts_weight(vtkPolyData* pd, vtkIdList* vertices_stair
180
172
value = (1.0 - d/tmax) * (1 - bmin) + bmin;
181
173
if (value > weights->GetValue (vjid)) {
182
174
weights->SetValue (vjid, value);
183
- scalars->SetTuple1 (vjid, value);
184
175
}
185
176
}
186
177
near_vertices->Delete ();
187
178
}
188
179
189
- vtkPointData* pointData = pd->GetPointData ();
190
- pointData->SetScalars (scalars);
191
180
return weights;
192
181
}
193
182
0 commit comments