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.
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_scalesare defined as 'The scale to apply to the spatial dims. Defaults to None.' and thescaled_unitsas 'The units of the spatial dims after scaling. Defaults to None.'However, in our
Tracksobject, we assume the positional coordinates to be world coordinates, and we use thescaleattribute for scaling theTrackLabelslayer accordingly (theTrackPointslayer 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 asaxis_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_scalesand avoid confusion, I think we should always export position information as pixel coordinates (so divided by tracks.scale), and multiply by theaxis_scaleswhen we import a geff.