Aligning clouds by picking points

Feel free to ask any question here
isharp
Posts: 8
Joined: Wed Dec 27, 2017 11:37 pm

Aligning clouds by picking points

Post by isharp »

Hello, I am very new to this program. I am in orthodontic residency and doing my master's research using this program on before and after tooth movement. I have 2 scans of teeth I have to align. I need to align only posterior teeth as only anterior teeth were moved with brackets. I watched tutorial online and were trying to pick points for alignment but it does not let me pick the points. I turned "to align" cloud off to first pick points on my "reference cloud" but no matter how much I zoom in, change radius, or click on it, no point can be selected :( It just does select any points! Please help!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Aligning clouds by picking points

Post by daniel »

Which version are you using? Make sure to use the latest one (2.9 or even better 2.10.alpha).

And you shouldn't use the sphere detection mode (with the radius).
Daniel, CloudCompare admin
isharp
Posts: 8
Joined: Wed Dec 27, 2017 11:37 pm

Re: Aligning clouds by picking points

Post by isharp »

Hi Daniel,

thank you so much, your comment helped me to figure it out. Now, is there a way to align 2 point clouds by registering them automatically with point sampling instead of manually picking the points if I want just the posterior teeth to register and not the anterior ones. And what would be the best way to measure anterior tooth movement from original to final position in terms of the facial/lingual, mesial/distal and torque movements? I was thinking to maybe pick 3 points on the facial of each anterior tooth on the before and after models and then see how those points changed... or maybe directly measure from initial to the final point, but, then, how do I know if I am picking the same point? Is there a better way to do that? Thank you!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Aligning clouds by picking points

Post by daniel »

Well, automatic registration is indeed possible. See: http://www.cloudcompare.org/doc/wiki/in ... ?title=ICP.

If you want to use only a part of the point cloud for this registration process, you can cut it beforehand (with the scissors tool: http://www.cloudcompare.org/doc/wiki/in ... ation_Tool).

And to evaluate how the tooth moves... the registration tool will output after completion a 4x4 transformation matrix in the console. You can copy it (CTRL+C). You could already get some information about the movement with it, but as it's expressed in the global coordinate system of the aligned cloud, it may be a bit misleading.

What you could do, following your initial idea:
- select some points on the original cloud (before aligning it) with the 'Point List Picking' tool (see the wiki)
- export this subset of points as a new cloud
- clone this new cloud
- perform your registration
- copy the resulting transformation matrix (CTRL+C in the console)
- apply the resulting transformation matrix on the clone subset (with Edit > Apply transformation - use the 'clipboard' button or CTRL+V to paste the transformation matrix)

This way you'll get the 3 points before transformation, and the 3 points after. You can then do anything you want with them ;) (maybe the simpler is to use the 'Point picking' tool to measure the distance between each couples of points).
Daniel, CloudCompare admin
isharp
Posts: 8
Joined: Wed Dec 27, 2017 11:37 pm

Re: Aligning clouds by picking points

Post by isharp »

Hi, Daniel!

I've tried that method and I like it much better than just measuring by picking points. I think your method is more accurate. Now, when I pick my points, it draws a rectangle no matter if I choose to pick three or four points. The matrix is 4x4, the 4th raw is 1. So, I assume I don't even need to include it in my calculations, right? In the raw, the first three is x, y, z but what is the 4th number in the raw? what is it measuring and should I be considering it for my purpose?
Also, what are the units for those points? Are those points measured in mm? I can't find the units mentioned anywhere...

Thank you!
Last edited by isharp on Mon Jan 22, 2018 6:20 pm, edited 1 time in total.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Aligning clouds by picking points

Post by daniel »

Yes, it's because CC doesn't handle units. Measurement are done in the same units as the cloud coordinates (only the user can determine the units, as it's not saved in most point cloud files).
Daniel, CloudCompare admin
isharp
Posts: 8
Joined: Wed Dec 27, 2017 11:37 pm

Re: Aligning clouds by picking points

Post by isharp »

Hi Daniel,

I am still struggling to understand why every time I pick 3 points, it draws a rectangle through my points and it gives me a 4x4 matrix. It might be a silly question and I am sorry for it but I have no engineering or math degree and I tried to search online but all the talks about matrices are too advanced for me. In 4x4, I think the raws give me x,y,z and rotation of the point. But what are the columns? Shouldn't I have 3 columns since I picked 3 points?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Aligning clouds by picking points

Post by daniel »

I'm not sure about the 'rectangle' thing (do you mean you create only subsets of 3 points with the 'Point List Picking' tool? If yes I'm not sure it's sufficient for ICP... and the rectangle is probably the axis-aligned bounding-box of the 3 points?).

Otherwise, regarding the 4x4 matrix, it has actually nothing to do with the points coordinates or their number. It is a composition between a 3D rotation matrix (the 3 x 3 upper left values) and a translation (the 3 first values of the 4th column). The 4th line is always '0 0 0 1' (I won't enter into details, let's say it's a kind of a mathematical trick).
Daniel, CloudCompare admin
isharp
Posts: 8
Joined: Wed Dec 27, 2017 11:37 pm

Re: Aligning clouds by picking points

Post by isharp »

Hi Daniel,

please tell me where I am going wrong with this:

A.

- After I import my “Before” model of teeth in STL file, I sample points on a mesh to create a point cloud
- Then I select points on I tooth I want to compare with the ‘Point picking tool’ (I am not sure how many I need to select but I was selected 3 points in the beginning. But then you told me, its is too few, so I started selecting 15 points...)
- I export this set of points as new cloud and I clone it
- Then I import my “After” model of teeth in STL file
- I use the ‘Segment’ tool and ‘segment in’ to isolate just that tooth in the after model where I picked points earlier on the before model
- I sample points again in that segment
- Then, I perform registration of my picked points from the “before” model with the ‘segment’ (one tooth) of the “after” model
- I copy the resulting transformation matrix
- And apply that matrix (paste it) on the cloned subset

And after that I am not sure how to extrapolate information from what I did…
I see the ‘Box dimensions’ and ‘Box center’ X, Y, Z values and down below in the transformation history I can see ‘Matrix’ and ‘Axis/Angle’. I understand that it calculates tooth transformation but how do I know how much the tooth actually moved if I want to report it in 3 dimensions: mesiodistal, faciolingual, and vertical and also in rotation (tip and long-axial rotation)? Is it possible to tell?

B. Or can we maybe assign a local coordinate system to each tooth and calculate the transformation matrix between positions for each tooth? Or is it the same thing as above?

C. You said to use the ‘Point picking’ tool to measure the distance between each couple of points might be easier but my concern is the precision of my measurements. I am afraid I will show some tooth movement measurements that could be argued due to not the actual tooth movement but me picking a point on the “after” model that was a little further away than that same point on the “before” model. There are no landmarks on teeth to go off of, so precisely picking that exact same point on the “before” and “after” model is almost impossible, correct?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Aligning clouds by picking points

Post by daniel »

A.
Oh sorry, I thought you were referring to the 'Align' tool (also called the 'Point-pair based alignement tool' - see http://www.cloudcompare.org/doc/wiki/in ... itle=Align). With this tool you just need to pick equivalent points on both models (no need to sample and/or extract anything before usingit).

If you want to use the automatic 'ICP' registration tool, then you should use much more points. Generally you would use the whole tooth or at least some parts of it (with the scissors tool). If they are models of different teeth, make sure you set a realistic 'overlap' parameter (to give a hint to CC on how well the two teeth are meant to match).

And last but not least, once you have registered one tooth with another one, you get the resulting transformation matrix in the Console (or in the 'Transformation history' field of the entity parameters, if it's the first time it is registered). Sadly (for you) this transformation is expressed in the default coordinate system and you won't have an easy correspondance with the jaw/tooth coordinate system that you are looking for (mesiodistal, faciolingual, etc.). You'll need the definition of this coordinate system (i.e. the main axes and a center point, expressed in the global coordinate system of your reference tooth) or equivalently you can re-orient your teeth models so that they already lie in the right coordinate system...

B.
Ok, so you got the idea. But it's not possible in CC, you have to do this "manually"

C.
Indeed. If you extract some points in the first model (as you did before) and then clone the corresponding cloud, and apply the transformation matrix, you'll be able to measure some displacements? (even though the resulting points may not lie on the reference tooth if the models don't correspond to the same tooth?)
Daniel, CloudCompare admin
Post Reply