Several 2D images to 3D

I have several 2D images (100 slices), and want to convert these slices to a 3D image with python.
please guide me…
Thanks.

Hi @bogovicj,
please guide me if it is possible.

1 Like

Welcome to the forum @mohsenkondori,

Will numpy.stack do what you need? If not, please try to be as specific as possible about what you’d like to accomplish / what you’ve tried already. The more detail you provide, the more likely you are to get the answer you need.

John

Dear @bogovicj,
I think it’s a volume rendering task with several slices.

3d image means w x h x z, 3d array.
render has 2 types: mesh, or volume render.

what do you want?

Hi dear
volume render is my goal.
thanks

please see mayavi, vtk, vispy.

Hi @mohsenkondori ! There are two steps to convert your stack of 2D images to a 3-D volume rendering visualization.

  • First, you need to create a 3d numerical array from the image files. For this you can use skimage.io.imread_collection, for example
from skimage import io
im_collection = io.imread_collection('*.tiff')
im_3d = im_collection.concatenate()
2 Likes