Turn 2d image slices into 3d model

Dear community,

i am new to 3d slicer and i have a set of image slices (2D), which are from a probe cut in 100 um steps, and i want to put these images together and do a 3d model. What steps do I need to follow to create a 3D reconstruction from 2D image slices using 3D Slicer, and how can I ensure that the final model retains the colors of the original images so that I can view it in 3D?

I saw a lot of tutorials but im still getting a wrong 3d model when im doing volume rendering. I can upload the images

I uploaded the images in case anyone wants to take a look on them

Thank you so much!!

Best regards,
Ayman

These are histology slides (I think), so if you simply uncheck the “grayscale” option in the ImageStacks module of SlicerMorph, you will get color (RGB) images. However, slides are not co-registered; i.e., the orientation of the tissue is different from one slide to the next. Hence, you will not get a good volume rendering out of these, because when stacked together they do not constitute a proper 3D ‘volume’. (see the jagged edges in green and yellow slice. If you move up and down in the red slice view, you will see the tissue rotating from one slide to the next).

You can try to register one slide to the next one and keep moving in the stack. I think ImageJ has a specific function to do that. I am not sure if there is anything in the Slicer to help you in aligning the slides (there a lots of registration tools, but they are usually for registering one 3D volume to another). Others on the forum that are more familiar with histology data can chime in.

Hey Murat,

thank you so much for your answer! I have been trying to reach the same result in your screenshot, but im still getting the sharp edges of the images in my model.

Can i ask you, did you do anything else than uploading the images and choose 0.1 mm? Did you register the images before doing the 3d model in your screenshot?

Thank you for your help, im trying to reach the same result as yours.

Best regards
Ayman

I didn’t do anything. I simply dragged one of your files into Slicer and asked it to open with ImageStacks. However, your files are not named conventionally. Normally slice sequences go something like 0001, 0002, 0003, and yours are missing leading zeros. Your operating systems may sort those files differently then mine (MacOS). Please expand the files list and see that the sequence of files is correst (ie., it goes 1,2,3,…,10,11,12,…100,101).

Imagestack relies on the ordering OS provides and we expect the files to have properly formated sequences.

Hey Murat,

thank you again, i tried now to rename the files as you said, and im still not getting the same 3d Model, it seems that the software is still taking the images in a different order because i did exactly the same as you said, do you have any other ideas why this is happening? (Screenshot)

Thank you so much!

Best regards

It is because you do not have the files named in a consistent manner (i.e your slice ordinals are sometimes 1, sometimes 2 and sometimes 3 digits), so parsing is also inconsistent.

the proper way of fixing this is adding the leading zeros so 1.tif becomes 001.

You can also try dragging one of the three digit ones into Slicer scene and see if that helps to import all 120 slices (your screenshot shows only 48 slices).

You can also click the select files button and try to select the files manually.

Also uncheck the grayscale button if you want RGB images.

Okay i added leading zeros and i chose the files manually and checked that they are in the right order and still not getting it. Do you think it is a windows issue?

Best regards
Ayman

I checked now through the 3d Model and the images are actually in the right order inside the 3d Model, but its still not looking like the one you had in your screenshot :confused:

What do you mean, apart from the arrangement of the windows, they look pretty similar to me.

Hey Murat,

im sorry from the first look, i thought that your 3d model was different and didnt have this rough transitions between the layers, my goal is to make these transitions between the layers as smooth as possible.

Thank you so much for your help!!

Best regards,
Ayman

UPDATE:

I have applied a registration algorithm to the images in the hope of obtaining a better 3D view.

My problem is that the transitions between the layers don’t look smooth. My goal is to reconstruct the shape of the sample with curved edges, but what I am seeing are sharp edges between each layer.

First question: Is what I am thinking feasible? Can I reconstruct the sample with curved edges?

Second question: What am I doing wrong? Would the sharp edges go away if I increase the number of slices, for example?

Best regards,
Ayman

This is feasible to the extend that these slides do not have large gaps between them, i.e., the sections are sufficiently sampled. Are you sure the spacing between slides is the same as the in-plane spacing (0.1 mm). In my experience they are usually least an order of magnitude larger. Yes, jagged edges will probably be less jagged if you include more slides (but they also need to be correctly registered) and used the correct spacing.

I don’t think you are doing anything wrong. You just need to find a registration algorithm that will do a better slice-to-slice registration. I highlighted one slide that’s obviously quite offset with respect to the others. The others are like that, but not as obvious.

Hello! I have some histology slices as well and they are already registered, I am trying to have them show on the 3D module as you did. But when I tried to visualize them, the 3D module on the left only gave me black spaces. If possible, could you share you steps on importing these images and how did you manage to turn them into 3D? Thanks!


This is what I have if you want to take a look

According to the screenshot you are getting an Invalid Texture Dimensions errors (i.e., the dimensions of the your dataset is larger than what your GPU driver supports). Try switching to CPU rendering, and you should be able to get something in 3D viewer (it might be slow).

For alignment of a serial stack of histology section images, I’m using ImageJ with the TrackEM plugin.
Here is a link below to a complete description of the steps required. I’ve found that I’ve needed to do multiple passes, including more tedious pair-wise alignment using the landmark option with aligning (2-3 landmarks should work). However, you will not get 100% alignment due to deformations in the tissue sections and many of your sections have missing components or heavily damaged.
After alignment in TrakEM, you right-click and select EXPORT then save those to a new folder. Watch all the options! Also, after alignment you can draw a rectangular marqee to capture all stack elements prior to export to remove extraneous background.

Aligning an image stack in TrackEM2 – Electron microscopy / Image analysis / 3D reconstruction (stefischer.de)

1 Like

414 serial sections of a ganglion. So to get it this good as shown (still not “perfect” when you examine edge misalignments in the coronal and sagittal views), after doing basic TrakEM alignment, I then performed more critical pair-wise alignment using Landmarks (up to 12 per pair). Using many landmarks helps with elasticity as histology sections look great individually but a lot of deformation occurs while the cut section relaxes prior to placement on a glass slide due to both individual protein components and the fixation rigidity for those individual components. “Optical sectioning” (aka confocal, MRI, etc) is easy for registration. Histology sections which deform and rotate as they are gathered make the downstream alignment process extremely tedious & difficult.

1 Like