bc / retina

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

Sampling locations and legend don't appear on final map plot #14

Closed lschmitz closed 7 years ago

lschmitz commented 7 years ago

User experienced issues when plotting the retina map with

retinaplot(my_retina)

The resulting map looks like this: screen shot 2017-07-11 at 12 47 29 pm

The sampling locations and the legend are missing.

Error message:

Error in xy[(n - k + 1):n, ] : only 0's may be mixed with negative subscripts

Traceback points to issues within the spline.poly() function:

traceback() 4: rbind(xy[(n - k + 1):n, ], xy, xy[1:k, ]) 3: spline.poly(fc1, 50, k = 10) 2: fit_plot_azimuthal(AZx, AZy, AZz, outer.radius = 1.6, spatial_res = spatial_res, falciform_coords = retina_object$azimuthal_data.falciform[[1]], falc2 = NA, ...) 1: retinaplot(my_retina)

screen shot 2017-07-11 at 12 51 38 pm

briancohn commented 7 years ago

@chisholmie did you get the exact error above? if not post it here please

lschmitz commented 7 years ago

@briancohn yes, exact same error message

lschmitz commented 7 years ago

@briancohn let's add trycatch() for now?

briancohn commented 7 years ago

what's the ID for the retina you are having an issue with? see https://docs.google.com/spreadsheets/d/1PErkzyQUFnJh6wbPqcRAyaMAONLskFUfG0AcK0pVP-8/edit#gid=0

lschmitz commented 7 years ago

3hgbqg

briancohn commented 7 years ago

via plot(falciform_coords$x, falciform_coords$y) while browser() on line 474 plotting_functions.R image falciform process data is weird, looks like the coordinates are less than 1, when they should be pixel values

lschmitz commented 7 years ago

That's odd. Here's the original falc.txt from IJ falc.txt

briancohn commented 7 years ago

this is the falciform_coords output that Pmol_752 looks like

via image

image

752 continues with no problems.

this one is 753: image

briancohn commented 7 years ago

3hgbqg bjii4t jhvbwt 40oik5 8pm223 gv3igs raxp91

lschmitz commented 7 years ago

How does the xy object look like? I'm not sure if the falciform process is the ultimate cause of the issue. => Error in xy[(n - k + 1):n, ]

briancohn commented 7 years ago

got weird error following retistruction of 3hgbqg

2017-07-11 19:36:53.736 R[67857:19062782] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSScreen reconfig must only happen on the main thread.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff946882cb __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fffa949348d objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff9468d042 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x00007fff960d5c80 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
    4   AppKit                              0x00007fff92310485 +[NSScreen _invalidateIfNeededForReason:] + 153
    5   AppKit                              0x00007fff92338554 -[NSApplication _reactToDockChanged] + 46
    6   AppKit                              0x00007fff922c7eaf _NSCoreDockMessageReceive + 954
    7   HIToolbox                           0x00007fff93b97e6d _ZL12DockCallbackjjPvS_ + 2227
    8   HIServices                          0x00007fff932d0159 dockClientNotificationProc + 225
    9   SkyLight                            0x00007fffa60dacfe _ZN12_GLOBAL__N_123notify_datagram_handlerEj15CGSDatagramTypePvmS1_ + 870
    10  SkyLight                            0x00007fffa6207339 CGSSnarfAndDispatchDatagrams + 1724
    11  SkyLight                            0x00007fffa628b93a SLSGetNextEventRecordInternal + 84
    12  SkyLight                            0x00007fffa6214a2a SLEventCreateNextEvent + 50
    13  libXplugin.1.dylib                  0x00000001047daf0c ___xp_init_service_cg_event_port_block_invoke + 104
    14  libdispatch.dylib                   0x00007fffa9d428fc _dispatch_client_callout + 8
    15  libdispatch.dylib                   0x00007fffa9d57a16 _dispatch_continuation_pop + 533
    16  libdispatch.dylib                   0x00007fffa9d4da6c _dispatch_source_latch_and_call + 194
    17  libdispatch.dylib                   0x00007fffa9d4513b _dispatch_source_invoke + 1248
    18  libdispatch.dylib                   0x00007fffa9d587db _dispatch_queue_serial_drain + 443
    19  libdispatch.dylib                   0x00007fffa9d4b306 _dispatch_queue_invoke + 1046
    20  libdispatch.dylib                   0x00007fffa9d5924c _dispatch_root_queue_drain_deferred_item + 284
    21  libdispatch.dylib                   0x00007fffa9d5c27a _dispatch_kevent_worker_thread + 929
    22  libsystem_pthread.dylib             0x00007fffa9f9147b _pthread_wqthread + 1004
    23  libsystem_pthread.dylib             0x00007fffa9f9107d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
lschmitz commented 7 years ago

Well that's a new one!

briancohn commented 7 years ago

image is this where the falciform process should be?

lschmitz commented 7 years ago

Possibly yes, even though if I had to guess I'd place it in the depression just dorsotemporally from its current position. I'd go ahead with the current position and I can verify tomorrow when I have access to the slides (@chisholmie can you take a look early AM?)

briancohn commented 7 years ago

polygon(cbind(falciform_x, falciform_y)) seems to correctly place it here: image

briancohn commented 7 years ago

further success~! image

it appears as though setting K too high will mess up some curves. I set k to the default (3).

K is defined as the number of points to wrap around the ends to obtain

a smooth periodic spline.

this is where I sourced the original spline.poly function https://gis.stackexchange.com/questions/24827/how-to-smooth-the-polygons-in-a-contour-map

briancohn commented 7 years ago

fixed. image

lschmitz commented 7 years ago

YES!!!!!! You just earned co-authorship on that paper. Thank you Brian.

briancohn commented 7 years ago

computed all retinas: retinas_jul10

lschmitz commented 7 years ago

Nice! I notice quite the range of cell densitites!

briancohn commented 7 years ago

image working without use of retistructgui