Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

After importing a 3D image of STL format, my possibilities in regard to "3D Volumetric Image Processing" seems rather limited. All examples are given with TIFF files. Is there a way to convert from STL to TIFF or work with STL image in some other way?

share|improve this question
up vote 5 down vote accepted

Here is something quick and dirty to convert from a Graphics3D to Image3D (the second argument is sort of a quality knob, the higher the number the more slices are taken):

img3Dify[gr3d_Graphics3D, qu_] := Module[{pr, br, slices},
  pr = PlotRange /. AbsoluteOptions[gr3d, PlotRange];
  br = Map[Norm@Differences[#] &, pr]; 
  slices = ParallelMap[
    Image[Show[gr3d, ViewPoint -> Top, 
       Lighting -> {{"Ambient", White}}, Background -> None, 
       PlotRange -> {pr[[1]], pr[[2]], #}]] &, 
    Partition[FindDivisions[pr[[3]], qu*2], 2, 1]];
  Image3D[slices, BoxRatios -> br, ColorFunction -> Hue]]

on an example image

spikey = Import["ExampleData/spikey.stl"]

enter image description here

img3Dify[spikey, 40]

enter image description here

share|improve this answer
Thank you! That was actually just what I needed…! – Simon Jan 21 '14 at 17:15

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.