bc / retina

Tools for visualizing and comparing data from vertebrate retinas
14 stars 3 forks source link

full refactor without retistruct GUI #43

Closed bc closed 4 years ago

bc commented 5 years ago
bc commented 5 years ago

full_retina.zip source files:

bc commented 4 years ago

image got flatmoutn plot to represent the same orientation as in ImageJ.

image

bc commented 4 years ago

image good overlap with datapoints.csv and outline.roi. should be no data outwith the outline

bc commented 4 years ago

image flipped Y and the axes match perfectly. updated tear_markup_plot to match with some refactoring

bc commented 4 years ago

image now the sampling points work

bc commented 4 years ago

outline and grid do not align image

bc commented 4 years ago

image points on red are being excluded. somehow the units of those points need to be converted to match the coordinate frame of the outline.roi, as it is entered in retistruct

bc commented 4 years ago

image grid point align correctly with output dtt dataframe

bc commented 4 years ago

image raw coordinates from outline.ROI

bc commented 4 years ago
roi retistruct
        x   y
 [1,] 866 480
 [2,] 867 461
 [3,] 830 324
 [4,] 711 218
 [5,] 620 229
 [6,] 657  83
 [7,] 562  29
 [8,] 484   7
 [9,] 402   0
[10,] 233  27
[11,] 150  69
[12,] 172 201
[13,] 221 281
[14,] 287 375
[15,] 138 408
[16,]  28 438
[17,]  19 529
[18,]  20 601
[19,]  41 663
[20,]  91 734
[21,] 140 787
[22,] 179 838
[23,] 249 925
[24,] 353 851
[25,] 406 841
[26,] 419 916
[27,] 426 990
[28,] 560 940
[29,] 667 875
[30,] 767 772
[31,] 831 701
[32,] 793 665
[33,] 737 628
[34,] 697 574
[35,] 865 495
```   |    

r$> load_roi(roi_path)$coords x y [1,] 866 516 [2,] 867 535 [3,] 830 672 [4,] 711 778 [5,] 620 767 [6,] 657 913 [7,] 562 967 [8,] 484 989 [9,] 402 996 [10,] 233 969 [11,] 150 927 [12,] 172 795 [13,] 221 715 [14,] 287 621 [15,] 138 588 [16,] 28 558 [17,] 19 467 [18,] 20 395 [19,] 41 333 [20,] 91 262 [21,] 140 209 [22,] 179 158 [23,] 249 71 [24,] 353 145 [25,] 406 155 [26,] 419 80 [27,] 426 6 [28,] 560 56 [29,] 667 121 [30,] 767 224 [31,] 831 295 [32,] 793 331 [33,] 737 368 [34,] 697 422 [35,] 865 501

bc commented 4 years ago

when using the retistruct-style outline approach, no items land outside the outline! image

bc commented 4 years ago

      x   y        phi     lambda   phi_deg lambda_deg
 1: 866 480  0.0000000  1.6927944   0.00000   96.98998
 2: 867 461  0.0000000  1.6286314   0.00000   93.31371
 3: 830 324  0.0000000  1.1685015   0.00000   66.95021
 4: 711 218  0.0000000  0.6643378   0.00000   38.06375
 5: 620 229 -0.4002356  0.6113949 -22.93181   35.03035
 6: 657  83  0.0000000  0.6643378   0.00000   38.06375
 7: 562  29  0.0000000  0.2725197   0.00000   15.61423
 8: 484   7  0.0000000  0.0000000   0.00000    0.00000
 9: 402   0  0.0000000 -0.2740023   0.00000  -15.69918
10: 233  27  0.0000000 -0.8313582   0.00000  -47.63331
11: 150  69  0.0000000 -1.1627718   0.00000  -66.62192
12: 172 201 -0.4266316 -1.1430187 -24.44419  -65.49015
13: 221 281 -0.6982187 -1.0705789 -40.00499  -61.33965
14: 287 375 -1.0169022 -0.9527973 -58.26421  -54.59126
15: 138 408 -0.4623417 -1.1268234 -26.49023  -64.56222
16:  28 438  0.0000000 -1.1627718   0.00000  -66.62192
17:  19 529  0.0000000 -1.4589114   0.00000  -83.58947
18:  20 601  0.0000000 -1.6741254   0.00000  -95.92032
19:  41 663  0.0000000 -1.8640987   0.00000 -106.80499
20:  91 734  0.0000000 -2.1198834   0.00000 -121.46037
21: 140 787  0.0000000 -2.3413462   0.00000 -134.14926
22: 179 838  0.0000000 -2.5415106   0.00000 -145.61783
23: 249 925  0.0000000 -2.8942786   0.00000 -165.82995
24: 353 851 -0.3497687 -2.9756204 -20.04027 -170.49049
25: 406 841 -0.4705284 -3.0322503 -26.95929 -173.73515
26: 419 916 -0.2477825 -2.9523932 -14.19689 -169.15967
27: 426 990  0.0000000 -2.8942786   0.00000 -165.82995
28: 560 940  0.0000000  2.9224854   0.00000  167.44608
29: 667 875  0.0000000  2.5295023   0.00000  144.92981
30: 767 772  0.0000000  2.0670298   0.00000  118.43209
31: 831 701  0.0000000  1.7436827   0.00000   99.90566
32: 793 665 -0.1915390  1.7586750 -10.97437  100.76465
33: 737 628 -0.4175587  1.7924179 -23.92435  102.69798
34: 697 574 -0.6189636  1.7930998 -35.46400  102.73705
35: 865 495  0.0000000  1.7436827   0.00000   99.90566```
bc commented 4 years ago

      x   y        phi     lambda   phi_deg lambda_deg successful_mapping
 1: 866 480  0.0000000  1.6927944   0.00000   96.98998               TRUE
 2: 867 461  0.0000000  1.6286314   0.00000   93.31371               TRUE
 3: 830 324  0.0000000  1.1685015   0.00000   66.95021               TRUE
 4: 711 218  0.0000000  0.6643378   0.00000   38.06375               TRUE
 5: 620 229 -0.4002356  0.6113949 -22.93181   35.03035               TRUE
 6: 657  83  0.0000000  0.6643378   0.00000   38.06375               TRUE
 7: 562  29  0.0000000  0.2725197   0.00000   15.61423               TRUE
 8: 484   7  0.0000000  0.0000000   0.00000    0.00000               TRUE
 9: 402   0  0.0000000 -0.2740023   0.00000  -15.69918               TRUE
10: 233  27  0.0000000 -0.8313582   0.00000  -47.63331               TRUE
11: 150  69  0.0000000 -1.1627718   0.00000  -66.62192               TRUE
12: 172 201 -0.4266316 -1.1430187 -24.44419  -65.49015               TRUE
13: 221 281 -0.6982187 -1.0705789 -40.00499  -61.33965               TRUE
14: 287 375 -1.0169022 -0.9527973 -58.26421  -54.59126               TRUE
15: 138 408 -0.4623417 -1.1268234 -26.49023  -64.56222               TRUE
16:  28 438  0.0000000 -1.1627718   0.00000  -66.62192               TRUE
17:  19 529  0.0000000 -1.4589114   0.00000  -83.58947               TRUE
18:  20 601  0.0000000 -1.6741254   0.00000  -95.92032               TRUE
19:  41 663  0.0000000 -1.8640987   0.00000 -106.80499               TRUE
20:  91 734  0.0000000 -2.1198834   0.00000 -121.46037               TRUE
21: 140 787  0.0000000 -2.3413462   0.00000 -134.14926               TRUE
22: 179 838  0.0000000 -2.5415106   0.00000 -145.61783               TRUE
23: 249 925  0.0000000 -2.8942786   0.00000 -165.82995               TRUE
24: 353 851 -0.3497687 -2.9756204 -20.04027 -170.49049               TRUE
25: 406 841 -0.4705284 -3.0322503 -26.95929 -173.73515               TRUE
26: 419 916 -0.2477825 -2.9523932 -14.19689 -169.15967               TRUE
27: 426 990  0.0000000 -2.8942786   0.00000 -165.82995               TRUE
28: 560 940  0.0000000  2.9224854   0.00000  167.44608               TRUE
29: 667 875  0.0000000  2.5295023   0.00000  144.92981               TRUE
30: 767 772  0.0000000  2.0670298   0.00000  118.43209               TRUE
31: 831 701  0.0000000  1.7436827   0.00000   99.90566               TRUE
32: 793 665 -0.1915390  1.7586750 -10.97437  100.76465               TRUE
33: 737 628 -0.4175587  1.7924179 -23.92435  102.69798               TRUE
34: 697 574 -0.6189636  1.7930998 -35.46400  102.73705               TRUE
35: 865 495  0.0000000  1.7436827   0.00000   99.90566               TRUE```
with successful mapping plotting true for all outline points
bc commented 4 years ago

a perfect glorious match between expected and observed outline location and success parameters: image

bc commented 4 years ago

misalignment of measured datapoints.csv, appears as though it's only a vertical bias offset image

bc commented 4 years ago

image target image

bc commented 4 years ago

issue identified: image both the points and the outline, when run through retistruct's imageJ transformation have 0 as the minimum point. But we know from the raw data that the minY val for the outline was 6: image

and the min Y val for the datapoints was 24 image

bc commented 4 years ago

image

aligned ✅

bc commented 4 years ago

aligns well after refactoring image

bc commented 4 years ago

added outline path image

bc commented 4 years ago

image The azimuthal plot is aligned correctly

bc commented 4 years ago

completed flatplot, nonsmoothed/predicted image

bc commented 4 years ago

looks like a 180 flip after projection image

bc commented 4 years ago

my_retina_figure.pdf reimplemented falciform

bc commented 4 years ago

new tear markup plotter now shows where the datapoints are: image

plus if you zoom in on the PDF, it will show the data measurement indices (row indices from the measurements) image

outline_coordinates.pdf

bc commented 4 years ago

deformation plots image

bc commented 4 years ago

added notes on flatmount for how the retina was reconstructed image

bc commented 4 years ago

image