3d rendering of homogenous volume

Hi, I’m trying to render a uniform scalar volume in 3D using python scripting.
I managed to load the volume and visualize it in the slice viewer, but in the 3D view the volume is completely transparent.
The volume is filled with ones, hence the Scalar Range is [1,1].
I tried to use the GUI, but I cannot play with the threshold and change it.
Any suggestions?
Thanks for your help,

Operating system: mac os and linux
Slicer version: 4.10

Hi -

If the volume is truly all ones then what do you expect to see when you volume render it?

Hi, I “expect” to see a uniform box (maybe white) against the dark background.
The volume represents a tank of water through which charged particle are transported and deposit their energy. Such a water box is used in radiation therapy to verify a treatment plan prior to delivery to the patient. So the treatment plan is the same, but the patient CT scan is replaced with water.
The dose map and the density map look like this in the Slice view.

Volume rendering should work well if you load this discrete volume as a labelmap volume (or convert it to a labelmap volume in Volumes module). For scalar volumes, the volume renderer seems to require boundary voxels to be transparent.

Volume rendering may be an overkill for rendering a cube (unless you need volumetric semi-transparent “fog” effect). If displaying a hollow cube is enough then you can use an ROI box or you can create a model of a box - using SlicerIGT extension’s Create models module, or by writing a few lines of Python code (see example). You may also load your volume as a segmentation node, which can be displayed both in 2D and 3D views, too.