davidcsterratt / retistruct

Computational reconstruction and transformation of flattened retinae
http://davidcsterratt.github.io/retistruct/
7 stars 7 forks source link

Tear coordinate dataframe validation #23

Closed bc closed 6 years ago

bc commented 6 years ago

Do you currently have any validation for the order of a given tear (row) in the T.csv?

i.e. would these be read the same successfully?

t_csv_A <- rbind(
    c(31,33,30),
    c(2,3,1)
)

t_csv_B <- rbind(
    c(33,31,30),
    c(3,2,1)
)

t_csv_C <- rbind(
    c(30,33,30),
    c(3,2,1)
)

and also how does retistruct deal with tears that go across the last and first point?

bc commented 6 years ago

I save those as T.csv in the exact format retistruct outputs, but the elements in a given row might be swapped around by a user.

davidcsterratt commented 6 years ago

It doesn't matter what order the points are given in. There are 6 possible ways of allocating 3 points to the apex (V0) and forward and backward vertices of a tear (VF and VB). From labelTear() in AnnotatedOutline.R:

## For each permuation of V0, VF, VB, measure the sum of length in
## the forwards direction from V0 to VF and in the backwards
## direction from V0 to VB. The permuation with the minimum distance
## is the correct one.

labelTear() is called by addTear().

Tears that go across the first and last point are dealt with by using the forward and backward pointers self$gf and self$gb around the path describing the outline.