jni / jni/affinder

Widget idea: table showing current point coordinates and residuals for each point

Open
#76 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
23
Forks
13
PR merge metrics
No merged PRs in 30d

Description

(Related: #21)

During a pair session today @andreasmarnold came up with what I think is a really good idea: during alignment, have a table widget showing all the points added so far in each layer, together with the associated residuals. Then, one can go back and remove high-residual points from the table, which may have been added less precisely than others. This is easier than manually going through points, especially because the conditions on the "move layers" callback (which alternately bring the reference and moving images and points to the front) are not very sophisticated, and can get weirdly out of sync if you start removing points in the "wrong" order. By removing points in corresponding pairs through the table, we circumvent this issue altogether.

The [magicgui table widget](https://pyapp-kit.github.io/magicgui/generated_examples/demo_widgets/table) might be usable here. It might be a matter of:

- Adding a(n initially empty) table as a return value from the [`start_affinder` function](https://github.com/jni/affinder/blob/e373c44c04db5a4a2e86df5fbc86f72dc075672b/src/affinder/affinder.py#L130-L139)
- Add a callback to add rows to the table as points get added
- Add a callback for when row values get deleted to actually delete the whole row and the corresponding points in the points layers

The last bit is a bit tricky because by default, selecting a row in a magicgui table and pressing backspace clears the row values, rather than deleting the row. We'll have to look at the internal representation of the table to see how easy it is to delete a row "in place". I also expect that people will expect that editing the values in the table actually edits the point coordinates, but let's call that a stretch goal for now. 😂

CC @tlambert03 in case you have some comments about that proposed implementation / the Table widget API. 🙏

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.