Page 1 of 1

Exporter/export to tiff

PostPosted: Wed Oct 06, 2010 7:11 pm
by icaoberg
I am writing
Code: Select all
exporter = client.getSession().createExporter()


yet when I try to attach an image
Code: Select all
exporter.addImage( 4311 )


i get this error
Code: Select all
In [25]: exporter.addImage( 4311 )
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/usr0/local/omero.server/OMERO.server-Beta-4.2.0/<ipython console> in <module>()

AttributeError: 'function' object has no attribute 'addImage'


what could be happening?

Re: Exporter/export to tiff

PostPosted: Wed Oct 06, 2010 8:46 pm
by jmoore
Hi Ivan,

could you post your complete example? (Or at least the entire function block?) My guess is that somewhere there's a Matlab/Python mistake with omitted parens.

~Josh.

Re: Exporter/export to tiff

PostPosted: Thu Oct 07, 2010 6:33 pm
by icaoberg
im doing this interactively through the omero shell

Code: Select all
client = omero.client( server, port )
session = client.createSession( user, password )
exporter = client.getSession().createExporter()
exporter.addImage( 4311 ) #4311 is a valid id

Re: Exporter/export to tiff

PostPosted: Thu Oct 07, 2010 6:43 pm
by jmoore
Then perhaps you were, right, Ivan, that something is wrong with your install, because this looks like perfectly fine code:

Configuring:
Code: Select all
In [2]: server = "localhost"

In [3]: port = 4064

In [4]: user = "bk"

In [5]: password = "ome"


and then pasting in your code:

Code: Select all
In [9]: import omero

In [10]: client = omero.client( server, port )

In [11]: session = client.createSession( user, password )

In [12]: exporter = client.getSession().createExporter()

In [13]: exporter.addImage( 4311 ) #4311 is a valid id



I'm not sure what to tell you at this point, other than to try a fresh download and/or build.

Best,
~Josh.

Re: Exporter/export to tiff

PostPosted: Thu Oct 07, 2010 6:57 pm
by icaoberg
well i am using the demo/demo account to test this. should that be an issue?

Re: Exporter/export to tiff

PostPosted: Thu Oct 07, 2010 7:06 pm
by jmoore
Shouldn't be, no. The error you were getting (" 'function' object has no attribute 'addImage' ") says that the variable "exporter" didn't contain an omero.api.ExporterPrx like it should but something else. I was assuming it was the function omero.api.ServiceFactoryPrx.createExporter:
Code: Select all

In [1]: exporter = client.sf.createExporter

In [2]: exporter.addImage( 1 )
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/<ipython console> in <module>()

AttributeError: 'function' object has no attribute 'addImage'

In [3]:



But something larger may be going on.
~J.

Re: Exporter/export to tiff

PostPosted: Wed Oct 13, 2010 4:53 pm
by icaoberg
did you get a similar error? anyways ill try using the function from script_utils.py and let you know if we have a problem with that.

Re: Exporter/export to tiff

PostPosted: Wed Oct 13, 2010 4:56 pm
by jmoore
Nope, sorry, I didn't get a similar error. Let us know how it goes.
~Josh.