<div dir="ltr"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">I just read  question regard finite element mesh, I face the same problem I created 3D bone of skull from 2d slices (CT)<br>
I wanted to create mesh and I used the following code , but it always throw a bug of vtkidtypearray.. can&#39;t allocate ...  what shall I do:<br><br>voxeldata is the output of the render winow<br><br>ren1 = gcnew vtk::vtkRenderer();<br>
                       renwM = r;<br>                       renwM::AddRenderer(ren1);<br>                       iren::SetRenderWindow(renwM);<br><br><br>          vtk::vtkMarchingCubes ^mcubes = gcnew vtk::vtkMarchingCubes();<br>
               mcubes-&gt;GetOutput()-&gt;ReleaseDataFlagOff();<br>               mcubes-&gt;SetInput(VoxelData);<br>               mcubes-&gt;SetValue(0, 4);<br>               mcubes-&gt;ComputeGradientsOn();<br>               mcubes-&gt;Update();<br>
<br>               vtk::vtkSmoothPolyDataFilter ^smoother = gcnew vtk::vtkSmoothPolyDataFilter();<br>               smoother-&gt;GetOutput()-&gt;ReleaseDataFlagOff();<br>               smoother-&gt;SetInput(mcubes-&gt;GetOutput());<br>
               smoother-&gt;SetNumberOfIterations(5);<br>               smoother-&gt;SetRelaxationFactor(0.70);<br>               smoother-&gt;SetFeatureAngle(70);<br>               smoother-&gt;FeatureEdgeSmoothingOn();<br>
               smoother-&gt;BoundarySmoothingOn();<br>               smoother-&gt;Update();<br><br>               vtk::vtkPolyDataNormals ^normals = gcnew vtk::vtkPolyDataNormals();<br>               normals-&gt;GetOutput()-&gt;ReleaseDataFlagOff();<br>
               normals-&gt;SetInput(smoother-&gt;GetOutput());<br>               normals-&gt;SetFeatureAngle(80);<br>               normals-&gt;Update();<br><br>//        vtk.vtkStripper stripper = new vtk.vtkStripper();<br>
//        stripper.SetInput(normals.GetOutput());<br>//        stripper.GetOutput().ReleaseDataFlagOff();<br>//        stripper.Update();<br><br>               vtk::vtkDelaunay3D ^delaunay4 = gcnew vtkDelaunay3D();<br>               delaunay4-&gt;SetInputConnection(normals-&gt;GetOutputPort());<br>
<br>                       vtkDataSetMapper ^mapper = gcnew vtk::vtkDataSetMapper();<br>                       mapper-&gt;SetInputConnection(delaunay4-&gt;GetOutputPort());<br>                       vtkActor ^actor = gcnew vtk::vtkActor();<br>
                       actor-&gt;SetMapper(mapper);<br>                       actor-&gt;GetProperty()-&gt;SetRepresentationToWireframe();<br><br>                       ren1::AddActor(actor);<br>                       renwM::Render();<br>
                       iren-&gt;Initialize();<br>                       iren::Enable();<br></span></div>