Retrieving image name
Posted: Mon May 05, 2014 11:02 pm
Using the API I know I can retrieve the image name from the image object, i.e.
Now, when I try to retrieve the image name from the list of children from a dataset
produces the output
Since the names should the filenames at import, am I using the methods incorrectly? Is this an error? I don't have the same issue trying to retrieve the names of datasets or projects.
- Code: Select all
In [11]: iid = 1
In [12]: img = conn.getObject( 'Image', iid )
In [13]: img.getId()
Out[13]: 1L
In [14]: img.getName()
Out[14]: 'cell10_ome.tif'
Now, when I try to retrieve the image name from the list of children from a dataset
- Code: Select all
list_of_images = []
# connect as above
for project in conn.listProjects():
for dataset in project.listChildren():
links = dataset.getChildLinks()
for image in links:
temp = {}
temp['iid'] = long(image.getId())
temp['name'] = image.getName()
list_of_images.append( temp )
print json.dumps( list_of_images )
produces the output
- Code: Select all
omero@developers:/usr0/local/OMERO/OMERO.server-5.0.0-ice34-b19/lib/scripts/omero_scripts$ omero script launch 298
Using session a882c5b3-9557-4808-b2cf-11f631688333 (icaoberg@localhost:4064). Idle timeout: 10.0 min. Current group: murphylab
Job 284 ready
Waiting....
Callback received: FINISHED
*** start stdout (id=303)***
* [{"iid": 1, "name": null}, {"iid": 2, "name": null}, {"iid": 3, "name": null}, {"iid": 4, "name": null}, {"iid": 5, "name": null}, {"iid": 6, "name": null}, {"iid": 7, "name": null}]
*
*** end stdout ***
Since the names should the filenames at import, am I using the methods incorrectly? Is this an error? I don't have the same issue trying to retrieve the names of datasets or projects.