New module to customize lighting in 3D view

A new experimental module, “Lights”, was added to “Sandbox” extension that allows you to change lightkit parameters with a simple GUI. See a short demo video here:

If we get the feedback that this module is useful then we’ll consider adding it to the Slicer core.

11 Likes

Really beautifull. Thank you for the share.

1 Like

This looks really cool. Thanks Andras.

1 Like

If there is interest for more photorealistic rendering then we could consider exposing additional rendering backends that VTK supports. You can already try VTK’s NVidia Optix and OSPray rendering backends in Paraview. They are very nice for rendering surface meshes with shadows and reflections. I did not have much luck with producing nice volume renderings with them.

1 Like

FYI Sandbox does not show up in the extension search, while it is listed under examples.

1 Like

I think it looks good enough to be used as is.

Couple things I would suggest when you have a chance (in terms of priority):

  1. Button to revert back to defaults (or a way to unset them).
  2. Option to save and load light settings (like volume properties).
  3. Can warmth be a color palette?
  4. I am not sure how to make use of create View functionality. I know it is something to do with Slice Controllers module, but it is not clear to me how to control different views with a single 3D render window.

But I think it is looking great, would rather see it part of core sooner than later. Thanks again.
M

2 Likes

These are good suggestions, you can submit them as issues to keep track of them.

I’m not sure what you mean. Could you please clarify?

Here are my steps:
Download MRHEad.nrrd, go to volume rendering set MR preset, switch to lights, create a new view, and set the lights such that effect should clear (e.g., very high intensity), click setup lightkit. Go back to volume rendering, expand the inputs tab, and select the newly created view as view (as oppose to view1 explicitly or all options, which is default). In my case I am getting a blank scene.

If I switch to view controllers, then I can see the new view doesn’t layout number like view1 does. Whether that matters or not I don’t know.

Download MRHEad.nrrd, go to volume rendering set MR preset

Do you enable show volume rendering?

switch to lights

Do you create lightkit, too?

create a new view

by switching to a different layout?

and set the lights such that effect should clear (e.g., very high intensity)

Do you mean just set up some lighting that looks different? With the current version of the module I cannot make the rendering look burnt in.

click setup lightkit. Go back to volume rendering, expand the inputs tab, and select the newly created view as view (as oppose to view1 explicitly or all options, which is default). In my case I am getting a blank scene.

What do you mean? The volume rendering should appear in each view that is checked in the View list.

Maybe a few screenshots should help me to understand what you do and what your question is.

This is what threw me off:
image

I thought I can create a new view, and then choose it in the Volume Rendering options, so that I can have control over when to use the lights settings (View1 for default, the newly create view for lights on rendering etc). But as far as I can tell the view created in the Lights module has no usability in volume rendering.

image

I see, the “Create new View” is just a bug, I’ve forgot to disable the “Create new” option in the node selector. Creating a new view involves much more than just creating a new view node. I’ll disable the option.

Thanks Andras. This is great

Good afternoon,

I try to use it and although I found the Sandbow extension in the exemples of the extensions and installed it; closed and restarted 3DSlicer; I still do not find the Lights module.

Did I miss a step?

1 Like

Are there any clues in the error log?

This is fabulous. We would use this a lot.

1 Like

did u manage? i have the same problem.

I think ist’s Slicers version

You mean Lights module is not available to you after installing the Sandbox extension? If so, try with the latest stable.

1 Like

This is great and many thanks for this great tool this will save lot of time when its come to taking nice photos for publication :grinning:. … reset/undo button as suggested earlier would be fabulous too.

Thank you again.

I’ve added presets to Lights button (default, ceiling, side, sunset, opera). The “default” preset can be used to reset to default. It’ll be available in the stable and preview releases tomorrow.

Feel free to suggest changes to these presets or define new ones.

Slicer Preview Release now uses VTK9, which has lots of new photorealistic rendering features. If someone has time to play with these options and come up with code snippets that set up interesting visualizations then we can integrate those into the Lights module.

1 Like