Skip to content

Coordinates should be stored as pixel coordinates when exported to geff? #261

Description

@AnniekStok

We seem to have a misinterpretation in the way we export the positional coordinates and axis scales compared to how the geff spec dictates it.

According to the geff documentation, the axis_scales are defined as 'The scale to apply to the spatial dims. Defaults to None.' and the scaled_units as 'The units of the spatial dims after scaling. Defaults to None.'

However, in our Tracks object, we assume the positional coordinates to be world coordinates, and we use the scale attribute for scaling the TrackLabels layer accordingly (the TrackPoints layer is in world coordinates and thus never scaled).
But, when we export to geff, we export the world coordinates as is, without axis_units, but we also include the scaling parameter as axis_scales.

Because of this, someone who would import our geff in a different application, would probably wrongly apply the scaling to the coordinates that are already in world coordinates.

We have the same problem when we import a geff: we do not apply the scaling that is provided to the coordinates (we only scale the labels layer), because we assume the coordinates to be world coordinates already. I recently got a geff from someone that was in pixel coordinates + scaling and it did not import correctly because of this.

To align with the geff definition of axis_scales and avoid confusion, I think we should always export position information as pixel coordinates (so divided by tracks.scale), and multiply by the axis_scales when we import a geff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working❓ needs scopeA conceptual issue that needs further consideration for how to implement

    Type

    No type

    Projects

    Status
    Future

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions