jni / affinder

Quickly find the affine matrix mapping one image to another using manual correspondence points annotation
https://jni.github.io/affinder/
BSD 3-Clause "New" or "Revised" License
17 stars 13 forks source link

Starting affinder without layers causes Napari to crash #79

Open andreasmarnold opened 11 months ago

andreasmarnold commented 11 months ago

When opening the "Start affinder" widgets without any active layers in the viewer:

import napari

viewer = napari.Viewer()

qtwidget, widget = viewer.window.add_plugin_dock_widget(
        'affinder', 'Start affinder'
        )

napari.run()

I get this error:

Traceback (most recent call last):
  File "C:\Users\arnoldam\custom_code\affinder\examples\error-example.py", line 8, in <module>
    qtwidget, widget = viewer.window.add_plugin_dock_widget(
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\napari\_qt\qt_main_window.py", line 811, in add_plugin_dock_widget
    wdg = _instantiate_dock_widget(
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\napari\_qt\qt_main_window.py", line 1465, in _instantiate_dock_widget
    return wdg_cls(**kwargs)
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\magicgui\type_map\_magicgui.py", line 487, in __call__
    self._widget_init(widget)
  File "C:\Users\arnoldam\custom_code\affinder\src\affinder\affinder.py", line 120, in _on_affinder_main_init
    _update_unique_choices(widget.moving, widget.reference.current_choice)
  File "C:\Users\arnoldam\custom_code\affinder\src\affinder\affinder.py", line 104, in _update_unique_choices
    index = choice_names.index(choice_name)
ValueError: '' is not in list

Process finished with exit code 1