Access images from instrument Id - follow up

I still have an issue, I can’t get images outside of my group - the queryService does not seem to inherit the connection’s settings?

For future reference:

def get_images_from_instrument(instrument_id, conn):
    """Returns a list of images ids
    """
    conn.SERVICE_OPTS.setOmeroGroup("-1")
    params = omero.sys.Parameters()
    params.map = {"instrument": rlong(instrument_id)}
    queryService = conn.getQueryService()
    images = queryService.projection(
        "select i.id from Image i where i.instrument.id=:instrument", params
    )
    return [im[0].val for im in images]

Hi,

You need to include the conn.SERVICE_OPTS as the last argument in the projection() call:

images = queryService.projection(
        "select i.id from Image i where i.instrument.id=:instrument", params,
        conn.SERVICE_OPTS
    )

Hope that helps,
Will.

It works, thanks a lot Will

Guillaume