# Generate 2d image from image3d object

I have created a image3d from which I have rotated it to create a rotating view of the object. I want to be able to render each 'frame' to a 2d image so that I can export the frame sequence to create a video using Export. Can anyone help me please?

Alan

• Take a look at Rasterize
– paw
Feb 25, 2015 at 22:15
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Feb 25, 2015 at 22:20
• Would you please include an example of the code you are using to rotate the Image3D? Feb 25, 2015 at 23:45

You can use Rasterize[plot,"Image"] on each frame as paw suggested.

img = Image3D[RandomReal[1, {5, 10, 10}]]

imageList =
Most@ParallelTable[
Rasterize[
Image3D[img,
ViewPoint -> {2.5 Cos[θ], 2.5 Sin[θ], 2},
ViewAngle -> 30 Degree], "Image"], {θ, 0, 2 Pi, 0.01 Pi}];
ListAnimate[imageList]

Export["animation.avi", imageList];
Export["animation.gif", imageList];


However, Export already handles animations natively! (Although not for .gif sadly.)

animation =
Animate[Image3D[img,
ViewPoint -> {2.5 Cos[θ], 2.5 Sin[θ], 2},
ViewAngle -> 30 Degree], {θ, 0, 2 Pi}]

Export["animation.avi", animation];

• Thank you, the above code is exactly what I was after, I had been playing with Rasterize, but I hadn't quite hit the mark. Feb 26, 2015 at 13:00