ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 30 forks source link

Shape transforms not considered when loading ROIs #358

Open knabar opened 4 years ago

knabar commented 4 years ago

When loading ROIs from OMERO that have shape transformations, the transformations are not applied, which results in them being displayed at incorrect positions or not at all.

As an example, the following image has a couple of rectangle shapes, which are shown correctly using Image viewer:

Screenshot 2019-12-20 at 10 36 52

When loading them in Figure, the following data is loaded; note the X/Y coordinates and Transform:

Screenshot 2019-12-20 at 10 33 07

When adding the rectangle in Figure, the following error is shown:

Screenshot 2019-12-20 at 10 32 47

While this is an extreme example, since X/Y/Transform here could be recalculated so that X/Y is still a point on the rectangle, there is no guarantee some tools won't come up with transformations and resulting coordinates that appear to be outside of the image bounds but are not after the transformation is applied.

The export script already takes rectangle transformations into account, see #306, #315, although transformations for other shape types are probably not applied.