segmentation_shape metadata reformat - #260
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
==========================================
+ Coverage 93.92% 93.94% +0.02%
==========================================
Files 59 59
Lines 3326 3337 +11
==========================================
+ Hits 3124 3135 +11
Misses 202 202 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
204388f to
c0af650
Compare
|
Can we add an API in tracksdata for saving and loading segmentation metadata (shape and voxel size?). Then, we don't need to depend on internal tracksdata implementation details, and tracksdata can change where this info is stored at any time. |
|
Hi @cmalinmayor, good point! I made the following changes:
Some other changes along the way:
|
| ) | ||
|
|
||
|
|
||
| @pytest.mark.skip( |
There was a problem hiding this comment.
Why skip instead of delete?
There was a problem hiding this comment.
I had claude explain it but I still curious. i think given my backward compat concerns we should just keep them for one more release
There was a problem hiding this comment.
Agreed, I made it a skip
cmalinmayor
left a comment
There was a problem hiding this comment.
To ensure no breaking motile_tracker:
Write both keys for one release cycle. On write, set both graph.metadata["shape"] (new,
tracksdata-aligned) and keep _update_metadata(segmentation_shape=...) (old, what
motile_tracker's solve.py/motile_run.py still write and read). This is a superset of what
the PR already does — right now it only reads the old key, it doesn't write it. If you
additionally keep writing the old key for a release or two:
- motile_tracker's main keeps working unmodified against the new funtracks release (its
writes still land in the old key, its reads still find the old key). - New tracksdata-based tools get the new key immediately.
- You then update motile_tracker at your own pace (not tied to this PR/release), switching
it to graph.metadata["shape"], and only after that ships do you drop the old-key write
from funtracks.
This is the standard "dual-write, single-read-with-fallback, then cleanup" migration —
it's more code churn than a single clean cutover, but it decouples the two repos' release
trains, which is what you're actually trying to buy.
|
Hi @cmalinmayor, I agree with your solution, and keep both writes (the old and the new). This also means that all the old tests can stay intact, apart from 1 single change. |
connected to: funkelab/motile_tracker#459
Problem:
.extra.tracksdata.shapesegmentation_shapeat the top level (outside the geff metadata)Solution:
This PR removes the
segmentation_shapelogic, and fully uses the existing tracksdata format of saving the shape inmetadata.extra.tracksdata.shape. When reading the shape from the metadata we do a double check for backwards compatibility.For geffs that are exported from motile_tracker and then imported, it doesn't matter where we save the shape, because that is an internal discussion. But for geffs exported by other tracksdata-based tracking tools (ultrack, hoct, etc.), we are now natively compatible.
I will implement the accompanying changes in motile_tracker in a separate PR there