zarquon42b / Morpho

R-package providing a toolset for (3D-based) Geometric Morphometrics
51 stars 16 forks source link

What function do I use to scale, translate and rotate the complete (soft and hard tissue) landmark dataset onto the superimposed hard tissue configurations by using corrsponding landmarks? #35

Open CatherineBone opened 1 year ago

CatherineBone commented 1 year ago

I have an array of 3D landmark data defined as 931 x 3 x 4. For each of the four individuals (3rd dim) the first 617 rows contain soft tissue landmarks, and the following 314 rows contain hard tissue landmarks

combinedarray<-array(c(Comp1matrix,Comp2matrix,Comp3matrix,Comp4matrix), dim=c(931,3,4))

I've done a Procrustes fit for hard tissue configurations

hardproc<-procSym(combinedarray[618:931,,])

Now I need to register the complete landmark configurations (soft and hard tissue) of all specimens within the bone-tissue shape space - how do I do this?

I've tried

rot<-rotonto(hardproc$orpdata[,,1],Comp1matrix[618:931,]) and newalign<-align2procSym(hardproc,Comp1matrix[618:931,])

but they only give me 314 rows of data, but I think I need a matrix of dimensions of the total landmarks (931)

Thanks for your help :)

CatherineBone commented 1 year ago

I think I worked it out :) I think it could possibly be the functions computeTransform and applyTransform. I used a random hard tissue sample as the fixed landmarks and then I applied the Compute and Apply transform to each of the combined (hard and soft) samples

trafo<-computeTransform[combinedarray[,,2],[combinedarray[618-931,,4]) transLM<-applyTransform[combinedarray[,,4],trafo)

FIngers crossed its correct!