Skip to contents

Rotationnal biases appear after coo_slidedirection (and friends). Typically useful for outline analysis where phasing matters. See examples.

Usage

coo_untiltx(coo, id, ldk)

Arguments

coo

matrix of (x; y) coordinates or any Coo object.

id

numeric the id of the point that will become the new first point. See details below for the method on Coo objects.

ldk

numeric the id of the ldk to use as id, only on Out

Value

a matrix of (x; y) coordinates, or a Coo object.

Details

For Coo objects, and in particular for Out and Opn two different ways of coo_sliding are available:

  • no ldk passed and an id is passed: all id-th points within the shapes will become the first points.

  • a single ldk is passed: the ldk-th ldk will be used to slide every shape. If an id is (also) passed, id is ignored with a message.

Examples

# on a single shape
bot[1] %>% coo_center %>% coo_align %>%
   coo_sample(12) %>% coo_slidedirection("right") %T>%
   coo_plot() %>% # the first point is not on the x-axis
   coo_untiltx() %>%
   coo_draw(border="red") # this (red) one is


# on an Out
# prepare bot
prebot <- bot %>% coo_center %>% coo_scale %>%
   coo_align %>% coo_slidedirection("right")
prebot %>% stack # some dephasing remains

prebot %>% coo_slidedirection("right") %>% coo_untiltx() %>% stack # much better

# _here_ there is no change but the second, untilted, is correct
prebot %>% efourier(8, norm=FALSE) %>% PCA %>% plot_PCA(~type)

prebot %>% coo_untiltx %>% efourier(8, norm=FALSE) %>% PCA %>% plot_PCA(~type)


# an example using ldks:
# the landmark #2 is on the x-axis
hearts %>%
  slice(1:5) %>% fgProcrustes(tol=1e-3) %>% # for speed sake
  coo_center %>% coo_untiltx(ldk=2) %>% stack
#> iteration:  1 	gain: 8.1326 
#> iteration:  2 	gain: 0.00031224