Hi,
I was trying to retrieve an image by ImageID using the online sample code. Jpg files was downloaded successfully, however, it failed while downloading .mrc file.
In some cases, it did not give me any error but it stops working without any respond. But some times it give me the following error:
Traceback (most recent call last):
File "testFetch.py", line 36, in <module>
renderedImage.save("/home//mine/tomo121700.mrc")
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1423, in save
raise KeyError(ext) # unknown extension
KeyError: '.mrc'
Since downloading mrc files are critical to my project, could you please help me!
Following is the code which I tried.
conn = BlitzGateway(user, password, host="omero.ohsu.edu")
conn.connect()
imageId=16353
image = conn.getObject("Image", imageId)
print "\nImage:%s" % imageId
# Retrieve information about an image.
print " X:", image.getSizeX()
print " Y:", image.getSizeY()
print " Z:", image.getSizeZ()
print " C:", image.getSizeC()
print " T:", image.getSizeT()
# render the first timepoint, mid Z section
z = image.getSizeZ() / 2
t = 0
renderedImage = image.renderImage(z, t)
#renderedImage.show()
renderedImage.save("Tomo37.mrc")
conn._closeSession()
Best regards,
pz3977