Re: [MORPHMET] Sliding Semilandmarks

2016-03-19 Thread Stefan Schlager
Hi all,

I just stumbled across this discussion a bit too late, so I am joining
the party after everybody has left.

> If the semilandmarks slide a lot relative to the local curvature, they
> get off the curve. Of course, they can be projected back, but the
> following trick often is sufficient: Instead of the full amount of
> sliding, let all the semilandmarks slide just a fraction of the
> computed distance, say 20% (multiply T by 0.2 in equation of 4 of Gunz
> et al. 2005). Then update the tangents and let the semilandmarks slide
> again a fraction of the computed distance, etc. This requires more
> iterations but keeps the semilandmarks closer to the curve or surface.

As Philipp wrote, this can really make the difference for problematic
cases (and especially when minimizing ProcD: even with reprojection,
this can lead to distorted shapes if the coordinates have slid away on
the tangent planes to find a minimum)

For those who want to test the effect: In Morpho::slider3d you can
control this dampening by specifying stepsize (e.g. to 0.2 according to
Philipps example).

Best
Stefan

On 18/02/16 21:18, mitte...@univie.ac.at wrote:
>
> As Michael described, the average shape configuration affects the
> sliding when used as reference for the TPS; the final configurations
> thus are sample-dependent. However, if the curves/surfaces are covered
> densely enough by the semilandmarks (e.g., to avoid that a
> semilandmark can slide away from a relevant region), Procrustes
> distances are quite stable. Dense sampling can also improve the
> estimation of the tangents.
>
> If the semilandmarks slide a lot relative to the local curvature, they
> get off the curve. Of course, they can be projected back, but the
> following trick often is sufficient: Instead of the full amount of
> sliding, let all the semilandmarks slide just a fraction of the
> computed distance, say 20% (multiply T by 0.2 in equation of 4 of Gunz
> et al. 2005). Then update the tangents and let the semilandmarks slide
> again a fraction of the computed distance, etc. This requires more
> iterations but keeps the semilandmarks closer to the curve or surface.
>
> Also when minimizing Procrustes distance instead of BE, these
> distances are reduced relative to the sample average. But as for the
> superimposition itself, the sample configuration has only limited
> effect on the final configurations for small to moderate shape
> variation. (If variation is very large, the analysis is problematic
> anyway.) Note that the full sample must be slid together for a joint
> analysis (i.e., don't slide each population separately and then
> analyze them together). 
>
> The choice of the minimization criterion (Proc dist versus BE) can
> lead to different configurations. For most datasets, this difference
> is negligible, but in some situations it can matter. For example, when
> minimizing Proc dist semilandmarks can change their order or slide
> across a real landmark, whereas this is almost impossible for
> minimizing BE (changing order would have a very high BE). On the other
> hand, minimizing BE does not minimize affine shape variation (because
> it has zero BE). If affine shape variation is not constrained by real
> landmarks, this can lead to strange results. For instance, I had a
> dataset of mandibular cross-sections, which were U-shaped with real
> landmarks only at the two upper ends and semilandmarks in-between.
> Affine variation thus was not properly controlled. After BE sliding,
> the group differences comprised a lot of (meaningless) affine
> differences. I thus decided for minimizing Proc dist. Usually, though,
> I prefer minimizing BE because its is closer to our biological
> understanding of homology, including the preservation of landmark
> order and large scale shape features. Minimizing BE leads to smoother
> TPS deformation grids, whereas miminizing Proc dists leads to smaller
> sum of squares.
>
> Note that when updating the reference configuration in each iteration,
> the algorithm can converge to quite undesired minima (e.g. all
> semilandmarks collapse to a single point). This can be avoided by
> iterating just a few times, which is usually enough, or by keeping the
> reference constant at some point in the algorithm. In general, the
> more the semilandmarks are constrained by real landmarks and the
> smoother the curves, the more stable is the algorithm.
>
> Because of these issues, it is important to apply the semilandmark
> algorithm carefully, especially for 3D surfaces. Always check the
> tangents and how the semilandmarks slide along these tangents. Check
> how the total sliding reduces from one iteration to the next, and
> interpret the final pattern of shape variation in the light of the
> property being minimized.
>
> Best wishes,
>
> Philipp Mitteroecker
>
>
>
>
>
>
> Am Donnerstag, 18. Februar 2016 18:41:44 UTC+1 schrieb Collyer, Michael:
>
> Andrea,
>
> I like to think of semilandmark sliding as iteratively finding

Re: [MORPHMET] Sliding Semilandmarks

2016-02-21 Thread mitte...@univie.ac.at

As Michael described, the average shape configuration affects the sliding 
when used as reference for the TPS; the final configurations thus are 
sample-dependent. However, if the curves/surfaces are covered densely 
enough by the semilandmarks (e.g., to avoid that a semilandmark can slide 
away from a relevant region), Procrustes distances are quite stable. Dense 
sampling can also improve the estimation of the tangents.

If the semilandmarks slide a lot relative to the local curvature, they get 
off the curve. Of course, they can be projected back, but the following 
trick often is sufficient: Instead of the full amount of sliding, let all 
the semilandmarks slide just a fraction of the computed distance, say 20% 
(multiply T by 0.2 in equation of 4 of Gunz et al. 2005). Then update the 
tangents and let the semilandmarks slide again a fraction of the computed 
distance, etc. This requires more iterations but keeps the semilandmarks 
closer to the curve or surface.

Also when minimizing Procrustes distance instead of BE, these distances are 
reduced relative to the sample average. But as for the superimposition 
itself, the sample configuration has only limited effect on the final 
configurations for small to moderate shape variation. (If variation is very 
large, the analysis is problematic anyway.) Note that the full sample must 
be slid together for a joint analysis (i.e., don't slide each population 
separately and then analyze them together). 

The choice of the minimization criterion (Proc dist versus BE) can lead to 
different configurations. For most datasets, this difference is negligible, 
but in some situations it can matter. For example, when minimizing Proc 
dist semilandmarks can change their order or slide across a real landmark, 
whereas this is almost impossible for minimizing BE (changing order would 
have a very high BE). On the other hand, minimizing BE does not minimize 
affine shape variation (because it has zero BE). If affine shape variation 
is not constrained by real landmarks, this can lead to strange results. For 
instance, I had a dataset of mandibular cross-sections, which were U-shaped 
with real landmarks only at the two upper ends and semilandmarks 
in-between. Affine variation thus was not properly controlled. After BE 
sliding, the group differences comprised a lot of (meaningless) affine 
differences. I thus decided for minimizing Proc dist. Usually, though, I 
prefer minimizing BE because its is closer to our biological understanding 
of homology, including the preservation of landmark order and large scale 
shape features. Minimizing BE leads to smoother TPS deformation grids, 
whereas miminizing Proc dists leads to smaller sum of squares.

Note that when updating the reference configuration in each iteration, the 
algorithm can converge to quite undesired minima (e.g. all semilandmarks 
collapse to a single point). This can be avoided by iterating just a few 
times, which is usually enough, or by keeping the reference constant at 
some point in the algorithm. In general, the more the semilandmarks are 
constrained by real landmarks and the smoother the curves, the more stable 
is the algorithm.

Because of these issues, it is important to apply the semilandmark 
algorithm carefully, especially for 3D surfaces. Always check the tangents 
and how the semilandmarks slide along these tangents. Check how the total 
sliding reduces from one iteration to the next, and interpret the final 
pattern of shape variation in the light of the property being minimized.

Best wishes,

Philipp Mitteroecker






Am Donnerstag, 18. Februar 2016 18:41:44 UTC+1 schrieb Collyer, Michael:
>
> Andrea, 
>
> I like to think of semilandmark sliding as iteratively finding fitted 
> (predicted) values for the generalized linear model fit described by Gunz 
> et al. (2005) (equation 4), and updating coordinates by these values until 
> there is no more meaningful change (with regard to an acceptable 
> criterion).  If Bending energy is not used, the bending energy matrix is 
> replaced by an identity matrix (i.e., independence), which produces the 
> minimized Procrustes distance version of the sliding algorithm.  (This is 
> is the same as ordinary least squares being a simplification of generalized 
> least squares by using an identity matrix for the covariance matrix in GLS 
> estimation of parameters.)  Calculating the bending energy matrix requires 
> using the reference configuration.  The hat matrix calculated in the 
> process is typically post-multiplied by the target coordinates centered by 
> the reference configuration.  Changing the reference should, therefore, 
> change the solution.  Also, let’s not forget that with surface points, if 
> we follow the Gunz et al. (2005) recommendation, 5 nearest neighbors are 
> used to estimate the principal components for defining a tangent plane. 
>  One could use more nearest neighbors, which would change the tangent 
> planes.  One could 

Re: [MORPHMET] Sliding Semilandmarks

2016-02-18 Thread Carmelo Fruciano

Ariadne Schulz  ha scritto:


Hello all,

I'm having a bit of a semilandmark problem. I'm working on 3D surfaces with
semilandmarks. (Profuse thank yous to Emma for writing the scripts for
that.) The issue I'm having I think is occurring in the sliding. When I do
populations alone everything seems normal. The semilandmarks do not appear
to be going off the surface defined for them, but if I try to do more than
one population at once several of the semilandmarks slide off the surface
so my PCs get rather distorted. Based on the few individuals from different
populations I've looked at I think I do have interpopulation variation but
I wouldn't expect that to influence the sliding of semilandmarks. Has
anyone else encountered an issue like this with either 2D or 3D
semilandmarks? As with all things R I expect the answer will be something
like me omitting a comma somewhere so any suggestions you might have are
welcome.


Dear Ari,
to elaborate on what others have written, perhaps you also want to try  
and see how/if changing the criterion for sliding (minimizing bending  
energy vs minimizing Procrustes distance) and the number of iterations  
changes the results of your superimposition.


A post/discussion that may be interesting to you can be found at  
Stephan Schlager's blog:

http://zarquon42b.github.io/2014/11/07/ProcDSliding/

Best,
Carmelo




--
Carmelo Fruciano
Postdoctoral Fellow - Queensland University of Technology - Brisbane,  
Australia

Honorary Fellow - University of Catania - Catania, Italy
e-mail c.fruci...@unict.it
http://www.fruciano.it/research/

--
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
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 morphmet+unsubscr...@morphometrics.org.



Re: [MORPHMET] Sliding Semilandmarks

2016-02-18 Thread Collyer, Michael
Andrea,

I like to think of semilandmark sliding as iteratively finding fitted 
(predicted) values for the generalized linear model fit described by Gunz et 
al. (2005) (equation 4), and updating coordinates by these values until there 
is no more meaningful change (with regard to an acceptable criterion).  If 
Bending energy is not used, the bending energy matrix is replaced by an 
identity matrix (i.e., independence), which produces the minimized Procrustes 
distance version of the sliding algorithm.  (This is is the same as ordinary 
least squares being a simplification of generalized least squares by using an 
identity matrix for the covariance matrix in GLS estimation of parameters.)  
Calculating the bending energy matrix requires using the reference 
configuration.  The hat matrix calculated in the process is typically 
post-multiplied by the target coordinates centered by the reference 
configuration.  Changing the reference should, therefore, change the solution.  
Also, let’s not forget that with surface points, if we follow the Gunz et al. 
(2005) recommendation, 5 nearest neighbors are used to estimate the principal 
components for defining a tangent plane.  One could use more nearest neighbors, 
which would change the tangent planes.  One could also choose to project points 
after sliding back onto the surface (by finding the nearest neighbor) or not.  
One could choose to recursively update the reference configuration as the 
Procrustes average in each iteration, or use a constant reference.  One could 
also choose different convergence criteria, depending on how precise the 
finished product should be.  This is all to say that there are several - 
perhaps arbitrary - choices that can be made that will affect the results.

Whether these nuances have an appreciable empirical effect, I’m not sure.  I 
doubt that shape distances would change “remarkably” (depending on one’s 
definition of remarkable), but I think one cannot expect that subsampling will 
produce the same Procrustes residuals that would be found from using one 
inclusive sample.

As you have indicated, the same thing happens with GPA performed on “fixed” 
landmarks.  The extent to which surface semilandmarks would be similar or more 
susceptible to change is hard to argue without considering whether bending 
energy is used, how many nearest neighbors are used, the relative density of 
surface points, etc. This is probably a question to answer empirically with 
specific data.  (Get Procrustes residuals from the full data, do it again with 
subsetted data, and maybe do a two-block PLS analysis between two sets of 
matching specimens to see if there is any appreciable change.)

I would be curious to know what others think.  I have been thinking about this 
topic a lot, especially after dealing with the programming in geomorph.  I’m 
sure there are other perspectives.

Mike

Michael Collyer

Associate Professor
Biostatistics
Department of Biology
Western Kentucky University
1906 College Heights Blvd. #11080
Bowling Green, KY 42101-1080
Phone: 270-745-8765; Fax: 270-745-6856
Email: michael.coll...@wku.edu

On Feb 18, 2016, at 11:03 AM, andrea cardini 
> wrote:

Mike, does this mean that, in general, the position of the semilandmarks is 
strongly sample dependent, which would mean that also the shape distances might 
change remarkably despite the fact one has the same number of points on exactly 
the same surface?
Say that I have two samples, A and B. I first (1) superimpose (and slide) 
within A. Then I do the same with both A and B together (2). Could I get 
appreciable differences between A1 and A2 just because of the sliding?

All Procrustes shape distances depend on the sample composition. However, in my 
experience, differences between A1 and A2 tend to be negligible with 'standard' 
landmarks. Is this different with semilandmarks? Are there sensitivity analyses 
that explore the issue (if it's an issue)?

Thanks in advance.
Cheers

Andrea

At 17:06 18/02/2016, Collyer, Michael wrote:
Contrary to your logic, subsetting your sample could have an effect.  Your mean 
configuration would change in each of the subsamples, from the mean of your 
original sample, thus changing the reference configuration used in the separate 
GPAs performed.  The reference configuration has a prominent role in the 
sliding of landmarks.


Dr. Andrea Cardini
Researcher, Dipartimento di Scienze Chimiche e Geologiche, Università di Modena 
e Reggio Emilia, Via Campi, 103 - 41125 Modena - Italy
tel. 0039 059 2058472

Adjunct Associate Professor, Centre for Forensic Science , The University of 
Western Australia, 35 Stirling Highway, Crawley WA 6009, Australia

E-mail address: alcard...@gmail.com, 
andrea.card...@unimore.it
WEBPAGE: https://sites.google.com/site/alcardini/home/main


FREE Yellow BOOK on Geometric 

Re: [MORPHMET] Sliding Semilandmarks

2016-02-18 Thread Ariadne Schulz
Will update and try again. That sounds - without being too hopeful - like
it might solve my problem. If not, I'll come back with better details.

I would also like the clarification on the point Andrea has asked about.
That sounds like a concerning issue for what I'm trying to do with this.

Thanks!
Ari

On Thu, Feb 18, 2016 at 4:06 PM, Collyer, Michael 
wrote:

> Ari,
>
> If you are using geomorph, you might want to update it via GitHub.  Just a
> few days ago we updated the software with some bug fixes for surface points
> (one bug fix was for assuring non-arbitrary directions in PC planes for
> tangents of surface points).  If you are unsure how to do that, look at the
> post by Dean Adams on 15 February 2016.
>
> Beyond that, you are asking for assistance without defining (1) how you
> are sliding your landmarks (minimizing Procrustes Distance or Bending
> Energy) or (2) other specifics that might be important (package within R,
> maybe other inputs that might be important, such as the relative numbers of
> fixed landmarks and semilandmarks, etc.).
>
> Contrary to your logic, subsetting your sample could have an effect.  Your
> mean configuration would change in each of the subsamples, from the mean of
> your original sample, thus changing the reference configuration used in the
> separate GPAs performed.  The reference configuration has a prominent role
> in the sliding of landmarks.
>
> With the information you provided, t is not possible to discern among user
> error, program error, or analytical artifact.
>
> Mike
>
> Michael Collyer
>
> Associate Professor
> Biostatistics
> Department of Biology
> Western Kentucky University
> 1906 College Heights Blvd. #11080
> Bowling Green, KY 42101-1080
> Phone: 270-745-8765; Fax: 270-745-6856
> Email: michael.coll...@wku.edu
>
> On Feb 18, 2016, at 9:43 AM, Ariadne Schulz 
> wrote:
>
> Hello all,
>
> I'm having a bit of a semilandmark problem. I'm working on 3D surfaces
> with semilandmarks. (Profuse thank yous to Emma for writing the scripts for
> that.) The issue I'm having I think is occurring in the sliding. When I do
> populations alone everything seems normal. The semilandmarks do not appear
> to be going off the surface defined for them, but if I try to do more than
> one population at once several of the semilandmarks slide off the surface
> so my PCs get rather distorted. Based on the few individuals from different
> populations I've looked at I think I do have interpopulation variation but
> I wouldn't expect that to influence the sliding of semilandmarks. Has
> anyone else encountered an issue like this with either 2D or 3D
> semilandmarks? As with all things R I expect the answer will be something
> like me omitting a comma somewhere so any suggestions you might have are
> welcome.
>
> Best,
> Ari
>
> --
> MORPHMET may be accessed via its webpage at http://www.morphometrics.org
> ---
> 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 morphmet+unsubscr...@morphometrics.org.
>
>
>

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
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 morphmet+unsubscr...@morphometrics.org.


Re: [MORPHMET] Sliding Semilandmarks

2016-02-18 Thread andrea cardini
Mike, does this mean that, in general, the 
position of the semilandmarks is strongly sample 
dependent, which would mean that also the shape 
distances might change remarkably despite the 
fact one has the same number of points on exactly the same surface?
Say that I have two samples, A and B. I first (1) 
superimpose (and slide) within A. Then I do the 
same with both A and B together (2). Could I get 
appreciable differences between A1 and A2 just because of the sliding?


All Procrustes shape distances depend on the 
sample composition. However, in my experience, 
differences between A1 and A2 tend to be 
negligible with 'standard' landmarks. Is this 
different with semilandmarks? Are there 
sensitivity analyses that explore the issue (if it's an issue)?


Thanks in advance.
Cheers

Andrea

At 17:06 18/02/2016, Collyer, Michael wrote:
Contrary to your logic, subsetting your sample 
could have an effect.  Your mean configuration 
would change in each of the subsamples, from the 
mean of your original sample, thus changing the 
reference configuration used in the separate 
GPAs performed.  The reference configuration has 
a prominent role in the sliding of landmarks.



Dr. Andrea Cardini
Researcher, Dipartimento di Scienze Chimiche e 
Geologiche, Università di Modena e Reggio Emilia, 
Via Campi, 103 - 41125 Modena - Italy

tel. 0039 059 2058472

Adjunct Associate Professor, Centre for Forensic 
Science , The University of Western Australia, 35 
Stirling Highway, Crawley WA 6009, Australia


E-mail address: alcard...@gmail.com, andrea.card...@unimore.it
WEBPAGE: https://sites.google.com/site/alcardini/home/main


FREE Yellow BOOK on Geometric Morphometrics: 
http://www.italian-journal-of-mammalogy.it/issue/view/405
or full volume at: 
http://www.italian-journal-of-mammalogy.it/public/journals/3/issue_241_complete_100.pdf


Editorial board for:
Zoomorphology: 
http://www.springer.com/life+sciences/animal+sciences/journal/435
Journal of Zoological Systematics and 
Evolutionary Research: http://www.wiley.com/bw/journal.asp?ref=0947-5745=1
Hystrix, the Italian Journal of 
Mammalogy: http://www.italian-journal-of-mammalogy.it/ 


--
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
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 morphmet+unsubscr...@morphometrics.org.



Re: [MORPHMET] Sliding Semilandmarks

2016-02-18 Thread Collyer, Michael
Ari,

If you are using geomorph, you might want to update it via GitHub.  Just a few 
days ago we updated the software with some bug fixes for surface points (one 
bug fix was for assuring non-arbitrary directions in PC planes for tangents of 
surface points).  If you are unsure how to do that, look at the post by Dean 
Adams on 15 February 2016.

Beyond that, you are asking for assistance without defining (1) how you are 
sliding your landmarks (minimizing Procrustes Distance or Bending Energy) or 
(2) other specifics that might be important (package within R, maybe other 
inputs that might be important, such as the relative numbers of fixed landmarks 
and semilandmarks, etc.).

Contrary to your logic, subsetting your sample could have an effect.  Your mean 
configuration would change in each of the subsamples, from the mean of your 
original sample, thus changing the reference configuration used in the separate 
GPAs performed.  The reference configuration has a prominent role in the 
sliding of landmarks.

With the information you provided, t is not possible to discern among user 
error, program error, or analytical artifact.

Mike

Michael Collyer

Associate Professor
Biostatistics
Department of Biology
Western Kentucky University
1906 College Heights Blvd. #11080
Bowling Green, KY 42101-1080
Phone: 270-745-8765; Fax: 270-745-6856
Email: michael.coll...@wku.edu

On Feb 18, 2016, at 9:43 AM, Ariadne Schulz 
> wrote:

Hello all,

I'm having a bit of a semilandmark problem. I'm working on 3D surfaces with 
semilandmarks. (Profuse thank yous to Emma for writing the scripts for that.) 
The issue I'm having I think is occurring in the sliding. When I do populations 
alone everything seems normal. The semilandmarks do not appear to be going off 
the surface defined for them, but if I try to do more than one population at 
once several of the semilandmarks slide off the surface so my PCs get rather 
distorted. Based on the few individuals from different populations I've looked 
at I think I do have interpopulation variation but I wouldn't expect that to 
influence the sliding of semilandmarks. Has anyone else encountered an issue 
like this with either 2D or 3D semilandmarks? As with all things R I expect the 
answer will be something like me omitting a comma somewhere so any suggestions 
you might have are welcome.

Best,
Ari

--
MORPHMET may be accessed via its webpage at 
http://www.morphometrics.org
---
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 
morphmet+unsubscr...@morphometrics.org.

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
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 morphmet+unsubscr...@morphometrics.org.


[MORPHMET] Sliding Semilandmarks

2016-02-18 Thread Ariadne Schulz
Hello all,

I'm having a bit of a semilandmark problem. I'm working on 3D surfaces with
semilandmarks. (Profuse thank yous to Emma for writing the scripts for
that.) The issue I'm having I think is occurring in the sliding. When I do
populations alone everything seems normal. The semilandmarks do not appear
to be going off the surface defined for them, but if I try to do more than
one population at once several of the semilandmarks slide off the surface
so my PCs get rather distorted. Based on the few individuals from different
populations I've looked at I think I do have interpopulation variation but
I wouldn't expect that to influence the sliding of semilandmarks. Has
anyone else encountered an issue like this with either 2D or 3D
semilandmarks? As with all things R I expect the answer will be something
like me omitting a comma somewhere so any suggestions you might have are
welcome.

Best,
Ari

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
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 morphmet+unsubscr...@morphometrics.org.