Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_line_plugin crashed finding nearest point #219

Open
raacampbell opened this issue Jun 24, 2019 · 0 comments
Open

add_line_plugin crashed finding nearest point #219

raacampbell opened this issue Jun 24, 2019 · 0 comments
Labels
bug priority these issues should be dealt with sooner rather than later

Comments

@raacampbell
Copy link
Collaborator

Added two tracks. Went to add third one: clicked the point and added it. Then the plugin crashed Lasagna with error:

Error running plugin method <bound method plugin.hook_axisClicked of <add_line_plugin.plugin object at 0x1373d19d8>>; main error operands could not be broadcast together with shapes (0,) (1,3) 
Traceback (most recent call last):
  File "/Users/rob/Dropbox (UCL - SWC)/work/Anatomy/code/lasagna/lasagna/lasagna_object.py", line 1077, in axisClicked
    self.runHook(self.hooks["axisClicked"], self.axes2D[axis_id])
  File "/Users/rob/Dropbox (UCL - SWC)/work/Anatomy/code/lasagna/lasagna/lasagna_object.py", line 418, in runHook
    hook(*args)
  File "/Users/rob/work/Anatomy/code/lasagna/lasagna/plugins/annotation_plugins/add_line_plugin.py", line 146, in hook_axisClicked
    self.get_points_coord(), hLightCoords
  File "/Users/rob/work/Anatomy/code/lasagna/lasagna/plugins/annotation_plugins/add_line_plugin.py", line 224, in find_nearest_point_in_array
    delta = np.sum((array_to_search - vector_to_find) ** 2, axis=1) ** 0.5
ValueError: operands could not be broadcast together with shapes (0,) (1,3)

Seems like the point was not yet added to the array. Odd that I've not seen this bug before.

@raacampbell raacampbell added bug priority these issues should be dealt with sooner rather than later labels Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority these issues should be dealt with sooner rather than later
Projects
None yet
Development

No branches or pull requests

1 participant