If you look in the Insight or Web client, run a script Util_Scripts > Dataset_To_Plate, you will see how to create a plate from a series of images.
Demo Movie:
http://cvs.openmicroscopy.org.uk/snapsh ... -4.3.2.movYou can access the script from the run-script dialog (bottom left of dialog - "View Script") or look at the code:
https://github.com/openmicroscopy/openm ... o_Plate.pyBut really I think all you want to do is switch the column and row values on each well.
In fact, the code below almost does what you want:
- Code: Select all
import omero.clients
from omero.gateway import BlitzGateway
from omero.rtypes import rint
user = 'root'
pw = 'ome'
host = 'localhost'
conn = BlitzGateway(user, pw, host=host, port=4064)
conn.connect()
pId = 57
plate = conn.getObject("Plate", pId)
wells = []
for well in plate.listChildren():
c = well.column
r = well.row
print r, c
well._obj.column = rint(r)
well._obj.row = rint(c)
wells.append(well._obj)
conn.getUpdateService().saveArray(wells)
The only problem is that the Save action generates a ValidationException since when you try to swap the position of 2 wells, you try to save one of them in position that is already occupied. It is not valid to have two wells in the same position in a Plate!
You may be able to get around this by first saving all the wells to vacant position E.g. column = 100+column, then placing them back in the desired location. I'll try and think of a nicer solution....!