Describe the bug
There are two related problems with the current implementation of ScatterRegions on the image viewer. In the following, the RegionData region_data has regions describe by (x', y') coordinate pairs and thus centroid attributes x' and y' while the image_data has x and y pixel coordinates (and optionally wx and wy world coordinates).
If the user links x' <-> x and y' <-> y, everything is good. If the user links x' <-> y and y' <-> x (perhaps because the coordinates in region_data come from a data source with ambiguous names (spatial_0 and spatial_1 are common in biology) then the regions will still display correctly on the image, because we only check if the viewer x_att and y_att are in the list of special region centroid coordinates [x',y'] and we only display the regions naively assuming that x_att is the same as x', but subsets defined on the image will select the wrong points on region_data.
If the user switches the x_att and y_att in the ImageViewer options so that x_att = y and y_att = x, the regions will not display correctly.
Probably the same improved logic for checking viewer attributes will work for both these cases, but case 2 will require a transformation of the region geometries (as we currently do for images with world coordinates).
Describe the bug There are two related problems with the current implementation of ScatterRegions on the image viewer. In the following, the
RegionData
region_data has regions describe by (x', y') coordinate pairs and thus centroid attributes x' and y' while the image_data has x and y pixel coordinates (and optionally wx and wy world coordinates).spatial_0
andspatial_1
are common in biology) then the regions will still display correctly on the image, because we only check if the viewer x_att and y_att are in the list of special region centroid coordinates [x',y'] and we only display the regions naively assuming that x_att is the same as x', but subsets defined on the image will select the wrong points on region_data.Probably the same improved logic for checking viewer attributes will work for both these cases, but case 2 will require a transformation of the region geometries (as we currently do for images with world coordinates).