<div dir="ltr">Hi VTKers,<div><br></div><div>I am trying to use the vtkMultiThreshold filter to threshold my data by different quantities.</div><div>However, the filter seems to crash when the thresholded data contains polyhedral cells. </div><div>If my thresholded data does not contain polyhedral cells the filter works correctly.</div><div><br></div><div>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):</div><div><br></div><div><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">reader = vtk.vtkXMLUnstructuredGridReader()</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">reader.SetFileName(<span style="color:rgb(0,128,0);font-weight:bold">r"\path\to\mesh"</span>)</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">reader.Update()<br></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">ugrid = reader.GetOutput()</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"># Setup the multithreshold filter</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">mthreshold = vtk.vtkMultiThreshold()</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">mthreshold.SetInputData(ugrid);</pre><pre style="background-color:rgb(255,255,255);font-family:"Courier New";font-size:9pt"><pre style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:"Courier New";font-size:9pt">components_2to7 = mthreshold.AddIntervalSet(<span style="color:rgb(0,0,255)">2</span>,<span style="color:rgb(0,0,255)">7</span>,vtk.vtkMultiThreshold.CLOSED,vtk.vtkMultiThreshold.CLOSED, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, <span style="color:rgb(0,128,0);font-weight:bold">"component"</span>, <span style="color:rgb(0,0,255)">0</span>, <span style="color:rgb(0,0,255)">0</span>) # This works as the mesh does not have polyhedral cells in these regions</pre><pre style="background-color:rgb(255,255,255);font-family:"Courier New";font-size:9pt"><pre style="font-size:9pt;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;font-family:"Courier New""><span style="color:rgb(0,0,0)">component_1 = mthreshold.AddIntervalSet(</span><font color="#0000ff">1</font><font color="#000000">,</font><font color="#0000ff">1,</font><font color="#000000">vtk.vtkMultiThreshold.CLOSED,vtk.vtkMultiThreshold.CLOSED, vtk.vtkDataObject.FIELD_ASSOCIATION_CELLS, </font><span style="color:rgb(0,128,0);font-weight:bold">"component"</span><font color="#000000">, </font><span style="color:rgb(0,0,255)">0</span><font color="#000000">, </font><span style="color:rgb(0,0,255)">0</span><font color="#000000">) </font># This FAILS as the mesh has polyhedral cells in this region<font color="#000000"><br></font>mthreshold.OutputSet(bgroup_cells_0)<font color="#000000">
</font></pre></pre></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">mthreshold.Update(); #Crashes at this point for component_1 thresholding<br></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">multhithresholdedPolydata = mthreshold.GetOutput();<br></pre>I'm wondering if it this is a bug in the filter.</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">If I just use the vtkThreshold filter it works and I am able to extract the region containing the polyhedral cells</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">I am running VTK-6.3.0 on Windows</pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">Thanks,<br></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">Santosh</pre><br></div></div>