We're Hiring!

Exporter/export to tiff

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please 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

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Exporter/export to tiff

Postby icaoberg » Wed Oct 06, 2010 7:11 pm

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?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Exporter/export to tiff

Postby jmoore » Wed Oct 06, 2010 8:46 pm

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.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Exporter/export to tiff

Postby icaoberg » Thu Oct 07, 2010 6:33 pm

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
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Exporter/export to tiff

Postby jmoore » Thu Oct 07, 2010 6:43 pm

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.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Exporter/export to tiff

Postby icaoberg » Thu Oct 07, 2010 6:57 pm

well i am using the demo/demo account to test this. should that be an issue?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Exporter/export to tiff

Postby jmoore » Thu Oct 07, 2010 7:06 pm

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.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Exporter/export to tiff

Postby icaoberg » Wed Oct 13, 2010 4:53 pm

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.
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Exporter/export to tiff

Postby jmoore » Wed Oct 13, 2010 4:56 pm

Nope, sorry, I didn't get a similar error. Let us know how it goes.
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest