How to export segmentation label from volume to surface mesh on the fly?

I’m trying to computes and displays surface-to-surface distance between two triangle meshes using 3DMeshMetric, which need a vtk format input. So I create one using model maker module in 3D Slicer. But it seems that model maker module generates newer version of vtk data file format which is not supported in 3DMeshMetric, I got unknown keyword error when load the vtk files. Then I try ITK-SNAP’s segmentation export, and it works well. How could I do this job with python script using SimpleITK, VTK or some other similar packages, so that I could convert many volume to vtk file needed in 3DMeshMetric?

I notice that there is a Model to Model distance module in 3D Slicer, which might be the same as 3DMeshMetric. However, I found the visualization of suface distance is more fancy with a colorbar.

Some software have problems with binary mesh files, so you can try to uncheck “Compression” option in Save dialog when exporting.

Yes, you can compute surface metrics within Slicer, too. You can show any color scheme, show color bar, etc. See some more info here.

Yeah, I have tried uncheck the ‘Compression’ option. But 3DMeshMetric complains that there are unrecognized keywords “METADATA” and “INFORMATION”. After manually delete these lines, it works.

This seems to be a bug in 3DMeshMetric. Report these errors to its developers, they should be able to fix this very easily.