quantumjot / btrack

Bayesian multi-object tracking
https://btrack.readthedocs.io
MIT License
310 stars 50 forks source link

[BUG] Values in `Optimiser` tab aren't being updated from config #381

Closed paddyroddy closed 11 months ago

paddyroddy commented 11 months ago

Optimiser tab: image

In update_config_from_widgets: seems to be missing relax thresholds https://github.com/quantumjot/btrack/blob/b088dbf5c75b85e1acd7baa246fac971ccdbf7e5/btrack/napari/sync.py#L62-L66

Am I missing something here?

paddyroddy commented 11 months ago

Okay, looks like it might only be one thing missing. Editing issue now.

p-j-smith commented 11 months ago

The widget with the label distance bin size is stored in the attribute BtrackWidget.dist_thresh:

https://github.com/quantumjot/btrack/blob/b088dbf5c75b85e1acd7baa246fac971ccdbf7e5/btrack/napari/widgets/_hypothesis.py#L108

The attribute name is the same used in HypothesisModel, whereas the label is based on the description of the attribute:

https://github.com/quantumjot/btrack/blob/b088dbf5c75b85e1acd7baa246fac971ccdbf7e5/btrack/models.py#L233-L235

Similarly for time bin size:

https://github.com/quantumjot/btrack/blob/b088dbf5c75b85e1acd7baa246fac971ccdbf7e5/btrack/models.py#L236-L238

dist_thresh and time_thresh are both listed in btrack.napari.constants.HYPOTHESIS_THRESHOLDS, and so their values are updated when looping over this list

But you're right that relax is missing in update_config_from_widgets! It used to be part of btrack.napari.constants.HYPOTHESIS_THRESHOLDS but was removed because its widget has a boolean value rather than float and it can no longer be updated when looping over them (since switching away from magicgui). I updated update_widgets_from_config to reflect this, but clearly forgot to update update_config_from_widgets - well spotted!

paddyroddy commented 11 months ago

Fixed in #378