<div dir="ltr">Hi all!<div>I am trying to use the simplexDeformableModel filter and instead of using the itk regular sphere mesh, I would like to use an initial mesh generated by a &#39;vtkVoxelContoursToSurfaceFilter&#39;  so that the initial shape is closer to the original shape.</div>
<div><br></div><div>However, when I generate a surface mesh using &#39;vtkVoxelContoursToSurfaceFilter&#39; -&gt; vtkPolyDataToitkMesh -&gt;TriangleMeshToSimplexMeshFilter   it would crash when I run it while creating cells in the Triangle2simplex mesh filter.</div>
<div><br></div><div>So I did a simple test doing, regularspheremesh -&gt; triangle2simplexmesh-&gt;simplex2trianglemesh-&gt;triangle2simplexmesh</div><div><br></div><div>and it would crash at the second triangle2simplexmesh filter. Am I doing something wrong?</div>
<div><br></div><div>Thank you all!</div><div><br></div><div><br></div><div><div><span class="" style="white-space:pre">        </span>// Some type defs</div><div><span class="" style="white-space:pre">        </span>typedef itk::DefaultDynamicMeshTraits&lt;double, 3, 3,double,double&gt; TriangleMeshTraits;</div>
<div><span class="" style="white-space:pre">        </span>typedef itk::DefaultDynamicMeshTraits&lt;double, 3, 3,double,double&gt; SimplexMeshTraits;</div><div><br></div><div><span class="" style="white-space:pre">        </span>typedef itk::Mesh&lt; float, 3 &gt;   MeshType;</div>
<div><span class="" style="white-space:pre">        </span>typedef itk::Mesh&lt;double,3, TriangleMeshTraits&gt;<span class="" style="white-space:pre">                </span>TriangleMeshType;</div><div><span class="" style="white-space:pre">        </span>typedef itk::SimplexMesh&lt;double,3, SimplexMeshTraits&gt; SimplexMeshType;</div>
</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>typedef itk::RegularSphereMeshSource&lt; TriangleMeshType &gt;<span class="" style="white-space:pre">        </span>MeshSourceType;</div><div><span class="" style="white-space:pre">        </span>typedef itk::TriangleMeshToSimplexMeshFilter&lt;TriangleMeshType, SimplexMeshType&gt; SimplexFilterType;</div>
<div><span class="" style="white-space:pre">        </span>typedef itk::SimplexMeshToTriangleMeshFilter&lt;SimplexMeshType, TriangleMeshType&gt; TriangleFilterType;</div></div><div><br></div><div><span class="" style="white-space:pre">        </span>meshSource = MeshSourceType::New();<br>
</div><div><div><span class="" style="white-space:pre">        </span>meshPointType center;</div><div><span class="" style="white-space:pre">        </span>center.SetElement(0,0);<span class="" style="white-space:pre">                </span>center.SetElement(1,0);<span class="" style="white-space:pre">                </span>center.SetElement(2,0);</div>
<div><span class="" style="white-space:pre">        </span>meshSource-&gt;SetCenter( center );</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>meshPointType::ValueType radius[3] = {5,5,5};</div>
<div><span class="" style="white-space:pre">        </span>meshVectorType scale = radius;</div><div><span class="" style="white-space:pre">        </span>meshSource-&gt;SetScale( radius );</div><div><span class="" style="white-space:pre">        </span>meshSource-&gt;SetResolution( 5 );</div>
<div><span class="" style="white-space:pre">        </span>meshSource-&gt;Update();</div><div><span class="" style="white-space:pre">        </span></div><div><span class="" style="white-space:pre">        </span>meshSource-&gt;GetOutput()-&gt;Print( std::cout);</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>// Convert triangle to simple mesh</div><div><span class="" style="white-space:pre">        </span>SimplexFilterType::Pointer m_SimplexFilter = SimplexFilterType::New();</div>
<div><span class="" style="white-space:pre">        </span>m_SimplexFilter-&gt;SetInput( meshSource-&gt;GetOutput() );</div><div><span class="" style="white-space:pre">        </span>m_SimplexFilter-&gt;Update();</div><div>        // Save the Simplex mesh </div>
<div><span class="" style="white-space:pre">        SimplexMeshType::Pointer </span>m_SimplexMesh = m_SimplexFilter-&gt;GetOutput();</div><div><span class="" style="white-space:pre">        </span>m_SimplexMesh-&gt;DisconnectPipeline();</div>
<div><br></div><div><span class="" style="white-space:pre">        TriangleFilterType::Pointer </span>m_SimplexToTriangle = TriangleFilterType::New();</div><div><span class="" style="white-space:pre">        </span>m_SimplexToTriangle-&gt;SetInput(m_SimplexMesh);</div>
<div><span class="" style="white-space:pre">        </span>m_SimplexToTriangle-&gt;Update();</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>TriangleMeshType::Pointer triangleMesh = m_SimplexToTriangle-&gt;GetOutput();</div>
<div><span class="" style="white-space:pre">        </span>triangleMesh-&gt;DisconnectPipeline();</div></div><div><br></div><div><div><span class="" style="white-space:pre">        </span>// Convert triangle to simple mesh</div><div><span class="" style="white-space:pre">        </span>SimplexFilterType::Pointer<span class="" style="white-space:pre">        </span>m_SimplexFilter2 = SimplexFilterType::New();</div>
<div><span class="" style="white-space:pre">        </span>//m_SimplexFilter2-&gt;SetInput( vtk2itk.GetOutput());</div><div><span class="" style="white-space:pre">        </span>m_SimplexFilter2-&gt;SetInput( triangleMesh);</div><div><span class="" style="white-space:pre">        </span>m_SimplexFilter2-&gt;Update();</div>
</div></div></div>