Skip to content

segmentation_shape metadata reformat - #260

Open
TeunHuijben wants to merge 2 commits into
mainfrom
fix-segmentation-shape
Open

segmentation_shape metadata reformat#260
TeunHuijben wants to merge 2 commits into
mainfrom
fix-segmentation-shape

Conversation

@TeunHuijben

@TeunHuijben TeunHuijben commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

connected to: funkelab/motile_tracker#459

Problem:

  • tracksdata saves segmentation shape in geffmetadata as .extra.tracksdata.shape
  • funtracks/motile_tracker save segmentation shape in zarr-metadata as segmentation_shape at the top level (outside the geff metadata)
  • in retrospect, the latter is not the smartest design decision, because 1) top-level non-geff metadata doesn't survive round-trips, and 2) it is inconsistent with tracksdata

Solution:
This PR removes the segmentation_shape logic, and fully uses the existing tracksdata format of saving the shape in metadata.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

@TeunHuijben
TeunHuijben requested a review from cmalinmayor as a code owner July 24, 2026 23:13
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.78%. Comparing base (38cfa7d) to head (daa236f).

Files with missing lines Patch % Lines
src/funtracks/import_export/geff/_import.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
- Coverage   93.78%   93.78%   -0.01%     
==========================================
  Files          59       59              
  Lines        3285     3282       -3     
==========================================
- Hits         3081     3078       -3     
  Misses        204      204              

☔ View full report in Codecov by Harness.
📢 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.

@TeunHuijben
TeunHuijben force-pushed the fix-segmentation-shape branch from 204388f to c0af650 Compare July 27, 2026 19:37
@TeunHuijben TeunHuijben added the blocked PR blocked by something else label Jul 27, 2026
@TeunHuijben TeunHuijben removed the blocked PR blocked by something else label Jul 28, 2026
@cmalinmayor

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for initial review PR ready for first review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants