Could anyone teach me how to get the image IDs, dataset ID, and project ID that I selected in the Workspace of OMERO.insight?
?
To retrieve the ID of the selected objects in insight, then look at the methods I mentioned in an early post.
Objects are not marked on the server as selected. So you will have to start from insight and pass those IDs to your python script.
Your script should have a method like the one below. Follow some pseudo-code
- Code: Select all
def runAsScript():
"""
The main entry point of the script, as called by the client via the scripting service, passing the required parameters.
"""
client = scripts.client('BK.py', """Description goes here""",
scripts.List("Image_IDs", optional=False, description="List of image IDs.").ofType(rlong(0)),
...
authors = ["BK", " Team"],
)
try:
session = client.getSession();
gateway = session.createGateway();
commandArgs = {}
# process the list of args above.
for key in client.getInputKeys():
if client.getInput(key):
commandArgs[key] = client.getInput(key).getValue()
print commandArgs
# call the main script here
client.closeSession()
if __name__ == "__main__":
runAsScript()
You can invoke your python script from insight. Look at the method in OMEROGateway.java
- Code: Select all
ScriptCallback runScript(ScriptObject script)
jmarie