Retrieve images by their IDs via OMERO python binding

Hi,

For my image analysis I need to work on two images simultaneously in one python script. Is there any way to retrieve two images by their Image Ids simultaneously in OMERO? I mean for example, instead of asking for one Image ID when running python script in OMERO server, asks for two IDs (Please look at the attachment)?

Doc1.pdf (22.5 KB)

Thanks for your help.
Pegah

Hi @Pegah, is your script available publicly e.g. on GitHub?
For multiple input values, have you tried using scripts.List as in omero-scripts/Combine_Images.py at bafb131694b68b590e78e71152ea959dff2a9be2 · ome/omero-scripts · GitHub for instance?

Hi @s.besson , Thank you very much for your reply. No my script is not available on GitHub. But I have a script which needed at Least load two Images from OMERO and compare for example their contrast and also doing some analysis. This is the way I used to load just one image by asking for its Image ID, and also using “scripts.Long(“ImageId”, optional=False))”. I will have look on script.List too.

imageId = client.getInput(“ImageId”, unwrap=True) # unwrap the rtype
print(imageId)

get the Image Id from the parameters.

image = conn.getObject(“image”,imageId)
dataset = image.getParent()

print(image.getName(), image.getDescription())

Thanks.
Pegah

1 Like

Hi @s.besson,

My issue has been solved by using " script.List" and of course help of my colleague.

Thanks.
Pegah

Fantastic, thanks for confirming and updating this topic.