TWO .stl file alignment and measurement

Hi, i am researcher in Malmo University. I am planning to conduct a research on dental implants. I would be grateful if someone can help me with the problems that i have.

  1. Can 3D Slicer be used to to align (superimpose) two .stl files of the same patient ?

I will be using the surface scanner (3shape) to scan the patients pre and post operative. (the two stl files pre and post https://www.transfernow.net/857y81q1ziko ).

  1. If so can 3D Slicer be used to compare and make measurements of the difference in bone height and soft tissue heights ?

like in this one

. They have used the Geomagic quantify to do this research.

  1. If these can be done can somebody be kind enough to direct me on how to superimpose (Align/register) the two STL files and then make quantitative measurement of the difference of the pre and post scans ?

Kind regards

Manjula

1 Like

Have a look at this thread:

2 Likes

Hi Steffen-o,

Thank you for the direction. It solved my first problem.

And i need to figure out how to do the measurement and the colour map.

Thank you again.

Hello Manjula

How do you do. I am a dental student at UQ working on a similar research project for my final year requirement - aligning 2 STL tooth models for endodontic research purposes. I was wondering if you were able to find any methods to do the measurement and the colour map.

Any advice & direction would be appreciated!

Sean

Hi,

I have tried virtually all methods available in 3D Slicer for surface registration and found the IGT fiducial registration method, a semi automatic method to be the most useful one.

However, I no longer use any 3D Slicer-based tools for registration as results are subpar and take too much time and uses the ICP registration addon in the Blender which is a fully automatic tool and works wonderfully well.

you can find this add-on in github and install it on Blender. It is very easy to use.

You can see the discussion I had on this topic, with very useful input from others at,

Colour maps

I use the model to model distance and shape population viewer in the 3D slicer to create the color maps.

measurement

What measurements you need ? If you are going to segment the structures then you can use the segment editor statistics to measure. Also there are lots of other measurement tools available but will depend on what you need to measure and using what type of data.

Have you tried ALPACA, which is part of SlicerMorph? SlicerMorph/Docs/ALPACA at master · SlicerMorph/SlicerMorph · GitHub

It is meant to transfer the landmarks via registration. But you can also use to register models. (You will have to create a fiducial node with at least one point in it to initiate the process, once you start, you can ignore it).

1 Like

Manjula, thank you for the pieces of gem you’ve outlined here.
I will have a thorough look at the two softwares you’ve recommended.

Regarding your question of what measurement I need - essentially, I will need to calculate the difference between the 2 STL mesh files in terms of mm (length) once they are aligned. If absolute measurement is not possible, just a relative distance would suffice. Essentially it would give you feedbacks on the quality of your access cavity preparation (whether it’s too wide, deep, etc.). Would you be able to point me in the right direction?

Thanks again,
Sean

Hi, thanks for this.
I will have a go at it later today.

Hello muratmaga,

I’ve had a look at ALPACA and it seems like it requires a .ply file format & .fcsv landmark file.

  1. If possible, I’m looking to work with .stl files. Would there be a way to work around this?
  2. How could I obtain the landmark for a .stl file? Would you mind elaborating on creating a fiducial node to initiate the process?

My apologies, I am not too techy which is why I’m studying dentistry :smiley:

Sincerely

Sean

If you loaded your stl models into slicer, you can save them as ply. We don’t like stl, due to potential issues with physical scale.

As for the fiducial, you only need to create a single point and save it as fcsv.

@agporto @smrolfe should we consider making the interactive mode work with data loaded into the scene as oppose to load from the disk?

I’m not aware of any standard way of specifying coordinate system unit in either STL or PLY. You can include comments in both formats to specify any additional information (we use this for specifying the coordinate system axis directions), but these are not part of the file format but these are conventions that users has to agree on and use consistently.

Nevertheless, PLY is a much more capable format than STL and not much more complicated, so it makes a lot of sense to use PLY.

It makes sense for Alpaca to require files for its batch mode, but I would consider it as a bug that it requires file input for registering a single pair of models. It would be trivial to replace the file selectors by node selectors.

I believe Alpaca will work better than Blender’s ICP, as Alpaca offers precise control over what is registered by means of landmark points and because it supports non-linear warping transforms as well. Alpaca just have to be made more user-friendly for simple cases (make it work without requiring even a single landmark point, make it easy to add/remove landmark points in the module using markup place widget, etc.).

We have designed ALPACA with a specific use case in mind, but looks like it can be useful to the people for other things (like alignment). I think few additional changes will also be useful (like actually saving transforms).

1 Like

One option would be to make the landmark transfer as an optional step in the pipeline. It would be fairly straightforward to do that. I also like the idea of registering models loaded in the scene when using the pairwise tab.

1 Like

Thanks for the feedbacks.
As you guys have mentioned, removing the requirement of landmark point would be great. 3D scanning is still relatively new in the dentistry field and a seamless alignment process would make a huge impact in the implant, prosthodontic, and endodontic field.

Ps. I tried the ALPACA once I converted the files to .ply format & transferring a landmark and the alignment worked fantastically. Thanks a lot.

1 Like

Hello manjula

I was able to align the models using ALPACA successfully as others have advised.
Now moving onto calculating the distance - you have mentioned that you use the model to model distance & shape population viewer.

I have downloaded the model to model distance myself and am not sure where and how I am able to use the extension. How can I access the extension once I’ve downloaded it? Would you be able to provide a guidance? Also is .ply format compatible or is .vtk only compatible?

Thanks a lot

You can search for the model to model in find module or else it is listed under the quantification category. Also it works with ply format.

I have tried it previously on your suggestions but I could not get it to work the way I wanted to.

I again tried it today, and for me, the results were the same. I tried adjusting the parameters as well but could not get better results. If you have time please have a look and let me know if there is something i can do to improve the results. For comparison, I have attached the video of the ICP registration in Blender as well. can do the same thing within 20-30 seconds with the default settings.
Please let me know if i am doing it wrong.

I have attached the sample files if you have time.

https://drive.google.com/file/d/1rEgIvcsPByCH8GBotH919ltpq_tfQELi/view?usp=sharing

https://drive.google.com/file/d/1kipMX-7JcqGFuOTa_gZD_CYzVPlv8bDO/view?usp=sharing

Thanks for this manjula.
Would you also mind providing a screen recording of you using the Module-to-Module distance & shape population viewer?

There doesn’t seem to be many tutorials online.
It would mean a lot to me!

Sean

I don’t think you are doing anything wrong. I will leave the technical comments and more suggestions for improving the alignment to @agporto, but we haven’t really thought about this use this in ALPACA, in which you have identical shapes with slight modification (a bone cut). We normally deal with geometries much more different.

With basically turning off everything as low as possible, I got this alignment which is not perfect but pretty close.

@agporto @smrolfe any other suggestions?

1 Like

Hello

I just had one more question - what is “Run CPD non-rigid registration” for specifically?
To me, “Run rigid alignment” seems to get most of the alignment done.

Thanks for the clarification.