从 Binary Mask (Segmentation) 获取 .stl 格式的 3D 网格

Get .stl format 3D mesh from Binary Mask (Segmentation)

我目前可以获取 these formats however I would like to save the mesh file as .stl. I found documentation about this STL MeshIO Class 的网格文件,但是,我似乎无法找到 header 到 "include"。 此外,如果我遵循 this,它仍然要求我输入正确的文件扩展名,因为当我提供 .stl 扩展名时它不起作用。

任何帮助或解决方法?

P.S。 ITK-4.11.0,VS 13 更新 5,CMake - 3.8.0。 如果您需要代码,请告诉我,我在这里没有看到要求。

IOSTL 是一个远程模块。使用CMake配置ITK时,需要在组Module中启用Module_IOSTL。重建 ITK,重建你的程序,现在你应该能够像 .vtk.off 等一样读写 .stl。希望没有任何代码更改。

只是为可能感兴趣的人在此处添加程序。

  1. 获得git executable
  2. 在 CMake 中转到高级并将路径添加到 git 可执行文件
  3. 在模块中,添加 Module_IOSTL
  4. 配置和生成。
  5. 构建 ITK.sln 文件。 (如果使用 VS)
  6. 配置并生成您的项目。
  7. 添加#include "itkSTLMeshIOFactory.h"
  8. 在初始化 MeshType 之前添加 itk::STLMeshIOFactory::RegisterOneFactory();
  9. MeshFileWriter 的文件扩展名为 .stl,瞧!