ome / omero-iviewer

An OMERO.web app allowing to view images
https://www.openmicroscopy.org/omero/iviewer/
Other
18 stars 29 forks source link

Units in planeInfo #385

Closed jburel closed 3 years ago

jburel commented 3 years ago

image from idr0113 do not have time information The time is given in days so I used time.setUnit(omero.model.enums.UnitsTime.DAY) Unfortunately the units is not taken into account by the viewer and the time is indicated in seconds

In the screenshot below it should be 8 days not 8 seconds

Screenshot 2021-07-01 at 17 04 22
sbesson commented 3 years ago

Cross-linking to https://github.com/ome/omero-iviewer/pull/343#issuecomment-679938990 where the issue has been previously mentioned.

As per

https://github.com/ome/omero-iviewer/blob/83826494c949a344fd69e9ba1b91d64d443cdf70/plugin/omero_iviewer/views.py#L578-L593

only a subset of the length/time units are currently handled

jburel commented 3 years ago

see https://github.com/ome/omero-iviewer/pull/343#issuecomment-679938990

jburel commented 3 years ago

The method mentioned above format_value_with_units is not iviewer specific figure for example will need something similar to handle time for timelapse figure

will-moore commented 3 years ago

For testing, I used this script to convert all time units to DAY for a test image:

import omero
from omero.gateway import BlitzGateway

conn = BlitzGateway('user', 'password', port=4064, host='localhost')
conn.connect()

image_id = 1269
updateService = conn.getUpdateService()
params = omero.sys.ParametersI()
params.addLong('pid', conn.getObject("Image", image_id).getPixelsId())
query = "from PlaneInfo as Info where pixels.id=:pid"
info_list = conn.getQueryService().findAllByQuery(
    query, params, conn.SERVICE_OPTS)
for info in info_list:
    if info.deltaT is not None:
        info.deltaT.setUnit(omero.model.enums.UnitsTime.DAY)
        updateService.saveObject(info)