Closed will-moore closed 1 year ago
Hi @will-moore ! You shouldn't need a "t" key in the properties table. Are you able to a code snippet to help debug?
This seems to do the trick:
viewer = napari.Viewer()
tracks = [
[0, 1, 39.92264938, 109.31625366, 307.4147644],
[0, 2, 39.49820709, 113.88571167, 309.51132202],
[0, 3, 39.99920273, 111.54975128, 315.68569946],
[0, 4, 40.12161255, 112.83349609, 321.04629517],
[0, 5, 42.20673752, 115.65319824, 332.90838623],
[0, 6, 42.50518417, 117.12906647, 328.36157227],
]
viewer._add_layer_from_data(tracks, {}, "tracks")
napari.run()
Then launch the arboretum plugin and double-click on the track:
Yes - I can reproduce this.
It seems to stem from this line: https://github.com/lowe-lab-ucl/arboretum/blob/ae378b9687df550aef9b1c6e6328869fe12cf478/napari_arboretum/visualisation/base_plotter.py#L180
I'll take a look and try to fix this
@will-moore - this should be fixed on main now (over at https://github.com/lowe-lab-ucl/arboretum). Let us know if it doesn't work!
Looks good, thanks!
Thanks for creating this plugin!
If I create tracks in napari without any
properties
or if theproperties
are missing a"t"
value, I get an error when I click on a track.I don't see that requirement documented anywhere. Is this really essential?
Key Error stack trace
``` KeyError Traceback (most recent call last) File ~/opt/anaconda3/envs/ssbd/lib/python3.9/site-packages/pandas/core/indexes/base.py:3802, in Index.get_loc(self=Index(['id', 'entity', 'name', 'sphericity', 'volume', 'track_id'], dtype='object'), key='t', method=None, tolerance=None) 3801 try: -> 3802 return self._engine.get_loc(casted_key) casted_key = 't' self = Index(['id', 'entity', 'name', 'sphericity', 'volume', 'track_id'], dtype='object') 3803 except KeyError as err: File ~/opt/anaconda3/envs/ssbd/lib/python3.9/site-packages/pandas/_libs/index.pyx:138, in pandas._libs.index.IndexEngine.get_loc() File ~/opt/anaconda3/envs/ssbd/lib/python3.9/site-packages/pandas/_libs/index.pyx:165, in pandas._libs.index.IndexEngine.get_loc() File pandas/_libs/hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item() File pandas/_libs/hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: 't' The above exception was the direct cause of the following exception: KeyError Traceback (most recent call last) File ~/opt/anaconda3/envs/ssbd/lib/python3.9/site-packages/vispy/app/backends/_qt.py:522, in QtBaseCanvasBackend.mouseDoubleClickEvent(self=