Another followup question. (Hopefully final one on this thread
)
I'd like to make a function that retrieves a table A, create a new table B with copying data from the table A, then save it with a different name. (Of course, the new table file name will be updated in the tagAnnotation, which is shared by everyone in the same group)
The reason why I'm doing this is to let every account update the table (actually creating a new one) by adding each one's new data (I think this is the only way to have a pseudo-"world-writable" OMERO.tables)
So, I want to know how to copy the table and create a new one?
I can retrieve a table by
- Code: Select all
table = conn.getSharedResources().openTable( omero.model.OriginalFileI( fid, False ) ) # fid is the file id of the table
Then If I'm not the owner of the table, I don't think I can directly update the table by
- Code: Select all
num_data = table.getNumberOfRows()
columns = []
columns.append(omero.grid.LongColumn( 'INDEX', 'Data Index', [] ))
columns.append(omero.grid.LongColumn( 'iid', 'Image ID', [] ))
columns.append(omero.grid.LongColumn( 'pixels', 'Pixel Index', [] ))
columns.append(omero.grid.LongColumn( 'channel', 'Channel Index', [] ))
columns.append(omero.grid.LongColumn( 'zslice', 'zSlice Index', [] ))
columns.append(omero.grid.LongColumn( 'timepoint', 'Time Point Index', [] ))
IND = num_data + 1
columns[0].values.append( long(IND) ) #INDEX
columns[1].values.append( long(iid) )
columns[2].values.append( long(pixels) )
columns[3].values.append( long(channel) )
columns[4].values.append( long(zslice) )
columns[5].values.append( long(timepoint) )
table.addData(columns)
table.close()
I guess before I update the table, I think I should copy this table to a newly created table first.
Could you please help me here?
Best,
BK