Hah - Josh beat me to this one. Here's what I was going to post...
I can only answer your second question just now...
Since the nominal magnification will be in the objective database table, you can search for matching images using a custom query from the query service...
- Code: Select all
nominalMag = 40
params = omero.sys.Parameters()
params.map = {"nomMag": rint(nominalMag)}
query = "select i from Image i join fetch i.objectiveSettings as objS join fetch objS.objective as ob where ob.nominalMagnification=:nomMag"
# if you don't need to retrieve the objective itself, you can leave out the 'fetch' like this...
#query = "select i from Image i join i.objectiveSettings as objS join objS.objective as ob where ob.nominalMagnification=:nomMag"
images = qs.findAllByQuery(query, params);
for i in images:
print i.getName().getValue()
# if you have 'fetched' the objective above, you will have that data
print i.objectiveSettings.objective.manufacturer.val
print i.objectiveSettings.objective.lensNA.val
Hopefully someone else can help with the Lucene query. But I should warn you that setting options in one of the parameters of a script cannot be done before the script is run. Once the script has started running (and you do your Lucene query) you cannot then set the options for a parameter and present that UI to a user. There is no user interaction in the scripting service. It's fire and forget!
Will.