We're Hiring!

OMERO.iviewer can't open file

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Re: OMERO.iviewer can't open file

Postby evenhuis » Mon Mar 18, 2019 9:35 pm

Hi Will,

To see the JSON that iviewer is using, you can go to:

https://omero.research.uts.edu.au/iview ... data/93002


Here's the JSON,

Cheers,

Chris

Code: Select all
{"delta_t_unit_symbol": null, "init_zoom": 0, "tiles": false, "families": ["polynomial", "logarithmic", "linear", "exponential"], "roi_count": 0, "perms": {"canAnnotate": true, "canEdit": true, "canDelete": true, "canLink": true}, "rdefs": {"defaultT": 0, "model": "color", "invertAxis": false, "projection": "normal", "defaultZ": 8}, "pixel_range": [0, 65535], "interpolate": true, "channels": [{"coefficient": 1.0, "active": true, "window": {"max": 4095.0, "end": 4095.0, "start": 20.0, "min": 20.0}, "family": "linear", "color": "0000FF", "inverted": false, "reverseIntensity": false, "emissionWave": 450.0, "label": "Hoechst33258"}, {"coefficient": 1.0, "active": true, "window": {"max": 90.0, "end": 90.0, "start": 26.0, "min": 26.0}, "family": "linear", "color": "FFFFFF", "inverted": false, "reverseIntensity": false, "emissionWave": null, "label": "TD"}], "meta": {"projectName": "Nikon_A1", "imageId": 93002, "imageAuthor": "Mahsa Asadniaye Fard Jahromi", "imageTimestamp": 1540173399.0, "pixelsType": "uint16", "datasetId": 2901, "projectDescription": "", "datasetName": "Mahsa", "wellSampleId": "", "projectId": 970, "imageDescription": "", "wellId": "", "imageName": "tile006.nd2", "datasetDescription": ""}, "id": 93002, "pixel_size": {"symbol_y": "\u00b5m", "symbol_x": "\u00b5m", "symbol_z": "\u00b5m", "unit_y": 0.****************, "unit_x": 0.****************, "unit_z": 10.0, "y": 0.****************, "x": 0.****************, "z": 10.0}, "size": {"width": 1024, "c": 2, "z": 17, "t": 1, "height": 1024}, "split_channel": {"c": {"width": 2054, "gridy": 2, "border": 2, "gridx": 2, "height": 2054}, "g": {"width": 2054, "gridy": 1, "border": 2, "gridx": 2, "height": 1028}}, "import_date": "2018-10-22 02:56:39", "delta_t": []}
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: OMERO.iviewer can't open file

Postby wmoore » Tue Mar 19, 2019 9:31 am

Thanks Chris,
That tallies with what you're seeing earlier in the JS error console.

Were you able to try the
Code: Select all
bin/omero shell --login
stuff to try to reproduce that via python?

Cheers,
Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: OMERO.iviewer can't open file

Postby evenhuis » Wed Mar 20, 2019 6:23 am

Sorry Will,

you're going to have to refresh my memory what the python stuff is

Cheers,

Chris
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: OMERO.iviewer can't open file

Postby manics » Wed Mar 20, 2019 4:48 pm

Hi Chris

Will is away at the moment, but I think he meant the python code from viewtopic.php?f=5&t=8606&start=20#p20694
User avatar
manics
Team Member
 
Posts: 261
Joined: Mon Oct 08, 2012 11:01 am
Location: Dundee

Re: OMERO.iviewer can't open file

Postby evenhuis » Wed Mar 20, 2019 9:00 pm

Sorry I missed that somehow.

I had a go using the OMERO.server install I have on my laptop for doing CLI stuff remotely:

Code: Select all
In [1]: from omero.gateway import BlitzGateway

In [2]: conn = BlitzGateway(client_obj=client)

In [8]: conn.setGroupNameForSession('Warkiani')
Out[8]: True

In [9]: image = conn.getObject("Image", 92826)

In [11]: image.getName()
Out[11]: 'tile006.nd2'

In [12]: px = image.getPrimaryPixels().getPhysicalSizeX()

In [13]: px
Out[13]:
object #0 (::omero::model::Length)
{
    _value = 0.226239741319
    _unit = MICROMETER
}


I run into some errors here
Code: Select all
IIn [14]: from omeroweb.webgateway.templatetags.common_filters import lengthformat
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-14-10432bbcc9cd> in <module>()
----> 1 from omeroweb.webgateway.templatetags.common_filters import lengthformat

/Users/evenhuis/Dropbox/MIF/OMERO/OMERO.server-5.4.9-ice36-b101/lib/python/omeroweb/webgateway/__init__.py in <module>()
     22 #
     23
---> 24 from django.template.base import add_to_builtins
     25
     26 add_to_builtins('omeroweb.webgateway.templatetags.defaulttags')

ImportError: No module named django.template.base

In [15]: size = image.getPixelSizeX(True)

In [16]: length = size.getValue()

In [17]: length
Out[17]: 0.2262397413186163

In [18]: size
Out[18]:
object #0 (::omero::model::Length)
{
    _value = 0.226239741319
    _unit = MICROMETER
}



I thought this might be due I'm on the app server but the same happens on the web server
Code: Select all
In [8]: from omeroweb.webgateway.templatetags.common_filters import lengthformat
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-8-10432bbcc9cd> in <module>()
----> 1 from omeroweb.webgateway.templatetags.common_filters import lengthformat

/Users/evenhuis/Dropbox/MIF/OMERO/OMERO.server-5.4.9-ice36-b101/lib/python/omeroweb/webgateway/__init__.py in <module>()
     22 #
     23
---> 24 from django.template.base import add_to_builtins
     25
     26 add_to_builtins('omeroweb.webgateway.templatetags.defaulttags')

ImportError: No module named django.template.base



Installing Django on my laptop fixed the errors from
Code: Select all
from django.http import JsonResponse
but the
Code: Select all
from django.template.base import add_to_builtins
persists.

I'll try on server later today.

Cheers,

Chris
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: OMERO.iviewer can't open file

Postby evenhuis » Thu Mar 21, 2019 1:08 am

Hi,

looks like I'm missing a library on the OMERO.server I've got on the laptop

here's the python stuff on the app server
Code: Select all
In [1]: from omero.gateway import BlitzGateway

In [2]: conn = BlitzGateway(client_obj=client)

In [5]: conn.setGroupNameForSession('Warkiani')
Out[5]: True

In [6]: image = conn.getObject("Image", 92826)

In [7]: image.getName()
Out[7]: 'tile006.nd2'

In [8]: px = image.getPrimaryPixels().getPhysicalSizeX()

In [9]: from omeroweb.webgateway.templatetags.common_filters import lengthformat

In [10]: size = image.getPixelSizeX(True)

In [11]: length = size.getValue()

In [12]: length
Out[12]: 0.2262397413186163

In [13]: size
Out[13]:
object #0 (::omero::model::Length)
{
    _value = 0.226239741319
    _unit = MICROMETER
}

In [14]: x = lengthformat(length)

In [15]: x
Out[15]: 0.2262397413186163

In [16]: import json

In [17]: json.dumps({'unit_x': x})
Out[17]: '{"unit_x": 0.2262397413186163}'

In [18]: from django.http import JsonResponse

In [19]: rsp = JsonResponse({'unit_x': x})

In [20]: rsp.content
Out[20]: '{"unit_x": 0.2262397413186163}'



I couldn't get the
Code: Select all
/bin
to work when I logged onto the web server for some reason. But I could connect to the web server from the app server

Code: Select all
[omero@prdomeapp01 OMERO.server]$ bin/omero shell --login 119898@omero-web.research.uts.edu.au:4064
Using session for 119898@localhost:4064. Idle timeout: 10 min. Current group: Warkiani
Python 2.7.5 (default, Feb 20 2018, 09:19:12)
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from omero.gateway import BlitzGateway

In [2]: conn = BlitzGateway(client_obj=client)

In [3]: conn.setGroupNameForSession('Warkiani')

In [4]: image = conn.getObject("Image", 92826)

In [5]: image.getName()
Out[5]: 'tile006.nd2'

In [6]: px = image.getPrimaryPixels().getPhysicalSizeX()

In [7]: from omeroweb.webgateway.templatetags.common_filters import lengthformat

In [8]: size = image.getPixelSizeX(True)

In [9]: length = size.getValue()

In [10]: length
Out[10]: 0.2262397413186163

In [11]: size
Out[11]:
object #0 (::omero::model::Length)
{
    _value = 0.226239741319
    _unit = MICROMETER
}

In [12]: x = lengthformat(length)

In [13]: x
Out[13]: 0.2262397413186163

In [14]: import json

In [15]: json.dumps({'unit_x': x})
Out[15]: '{"unit_x": 0.2262397413186163}'

In [16]: from django.http import JsonResponse

In [17]: rsp = JsonResponse({'unit_x': x})

In [18]: rsp.content
Out[18]: '{"unit_x": 0.2262397413186163}'


Cheers,

Chris
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: OMERO.iviewer can't open file

Postby manics » Thu Mar 21, 2019 5:31 pm

Thanks Chris. It looks like the Python API is returning a sensible value so there must be a problem in OMERO.web. Ill see if anyone else can figure out what's happening.
User avatar
manics
Team Member
 
Posts: 261
Joined: Mon Oct 08, 2012 11:01 am
Location: Dundee

Previous

Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest

cron