Regression data pairing

11 views
Skip to first unread message

Maia R.

unread,
Oct 12, 2021, 2:28:52 PM10/12/21
to scalismo
Dear all,
I have a set of anatomical landmarks for reference mesh (referenceLMs) and another one for a target mesh (targetLMs). I would like to establish correspondence between the two sets of landmarks. I tried this:
but it does not work.
Could you have a look please on how to correct this ?
Thank you 
Best regards

Max

unread,
Oct 12, 2021, 3:58:21 PM10/12/21
to scalismo
Hi Maia,

In line 1, you declared pointPairsForPosterior as a sequence of (PointId, Point[_3D]) tuples. In line 6, however, refPointId is a string and targetPt an "Option". So, in order to fix this issue, just convert refPointId to PointId(refPointI) and change line 5 to targetPt = targetLMs.find(p => p.id == refPointId).get.point.

Best
Max

Ps: A more compact solution might look something like this:

val targetLMsMap = targetLMs.map(lm => (lm.id, lm.point)).toMap
val pointPairsForPosterior = referenceLMs.map(lm => (lm.id, targetLMsMap(lm.id)))

Maia R.

unread,
Oct 13, 2021, 9:25:54 AM10/13/21
to scalismo
Thank you Max !
Reply all
Reply to author
Forward
0 new messages