BVTKNodes - photorealistic rendering of VTK data in Blender

Nice work :+1: Thank you for reporting.

Yes, that’s Slicer sample data distributed under the terms of the Slicer license.

yes – that was a cheap trick — if you are still interested, in my latest post you can find a link to another example an data

Thank you, these are very nice renderings.

Did you use OptiX renderer in Paraview? Can you share the ParaView state file?

What was the rendering time in Paraview and Blender?

The Siemens example may use slightly higher resolution image, but probably the main difference is due to that Siemens uses some automatic segmentation to distinguish bone, vasculature, tools, etc. and render them with different material properties.

Maybe a more interesting scenario for using VtkNodes is for people developing custom application requiring surface editing tools ( e.g. dental implant, ad-hoc prosthesis planning …) those tools are missing in Vtk by design, while there are a plenty of them in Blender

Implant planning is more similar to CAD design and mostly done using parametric modeling, which Blender is probably not the best tool for. Also, implant planning does not require fancy rendering, but mostly relies on measurements on slice and projection views and simple 3D rendering.

But photorealistic rendering of a few nice images of the final plan could be useful for for communication with patients, training materials, and presentations.

1 Like

Hi Andras – I used the OSPRaycaster, and this is the link the statefile, not exaclty ‘that’ statefile, but the closest I have. About rendering time it is near real time in Paraview (seconds) and about 15 minutes for Cycles. You can have real time volume rendering in Blender by using EEVEE if sacrificing some quality. But I often spend much more time in tuning the visualization than in the rendering.
About your consideration on possible usage of VtkNodes I get your point, nevertheless at each Blender Conference there are at least a couple of talk about using Blender for research pourpose, and some of them were using vtk too. Time will show :slight_smile: – thank you – Silvano

1 Like

Hi,
thanks for yours helpful advices.
I tried VTK addon for Blender and volume rendering by Silvano. Both works well and have impressive results.
The first is using openvdb data format and the second one using vti data.

But my question is, how can I work with Dicom data. I can create sequence of images, but then… Should I segment it somehow? Or use another software? How did you create vdb and and vti data?

Thank you very much for your replies.

You can stack up the dicom images to form a 3D vtkImageData and save it as a vti-file.
This can be done using a simple python script, and will allow you to inspect your data using Paraview.
Then, if you want to try the volume rendering of Blender you should convert the vti to a vdb.
I wasn’t able to setup a converter in python, but in C++ is easy enough.
You may get the source code here ( but you have to figure out how to compile it on your os )

Really nice work Tuomo and Silvano!

FYI: OSPRay’s new path traced volume rendering will soon be available in VTK and ParaView. See: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7031
I’d like to learn from you what additional controls and features we need to expose to get to that the same level of image quality in more tightly coupled VTK applications.

I am also interested to know what would be helpful regarding the OSPRay and OpenImageDenoise integration in Blender. That is probably a question for another mailing list though.

cheers!

It’s awesome that VTK’s photorealistic capabilities are being updated. However, comments in the pull request are quite concerning:

However, since OSPRay2’s raycast or “scivis” renderer is
simpler than OSPRay1’s was, we lose shadows, multiple
and colored light sources

If there are no shadows and not even multiple light sources then how is this renderer better than the standard VTK GPU volume raycast mapper?

Is there a plan to add NVidia OptiX GPU volume rendering? We would probably get faster rendering on a strong NVidia RTX card than on a small CPU cluster.

I have no idea what OptiX plans there are.

I do know that we plan to restore the missing features in OSPRay2’s raycast renderer before the ParaView 5.9 release this Fall. Until then the (mildly) interesting features of OSPRay2’s raycast renderer are better performance, some code structure/maintenance considerations, and ambient occlusion. The big idea though is the new path traced volume rendering capability.

1 Like

Sorry didn’t quite catch the question. Do you mean to ask what is needed to integrate Cycles into VTK?

Quick FYI: BLOSPRAY was presented last year: https://www.youtube.com/watch?v=y-EzJ-HDcNI&list=PLa1F2ddGya_8Wzpajwu1EtiS8E1Exm82S&t=3520s
I think OpenImageDenoise is already in Blender, not sure though.

BR,
Tuomo

Thanks for the presentation link Tuomo! Very informative.

Although, bringing Cycles into VTK* would be interesting too, my question is more what features and controls do we need to add to VTK to bridge the creative gap. Are there critical bugs, missing material light and camera features or perhaps other features that are accessible through Blender’s control networks, that people with creative backgrounds find lacking in VTK that would make things like ParaView and Slicer more capable and comfortable to use directly for higher quality visualization?

Perhaps we could take that discussion up in a new thread. I don’t want to distract from discussion of BVTKNodes (which seems great) and the interoperability route to the same end goal.

  • I suggest a good path to bring Cycles to VTK would be to build a bridge through ANARI..

@Petra – something may be wrong in your abc.vdb, can you send me the corresponding vti ? – thanks – Silvano

Very interesting question, but not easy to answer.
I think that the quality of images produced by Paraview may be improved, but I will not try to mimic the tools you can find in Max/Maya/Blender,the workflow in these packages is completely different.
I typically spend in Paraview from minutes to hours, while in Blender you can easily spend days for a still image or weeks for a short-movie.

Searching for improvement that does not slow-down the visualization activity, I can imagine a few things:

  • The PBR shaders are already a great improvement, they have fewer parameters and mostly look good. I would like to have more PBR shader preset, a carefully chosen set that make sense for SCI-VIZ
    ( bone, muscle, skin for medic … various plastic, metal, glass for engineers, … )

  • PBR shaders want the environment lighting, the way you load it now is a bit discouraging.
    I would like to have a set of beautiful environment texture built-in (see blender studiolight)

  • A nice real-time-ambient-occlusion with few parameters or none.

  • Maybe have one light (sun|spot|area), detached from the viewer, easy to manipulate to cast shadows.

  • Rim light can be faked by having some fresnel parameter in the material

  • Maybe a plane/circle where to sit your model and to receive shadows. Using backface culling so it disappears if the camera goes downside,should be created with one click, with the right place and size, considering your current models.

  • Maybe depth-of-field – if it easy to set-up

  • Also, for the usability, If I have the path-tracer on and I want to rotate my model the viewport became too slow. I would like the renderer to fallback to normal when moving the camera.

  • About animation, I will first concentrate on camera-animation only, and see if it can be made easier ( In blender I sometimes use the fly-mode to find the right camera position )

  • Last, for values readability, ScalarBars labels should use 0.5 or 1 for the mantissa. ( I don’t like to see labels like 0.333333, 0.6666666, …)

I am not an hard-core Paraview user, so please forget me if I made some mistakes, like requesting a feature that is already there.

2 Likes

Thank you for this feedback!

  • The PBR shaders are already a great improvement, they have fewer parameters and mostly look good. I would like to have more PBR shader preset, a carefully chosen set that make sense for SCI-VIZ
    ( bone, muscle, skin for medic … various plastic, metal, glass for engineers, … )

There are work in progress by @Lfx_Paul to improve PBR material to match remaining parameters of OSPRay:

  • Edge Tint (metallic color at grazing angles)
  • Anisotropy (to create materials like brushed aluminium)
  • Clear coat (simulate transparent layer on top of the main material)
  • Dielectric IOR (currently fixed at 1.5)
  • Transmission / subsurface scattering
  • PBR shaders want the environment lighting, the way you load it now is a bit discouraging.
    I would like to have a set of beautiful environment texture built-in (see blender studiolight)

Agree!

  • A nice real-time-ambient-occlusion with few parameters or none.

SSAO is already implemented in VTK but not exposed in ParaView yet.

  • Also, for the usability, If I have the path-tracer on and I want to rotate my model the viewport became too slow. I would like the renderer to fallback to normal when moving the camera.

I like this idea.

1 Like

Agreed, thanks for the feedback!

Some responses, note that all of these things are available at both the VTK and ParaView levels.

  • I agree on the need for more materials to be distributed with the ParaView binary or better yet downloadable from within the GUI. The best set I know of so far is Marston’s. One thing that has held this up is picking some industry standard material formats and moving away from my made up json format over to it. Another is extending the materials concept to volume rendering.

  • I vaguely recall that there is an implementation of AO at the VTK level for GL but I do not think it has been exposed in the ParaView GUI yet. When that happens, the GUI controls should be unified as much as possible with the Ray Tracers’ Ambient Samples parameter.

  • Regarding the detached light, see ParaView’s Views->Lights Inspector.

  • The is a ground plane “background” at the VTK level for GL. This should be doable within OSPRay as well. In the meantime you are stuck with having to manually create one with the Disk source and even then backface culling will only work with GL.

  • Depth of field is available on the Camera settings in ParaView. See Focal Disk and Focal Distance on the Adjust Camera dialog.

  • For scalar labels there is a control to set that in recent ParaViews. Settings/Preferences->General->Real Number Displayed Precision.

And no worries about the requests, documentation and GUI discoverability and usability always need work.

1 Like

FYI I have added a VTK To Blender Volume (OpenVDB) node to BVTKNodes, but unfortunately it requires a custom build of Blender. Please note the documentation.

PS. It really takes some learning and effort to produce nice volumetric renderings, here’s my current best achievements so far:

BR,
Tuomo

2 Likes

About conversion of 3D VTK image data into OpenVDB:

Since pyopenvdb is not yet part of Blender (so that it could be used directly for exporting to OpenVDB), I’m thinking about adding a node to BVTKNodes which would export plugged in data (color, density, flame and temperature fields used in the Blender Volume Info node) to text files, and then provide an external Python script which could use pyopenvdb to convert text files into OpenVDB. Please like this post if you would benefit from such a workaround.

Hi all – our latest movie made using Blender and VTK ( trough BVTKNodes )
has just won the first price in this competition https://public.nrao.edu/news/2020-image-contest-winners/ ---- you can see the video here https://vimeo.com/464248944/3fc17a5b8b.

And if you are interested, I also recommend watching these two movie made with the same technology, but in 360-degree stereo, to be watched using your cardboard. (1)
https://www.youtube.com/watch?v=3hpbEVsAZUg (2) https://www.youtube.com/watch?v=yCIW7nRt-Sk

3 Likes

FYI VTK To OpenVDB Exporter node is now available, but it requires access to external pyopenvdb!

Hello!
I see it’s been awhile for this thread/progress.
I’m hoping there’s some progress on getting this working without recompiling blender, and also for 2.9x.

I’m trying to import my VTK volumetric FEA data (e.g. stress, strain) into Blender and get it to OpenVDB for subsequent processing.
I’ve got BVTK in 2.83 up and running and can do the examples, but of course the vtk to blender volume node gives me the error of no import pyopenvdb.

I can compile blender in visual studio, but I’m pretty rusty as it’s been a couple years.

Any help at all is super greatly unbelievably appreciated, as this is critical for my work to get ‘full’ post-processing FEA capabilities into Blender…

Thanks!
Todd