# Import VDB File into 3D Slicer

**URL:** <https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823>\
**Category:** Feature requests\
**Created:** [July 27, 2023, 12:19am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823 "2023-07-27T00:19:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![domdow](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@domdow](https://discourse.slicer.org/u/domdow)\
**Post date:** [July 27, 2023, 12:19am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/1 "2023-07-27T00:19:56Z")

</div>

Hello,

I am looking to import a .VDB file into 3D Slicer. When I try importing I receive a error notification:

" Error occurred while loading the selected files. Click ‘Show details’ button and check the application log for more information."

The error log:  
Loading /user/desktop/test\_01.vdb - load failed

Can you please help me understand how load a VDB into 3D Slicer?

Thank you,

Dom

---

<div class="post-metadata">

**Author:** ![tsehrhardt](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tsehrhardt/32/18470_2.png) [@tsehrhardt](https://discourse.slicer.org/u/tsehrhardt)\
**Post date:** [July 27, 2023, 1:38pm UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/2 "2023-07-27T13:38:19Z")

</div>

You can load a vdb into Paraview or Blender.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 30, 2023, 12:05pm UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/3 "2023-07-30T12:05:49Z")

</div>

OpenVDB reader/writer is available in VTK, so we could expose it in Slicer with not too much work. Or, we could wait for ITK to support and then we could enable support for it by modifying only 1-2 liines (as we already use ITK for reading/writing most image types).

Integration will happen faster if there is confirmed interest in this by the community (or somebody contributes with development work or specific funding) . I’ll change the category of this topic to “feature request” to allow people to vote on it.

As @tsehrhardt wrote above, ParaView can already read vdb files, so until Slicer has direct support, you can read the vdb file for n ParaView and save as vti, mha, nrrd image file that Slicer can read.

---

<div class="post-metadata">

**Author:** ![domdow](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@domdow](https://discourse.slicer.org/u/domdow)\
**Post date:** [August 1, 2023, 1:27am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/4 "2023-08-01T01:27:07Z")

</div>

Thanks Andras,

What would it take to add it to 3D Slicer?

You mentioned VTK are you referring to the [GitHub - Slicer/vtkAddon: General-purpose features that may be integrated into VTK library in the future.](http://GitHub.com/Slicer/vtkAddon) you created? Or another piece of software?

And what is ITK I am not familiar?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 1, 2023, 2:52am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/5 "2023-08-01T02:52:54Z")

</div>

I was referring to the VDB reader and writer in VTK:

- [https://vtk.org/doc/nightly/html/classvtkOpenVDBReader.html](https://vtk.org/doc/nightly/html/classvtkOpenVDBReader.html)
- [VTK: vtkOpenVDBWriter Class Reference](https://vtk.org/doc/nightly/html/classvtkOpenVDBWriter.html)

It is not enabled by default (and not enabled in Slicer build of VTK either) because it requires the [OpenVDB library](https://github.com/AcademySoftwareFoundation/openvdb). OpenVDB uses permissive license, so integrating it should not be an issue.

> What would it take to add it to 3D Slicer?

- Add a VDB CMake option to Slicer (`Slicer_BUILD_VDB_SUPPORT` or something similar)
- Add OpenVDB as a dependency to the Slicer build (similarly to rapidjson, teem, zlib, sqlite, …), enabled when `Slicer_BUILD_VDB_SUPPORT` is enabled
- Update Slicer’s VTK build to enable `VTK_MODULE_ENABLE_VTK_IOOpenVDB` when `Slicer_BUILD_VDB_SUPPORT` is enabled
- Add VTK’s VDB reader/writer to `vtkMRMLVolumeArchetypeStorageNode`, similarly to `vtkTeemReader`

---

<div class="post-metadata">

**Author:** ![domdow](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@domdow](https://discourse.slicer.org/u/domdow)\
**Post date:** [August 14, 2023, 4:34am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/6 "2023-08-14T04:34:57Z")

</div>

Hi Andras,

As I am industrial designer adding an OpenVBD library into Slicer seems a little out of my depth.

Would you know how I could go about this? Or someone I could work with to add this feature?

Thanks,

Dom

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 14, 2023, 6:41am UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/7 "2023-08-14T06:41:31Z")

</div>

If it is urgent for you then you can ask a friend (who has some C++ programming experience) or hire Kitware or other Slicer commercial partner company, or just wait for someone else to implement it. In the meantime, you can convert manually to nifti or nrrd format in ParaView or other software.

---

<div class="post-metadata">

**Author:** ![tsehrhardt](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tsehrhardt/32/18470_2.png) [@tsehrhardt](https://discourse.slicer.org/u/tsehrhardt)\
**Post date:** [August 29, 2023, 1:37pm UTC](https://discourse.slicer.org/t/import-vdb-file-into-3d-slicer/30823/8 "2023-08-29T13:37:27Z")

</div>

Would Blender or Paraview not have functions you can use for now to work with the VDB?
