How to change the background with a picture in 3d window?

Operating system:win 7
Slicer version:4.8
Expected behavior:
Actual behavior:

You can load an image and show it in a slice plane. For easy positioning of the image, install SlicerIGT extension and use Volume Reslicile Driver module (apply a transform to the image and use the image as driver for a slice view in transverse mode).

About the background of the 3D view,how to change the color or replace the background with a picture?

See my answers above.

If you are thinking about changing the background color so that you can remove that color and replace it with an image, then there is a much simpler way: you can save the view content with transparent background. See “Capture 3D view into PNG file with transparent background” example in the script repository.

Thanks a lot!
Maybe I have not show my thought definitely. The color of the background in the 3D view include light blue,white and black,if I want to change the color to red or repalce it with another picture arbitriraly,what can i do without any familiarity with Python .
Best wishes!
doc-xie

You can change the background to red using this code snippet:

https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Change_3D_view_background_color

Thanks,I got it like this!

I changed the background to Red, however,it return when click the 3d tool . Can I keep the changing?

The example in the script repository was only intended for temporary change of the background color. For changing it persistently, use SetBackgroundColor methods of the view node - see the updated example in script repository.

1 Like