Skip to content

Conversation

@cmalinmayor
Copy link
Contributor

@cmalinmayor cmalinmayor commented Jul 29, 2025

Closes #70

Still to do:

  • Mark the TracksController for deprecation
  • Update the TracksController to use the UserActions (including ensuring that the functionality is the same)
    • UserAddNode
    • UserDeleteNode
    • UserAddEdge
    • UserDeleteEdge
    • UserUpdateSegmentation
  • Potentially split out segmentation update from all other basic actions (e.g. add node)

@cmalinmayor cmalinmayor marked this pull request as ready for review September 9, 2025 21:09
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

❌ Patch coverage is 96.32353% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.98%. Comparing base (c56c254) to head (e49c760).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
src/funtracks/data_model/tracks_controller.py 57.14% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #72      +/-   ##
==========================================
+ Coverage   84.20%   88.98%   +4.78%     
==========================================
  Files          12       25      +13     
  Lines        1051     1126      +75     
==========================================
+ Hits          885     1002     +117     
+ Misses        166      124      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cmalinmayor
Copy link
Contributor Author

@AnniekStok There are some breaking API changes here, both in our private Tracks API (maybe more relevant for @TeunHuijben ) and in how finn should call update segmentations in the TracksController.

The TracksController tests definitely did not catch all the bugs, and I see codecov is telling me I should do better, so perhaps this isn't quite ready to merge, but it's definitely ready for you to look at and ask questions/make suggestions.

@cmalinmayor
Copy link
Contributor Author

Related to #83 - I think we can merge this without adding the validation to the actions, but I could be convinced otherwise

Copy link
Collaborator

@AnniekStok AnniekStok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actions seem to work well with finn! 🙂 Just did the one small update you mentioned (PR here: funkelab/finn#104).

Just a few comments/questions that we discussed about already:

  1. Should it be allowed to create an edge between a node and a node belonging to a different track id that already has an incoming edge? Previously we asked the user if they want to delete the existing edge and add a new one, or cancel the operation. Now it is just rejected/ignored.
image
  1. It now seems possible to paint over (with brush or fill bucket) an entire label and thereby replace it with a new node with different track id. Whether by accident or not, I think that is a nice feature.
  2. Painting new nodes with the same track id is not possible anymore. While finn initially displays the correct color, it is replaced with a new color and new track id as soon as you release the mouse.

This allows the user to draw a new node extending an existing track, as before.
This will allow us to promt the user when there is an invalid action, and then re-submit the action with the "force" option. It also sets a framework for doing this type of thing more generally, and having an "always force" setting in finn if the user wants to stop being prompted.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I was testing this I sometimes got this message:
"UserWarning: Edge is rejected because merges are currently not allowed.!" (triggered by the is_valid) function), and sometimes there is no response at all (edge is still rejected). The is_valid function is called before the action is created, so even when we are using the 'force' option, it may not (always) work. But as we discussed we probably want to fix the 'error/warning' handling in a separate PR so maybe it is fine for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I linked your comment in the relevant issue #83 so I don't forget!

Copy link
Collaborator

@AnniekStok AnniekStok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! I can confirm that continuing a track with the same track id also works now 🎉

@cmalinmayor cmalinmayor merged commit deeeff5 into main Sep 17, 2025
9 checks passed
@cmalinmayor cmalinmayor deleted the 70-replace-tracks-controller branch September 17, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace TracksController with UserActions

3 participants