Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have volumetric data, which I can render using CUDAVolumetricRender[]. However, I cannot seem to find a way to combine it with other 3D graphics, such as adding a bounding box, axes, labels, etc.

How is CUDAVolumetricRender[] supposed to be customized? It returns a DynamicModule, which is pretty opaque.

share|improve this question
I'm not sure it's possible. After looking at it, it seems it's only a plain 2D image that's being dynamically updated. But if you have version 9, you can use Raster3D and Image3D which easily solve the problem. – Szabolcs Apr 3 '13 at 14:11
up vote 6 down vote accepted

The problem you face here is that CUDAVolumetricRender[] does the projection onto the image plane on its own. The function I pointed out at the end of my answer to your other CUDA related question calculates this projection from the 3D data set onto the 2D image you see.

The situation is far from hopeless because Image3D in version 9 uses the same technique to render a 3D data set. In contrast to the CUDA renderer this data type can be used in combination with other Graphics3D directives. Creating a bounding box or axes is done in no time

data = Table[
   If[z == 0 && (Mod[x, 8] == 0 || Mod[y, 8] == 0) || (Abs[x] < 8 && 
       Abs[y] < 8 && -16 < z < 0), 255, 0], {z, -50, 50}, {y, -50, 
    50}, {x, -50, 50}];
img = Image3D[data, "Byte"]

Show[{img, Graphics3D[{Sphere[{10, 10, 90}, 5]}]}, Boxed -> True, Axes -> True]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.