BVTKNodes - photorealistic rendering of VTK data in Blender

@Blezek if you manage to set up some nice volume renderings would you mind posting a few examples here?

Hi, here’s my quick test using Cycles (path tracing engine). Looks like volume also adsorbs light from light source nicely. Material and render settings have a large effect on results. Quite interesting. :slight_smile:

1 Like

nice work Tuomo

These examples are still not at the level what VTK’s plain volume raycast mapper can do.

For example, VTK can currently render a cardiac CT (CTA-cardio.nrrd) like this:

But instead we would like to see rendering with more realistic shadows and material appearance, like this (source: Siemens Healthcare):

It would be of course highly desirable if VTK could render such images directly, but in same cases it would be acceptable to export the scene to an external software, such as Blender, for photorealistic rendering or creating animations (with complex camera motion, lighting, etc.).

I’ll try to find time to experiment in Blender, but in the meantime it would be nice to see if anybody can make Blender render volumes with quality that surpasses VTK’s raycaster and approaches photorealistic rendering offered in commercial medical imaging software.

Hi,

OK here’s a more elaborate render. The trick is how to adjust color and opacities profile. Used 150 samples + denoising.

For more massive sciviz examples with Blender, see also this presentation: https://www.youtube.com/watch?v=eiRO6vqZRUA

PS. Since Cycles is also a stand-alone render engine, you could theoretically incorporate it into VTK/Paraview. That might require some serious work, though, I’m guessing.

BR,
Tuomo

Thank you Andras for the interesting challenge and for providing the sample data ( is this data free ? can I reuse it ? ).
Here follows the best result I achieved using your data and Paraview, probably it is possibile to do better but my knowledge of Paraview is limited


The next Image is my best result using volume rendering on Blender, with a very simple light setup
CTA-blender_01
This is the shader-network I used

and this is the same, with some tweaking from a friend of mine (thanks Daniele).

Here is the Blender file and the data converted in openvdb

My personal conclusions:

  • Matching the quality of the CTA-cardio-cinematic was not possible, but that image was created from a dataset of an higher quality (see for example the details on the surface of the bones ).
  • Using Paraview you can reach a very good level of quality in short time, even with a limited knowledge of the tool.
  • Using Blender you can probably go further, but you need a knowledge of the tool and is time consuming.

Beyond the challenge, we presented here VtkNodes not to compete against the Kitware tools, but to let you know that Blender and Vtk can play together nicely. 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. Using VtkNodes you can import your data in Blender, transform it in a blender mesh, use any of the tools provided, re-convert the data to VTK and export it, and all of this using only free applications and addons.

– Silvano

2 Likes

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