Hi Roger,
This patch adds Python wrapping for TriangleMeshToBinaryImageFilter
:
https://github.com/InsightSoftwareConsortium/ITK/pull/516
Since you are interested in STL files, it is worth noting that Python packages for ITKIOMeshSTL were recently released. Install with:
python -m pip install itk-iomeshstl
Then, read a mesh file, e.g.:
import itk
MeshType = itk.Mesh[itk.F, 3]
reader = itk.MeshFileReader[MeshType].New()
meshIO = itk.STLMeshIO.New()
reader.SetMeshIO(meshIO)
reader.SetFileName("/path/to/mymesh.stl")
reader.Update()
mesh = reader.GetOutput()