Skip to content

Support custom axis names in GEFF node property I/O - #7

Merged
ksugar merged 4 commits into
mainfrom
custom-axis-names
Jul 5, 2026
Merged

Support custom axis names in GEFF node property I/O#7
ksugar merged 4 commits into
mainfrom
custom-axis-names

Conversation

@ksugar

@ksugar ksugar commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Node property paths for time and spatial coordinates (t, x, y, z) are
    now resolved from the axis names declared in GeffMetadata rather than being
    hardcoded. A GEFF file whose axes are named frame, cell_x, cell_y will be
    read and written correctly without any special handling by the caller.
  • Falls back to the standard names (t, x, y, z) when no axes are defined
    in metadata, preserving full backward compatibility.
  • Handles 2D datasets transparently: when fewer than three spatial axes are declared,
    z is neither read nor written.
  • Adds two convenience methods to GeffMetadata:
    • getAxisNameByType(String type) – name of the first axis matching the given type
    • getAxisNamesByType(String type) – names of all axes matching the given type, in declaration order
  • Updates README with a description of the feature, annotated Data Format tree, and a
    usage example showing a round-trip with non-standard axis names.

Tests completed

  • All 43 unit tests pass (mvn test), including a new round-trip test
    (testCustomAxisNames) covering write and read with axes named frame, cell_x,
    cell_y.
  • Cross-language round-trip tests pass (cd cross-language-tests && uv run run_tests.py).

tinevez and others added 4 commits June 27, 2026 16:01
If we try to open a GEFF file, e.g. generated with pycellin, the
position props names are not neceaarily x, y, z, t. The names are
defined in the 'axes' properties, which we need to read.

- Add getAxisNameByType() and getAxisNamesByType() methods to GeffMetadata
- Modify GeffNode.readFromN5() to read coordinates from dynamic axis paths
- Modify GeffNode.writeToN5() to write coordinates to dynamic axis paths
- Add test for custom axis names (frame, cell_x, cell_y instead of t, x, y, z)
- Maintain backward compatibility with standard axis names

Fixes issue where GEFF files with non-standard axis names (e.g.,
'frame' instead of 't', 'cell_x' instead of 'x') could not be read.

Did this in part with Claude
Document that node property paths for time and spatial coordinates are
resolved from the axis names declared in GeffMetadata rather than being
hardcoded to "t", "x", "y", "z".

- Add "Custom axis names" feature bullet explaining the fallback behaviour
- Update GeffNode description to mention axis-aware I/O
- Add getAxisNameByType() / getAxisNamesByType() to GeffMetadata description
- Annotate the Data Format file-tree to show paths as <t>/<x>/<y>/<z>
  with a note that names come from the axes array in metadata
- Add usage example showing round-trip with custom axis names
  ("frame", "cell_x", "cell_y")
@ksugar
ksugar merged commit 92e542b into main Jul 5, 2026
1 check passed
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.

2 participants