Light direction in volume rendering


Is there a way to change the direction of the light source within 3D slicer. I found the material properties options, but in order to create illustration with the same lightning, it may me helpfull for me to be able to define the direction of the light.

Yes, you can access the renderer and set up the lights however you want via the python interface as shown below.

>>> v =
>>> v.renderWindow()
>>> v.renderWindow().GetRenderers().GetItemAsObject(0)
>>> v.renderWindow().GetRenderers().GetItemAsObject(0)
>>> v.renderWindow().GetRenderers().GetItemAsObject(0).GetLights()
>>> v.renderWindow().GetRenderers().GetItemAsObject(0).GetLights().GetItemAsObject(0).SetColor([1,0,0])

Thank you for your answer.
As a non coder; I wont invest the time to use it.
But thank you.

I’ve added a module that you can use to customize lighting without Python scripting. See details here: New module to customize lighting in 3D view

1 Like

Good evening Mr Lasso;

Thank you for your answer anf for this new development.

This is simply great. I did not think that I would ever see this in 3D slicer.
You make me want to learn more about the program every time.

Kind regards,


Le mer. 16 oct. 2019 à 22:35, Andras Lasso via 3D Slicer Community a écrit :

1 Like