[vtkusers] vtkMultiThreshold Filter crashing on polyhedral cells

Santosh Biradar scbiradar at gmail.com
Mon Mar 26 23:26:00 EDT 2018


Hi VTKers,

I am trying to use the vtkMultiThreshold filter to threshold my data by
different quantities.
However, the filter seems to crash when the thresholded data contains
polyhedral cells.
If my thresholded data does not contain polyhedral cells the filter works
correctly.

Here is a Python code snippet where I am just trying to extract the cells
which belong to the internal mesh (this contains polyhedral cells):

reader = vtk.vtkXMLUnstructuredGridReader()

reader.SetFileName(r"\path\to\mesh")

reader.Update()

ugrid = reader.GetOutput()

# Setup the multithreshold filter

mthreshold = vtk.vtkMultiThreshold()

mthreshold.SetInputData(ugrid);

components_2to7 =
mthreshold.AddIntervalSet(2,7,vtk.vtkMultiThreshold.CLOSED,vtk.vtkMultiThreshold.CLOSED,
vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, "component", 0, 0) # This
works as the mesh does not have polyhedral cells in these regions

component_1 = mthreshold.AddIntervalSet(1,1,vtk.vtkMultiThreshold.CLOSED,vtk.vtkMultiThreshold.CLOSED,
vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, "component", 0, 0) # This
FAILS as the mesh has polyhedral cells in this region
mthreshold.OutputSet(bgroup_cells_0)

mthreshold.Update(); #Crashes at this point for component_1 thresholding

multhithresholdedPolydata = mthreshold.GetOutput();

I'm wondering if it this is a bug in the filter.

If I just use the vtkThreshold filter it works and I am able to
extract the region containing the polyhedral cells

I am running VTK-6.3.0 on Windows

Thanks,

Santosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180327/30a20cf3/attachment.html>


More information about the vtkusers mailing list