Hi Chris,
I'm not sure we can get much further at our end without being able to reproduce.
I've looked at the code path that is producing the strange JSON data for you
- Code: Select all
"unit_x": 0.****************,
and tried Googling for what might be causing that, but it seems that searching for "0.****************" doesn't help much!
If you *can* try this on your OMERO.web server, it would be interesting to see whether you get the same result, but I understand this might be tricky for you to get set up etc.
You should be able to run:
- Code: Select all
$ bin/omero shell --login
Then enter the OMERO.server address and login details.
Then follow the terminal commands below, using the Image ID of the tile006.nd2 image.
- Code: Select all
In [1]: from omero.gateway import BlitzGateway
In [2]: conn = BlitzGateway(client_obj=client)
In [3]: image = conn.getObject("Image", 157104)
In [4]: image.getName()
Out[4]: 'tile006.nd2'
In [5]: px = image.getPrimaryPixels().getPhysicalSizeX()
In [6]: from omeroweb.webgateway.templatetags.common_filters import lengthformat
In [7]: size = image.getPixelSizeX(True)
In [8]: length = size.getValue()
In [9]: length
Out[9]: 0.2262397413186163
In [10]: size
Out[10]:
object #0 (::omero::model::Length)
{
_value = 0.226239741319
_unit = MICROMETER
}
In [11]: x = lengthformat(length)
In [12]: x
Out[12]: 0.2262397413186163
In [13]: import json
In [14]: json.dumps({'unit_x': x})
Out[14]: '{"unit_x": 0.2262397413186163}'
In [15]: from django.http import JsonResponse
In [16]: rsp = JsonResponse({'unit_x': x})
In [17]: rsp.content
Out[17]: '{"unit_x": 0.2262397413186163}'
If you get the "unit_x": 0.**************** here then we will at least have narrowed down the source of the error, if not actually understanding it!
I'll answer the OMERO.figure question on the PR.
Regards,
Will.