Hi. I am trying to use vtkThreshold to extract cells from a polydata set. I would like the threshold to be based on the cell label (from the data array of cells) instead of on the point labels. I have tried the following:
def threshold(polydata, thresh_low:int, thresh_high:int):
threshold_filter = vtk.vtkThreshold()
threshold_filter.SetInputData(polydata)
threshold_filter.SetInputArrayToProcess(0, 0, 0, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, 'scalars')
threshold_filter.SetUpperThreshold(thresh_high)
threshold_filter.SetLowerThreshold(thresh_low)
threshold_filter.Update()
unstructured_grid = threshold_filter.GetOutput()
geometry_filter = vtk.vtkGeometryFilter()
geometry_filter.SetInputData(unstructured_grid)
geometry_filter.Update()
poly_select = geometry_filter.GetOutput()
return poly_select
but the thresholding was still placed on the point data array.
I also tried SetAttributeModeToUseCellData(), but the function seems to be deprecated in vtk 9.2.
Any comment would be helpful!