Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
1  
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

1 Answer 1

up vote 5 down vote accepted
+50

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

 
discard

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.