I wrote this function in R many years ago that returns the desired pairwise
interlandmarks distances for all individuals present in an array; a single
matrix configuration is allowed too ; put a vector 1:n with n the number of
landmarks to have them all. I think it could be improved in terms of speed.
Hack it at your convenience. The output is in column format.
All the best
Paolo

distlm<-function(array,vector){


if(is.matrix(array)==T){array<-array(array,dim=c(nrow(array),ncol(array),1))}
distot<-NULL
  for(i in 1:dim(array)[3]){
    disti<-dist(as.matrix(array[vector,,i]))
    distot<-c(distot,list(disti))
  }
  names(distot)<-unlist(dimnames(array)[3])

  distot

  distotfin<-NULL
  for(j in 1:length(distot)){
    distotfinj<-matrix(as.vector(distot[[j]]),nrow=1)
    distotfin<-rbind(distotfin,distotfinj)
  }

  distotfin
  comb<-combn(vector,2)
  mycolnames<-NULL
  for(k in 1:ncol(comb)){
    mycolnamesi<-paste(comb[1,k],comb[2,k],sep="_")
    mycolnames<-append(mycolnames,mycolnamesi)
  }

  distotfin
  colnames(distotfin)<-mycolnames
  rownames(distotfin)<-unlist(dimnames(array)[3])
  distotfin
}






Il giorno ven 7 ott 2022 alle ore 09:17 alcardini <[email protected]> ha
scritto:

> For interlandmark distances from the original raw coordinates (no need
> to superimpose and rescale), one can use the EDMA function of PAST.
> Julien also has a script in his book to compute ILDs pairwise and the
> old Morpheus et al. had a command to get specific ILDs (this was also
> an option in PAST 2 and probably later versions).
>
> Cheers
>
> Andrea
>
> On 06/10/2022, 'Ann Ross' via Morphmet <[email protected]> wrote:
> > Hello Paolo,
> > You can convert your coordinate data to ILDs. But I am not sure that you
> can
> > compare ILDs to coordinate data directly. You could compare results from
> > both. I apologize if I misunderstood the question.
> > Best Regards,
> > Ann
> >
> > Ann H. Ross, Ph.D., D-ABFA
> >
> >
> >> On Oct 6, 2022, at 9:47 AM, Pablo Fisichella <[email protected]
> >
> >> wrote:
> >>
> >> 
> >> Dear Julien,
> >>
> >> Thank you very much for your response and explanations. Yes, I mean the
> >> inter-landmark distances obtained after a Procrustes superimposition.
> >>
> >> All best,
> >>
> >> Paolo
> >>
> >>> El jue, 6 oct 2022 a las 10:25, Julien Claude
> >>> (<[email protected]>) escribió:
> >>> Dear Paolo
> >>> I am not sure about what you mean by 'Procrustes distance between pairs
> >>> of landmarks'. If it is the euclidean distance between two landmarks
> >>> after superimposition  you just have to multiply them by centroid size
> in
> >>> mm. It will give you the interlandmark distance in mm, provided that
> your
> >>> coordinates were scaled to unit centroid size during the
> superimposition
> >>> process (sometimes referred as "partial procrustes superimposition").
> >>>
> >>> Julien CLAUDE
> >>>
> >>> De: "Pablo Fisichella" <[email protected]>
> >>> À: "Morphmet" <[email protected]>
> >>> Envoyé: Jeudi 6 Octobre 2022 15:09:34
> >>> Objet: [MORPHMET2] How to transform Procrustes distances to mlilimeters
> >>> Hi all,
> >>>
> >>> I performed a 2D GM analysis. I obtained Procrustes distances between
> >>> pairs of landmarks and I want to compare such distances with linear
> >>> distances in mm. Does somebody know how I can transform my Procrustes
> >>> distances to mm? Thanks in advance.
> >>>
> >>> All the best,
> >>>
> >>> Paolo
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Morphmet" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send
> an
> >>> email to [email protected].
> >>> To view this discussion on the web visit
> >>>
> https://groups.google.com/d/msgid/morphmet2/CANPrD1jTms3bwUCT59Ki1VGohBbTMoSrnpkjPqzud63pv%2BveOw%40mail.gmail.com
> .
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Morphmet" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to [email protected].
> >> To view this discussion on the web visit
> >>
> https://groups.google.com/d/msgid/morphmet2/CANPrD1hrH84U8ftGNxyp25GoHtBKcHUNCjW5MDzpJvoxG6hxeQ%40mail.gmail.com
> .
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Morphmet" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected].
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/morphmet2/CAA4357B-B1C5-460A-A52E-504FB0D1BF37%40ncsu.edu
> .
> >
>
>
> --
> E-mail address: [email protected], [email protected]
> WEBPAGE: https://sites.google.com/view/alcardini2/
> or https://tinyurl.com/andreacardini
>
> --
> You received this message because you are subscribed to the Google Groups
> "Morphmet" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/morphmet2/CAJ__j7NKxpKu_%3DKwXrS6pra9QJMtQJD8CRdKZ8QDFjEyLCTt9A%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Morphmet" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/morphmet2/CAAdPgfNET84xkT99cEfCYKYThdFvb5608x951o%3D%2Bxf3oRxucsg%40mail.gmail.com.

Reply via email to