# Convert data from Image3D to ListPlot3D

Let's suppose I have created a 3d image of gray scale Images with:

image3d = Image3D[Table[readImage[i], {i, numberOfImages}]];


and

image3dSlices = Image3DSlices[image3d]


To show the 3d image I can use:

image3d


or

Image3D[image3dSlices[[startImageNumber;;endImageNumber]]]


Is it somehow possible to convert the image data so that I could use ListPlot3D or ListDensityPlot3D? Please see also here:

• ListDensityPlot[ImageData@image3dSlices[[imageNumber]]] and ListPlot3D[ImageData@image3dSlices[[imageNumber]]]?
– kglr
Oct 10, 2017 at 13:10
• @kglr: Thank you. But how could I use e.g. ListPlot3D for all the images at once?
– mrz
Oct 10, 2017 at 13:20
• ListPlot3D[ImageData/@image3dSlices]?
– kglr
Oct 10, 2017 at 13:45

your linked example looks to be essentially binary. Maybe something like this is what you are after?

img = Image3D[
Table[ SparseArray[
Rule[#, 1] & /@
Round@CirclePoints[{10, 10}, (81 - (i - 10)^2)/20, 100] ,
{20,20}] // Normal, {i, 19}]] ListPointPlot3D[Position[ImageData[img], 1., {3}]] If your data isnt exactly binary maybe some threshold will work eg.

ListPointPlot3D[Position[ImageData[img], x_Real /; x > .1, {3}]]

• Thank you. I was looking for this kind of solution.
– mrz
Oct 11, 2017 at 8:33

Perhaps

slices = Image3DSlices[ExampleData@{"TestImage3D", "CTengine"}];
Row[{Show[slices[], ImageSize -> 300],
ListDensityPlot[ImageData@slices[], ImageSize -> 300],
ListPlot3D[ImageData@slices[], ImageSize -> 300]}, Spacer] • This solution is very helpful to plot the single image slices and be able to control the axes ranges (ticks). Great.
– mrz
Oct 11, 2017 at 4:25