I have a human chest data as below:-

data3D = BlockchainGet[   "ecfe5311a6b5ae164aca82b58c630e150ab93b1fd1b0c9d0b48e276e624b51c7"];
Show[Image3D[data3D], Axes -> True, AxesLabel -> {Style["z", Bold, 16], Style["y", Bold, 16], Style["x", Bold, 16]}]

enter image description here

How can I make it looks like a x-ray? For example, something similar to below:-

enter image description here

For plot, there may be something like PlotTheme -> "XRay", but it is not supported by Image3D. Or are there any other method to make to more alike a x-ray?


  • $\begingroup$ Maybe AnatomyPlot3D is something you are looking for? $\endgroup$
    – amator2357
    Apr 18 '19 at 15:47

We can use the builtin ColorFunction -> "XRay":

Image3D[data3D, ColorFunction -> "XRay", Background -> Black]

We can use custom rendering options to make the x-ray more prominent:

  Image3D[data3D, ColorFunction -> "XRay", 
    Method -> {"VolumeLighting" -> "EnhancedEdge","InterpolateValues" -> True}],
  Lighting -> {{"Ambient", White}}, 
  Background -> Black, Boxed -> False

  • $\begingroup$ Thanks. Is it possible to add the box back? I tried to add Axes -> True, AxesLabel -> {Style["z", Bold, 16], Style["y", Bold, 16], Style["x", Bold, 16]} back to Show, but then the blackground disappeared. $\endgroup$
    – H42
    Apr 18 '19 at 17:51
  • $\begingroup$ I noticed that too. I think adding Background -> Black as an option to Show will fix it. $\endgroup$
    – Chip Hurst
    Apr 18 '19 at 17:56
  • 1
    $\begingroup$ @H42 I do not think it is just a matter of color function or lighting or background. 3-D rendering is for volume data inspection and assumes some viewpoint of an observer. X-ray projection needs to assume a focal spot and a screen (film, dector array). This is quite a different geometry! $\endgroup$
    – UDB
    Apr 22 '19 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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