Generate binary file from MarchingCube

Hello everyone,

After generating a surface via " vtkMarchingCube " from 3d volume file, I would like to write binary format output files ( point.bin and index.bin), which mean, instead of using " vtkPolyDataWriter " to generate “*.vtk” file.

I appreciate your help.

Thank you

I don’t think VTK can write meshes in .bin file format (I’ve never even heard of this bin file format before). You can save in various other file formats (stl, ply, obj, …) instead, which most software should be able to read. If you really need these bin files then you should be able to find free mesh converter software that can generate those from stl/ply/obj.

Hi @lassoan

Thank you for your fast reply.

Yes, the *.bin isn’t for mesh file format.

As I mentioned, I’m looking for a way, to use the surface generated by vtkMarchingCubes, in order to get binary files represents the mesh, but others then vtk format.
which means instead of getting vtk

Thank you again

Would you like to save a surface mesh or a binary labelmap? In what file format?

In fact, I would like to extract point and index from surface mesh, in binary files.
so, I will not be involved with vtk writers

Thank you @lassoan

stl, ply, obj, vtk, vtp files all store point positions and point indexes (for defining cells), so you should be able to use any of these file formats. What software do you use for further processing of this exported data?

Hi @lassoan

For the software, I didn’t yet achieve this step.
but for vtk files, I use Paraview.

Thank you

ParaView can load stl, ply, obj, vtk, vtp files, so you can choose any of these formats and you’ll be able to use it in ParaView.

Thank you @lassoan for your reply :slight_smile: