<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>Hi Santosh,</div><div><br></div><div>The multithreshold filter was written before polyhedral cells were added to VTK and they changed the way connectivity is stored... so I am not surprised you have encountered a problem. Could you file a bug report? It would be great to have a simple polyhedral example dataset to test against, if you can provide one.</div><div><br></div><div> Thanks,</div><div> David</div><div><br>On Mar 26, 2018, at 23:26, Santosh Biradar <<a href="mailto:scbiradar@gmail.com">scbiradar@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Powered by <a href="http://www.kitware.com">www.kitware.com</a></span><br><span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></span><br><span></span><br><span>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a></span><br><span></span><br><span>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br><span><a href="https://vtk.org/mailman/listinfo/vtkusers">https://vtk.org/mailman/listinfo/vtkusers</a></span><br></div></blockquote></body></html>