[ome-devel] Fiji OMERO access from non default group.

Dominik Lindner (Staff) d.lindner at dundee.ac.uk
Mon May 13 14:27:45 BST 2019


Hi Ian,

as Mark already said, there is unfortunately no method yet in the Java Gateway
to directly request objects across groups. But some services of the underlying
Java API allow to do that by setting a parameter "omero.group" to "-1".
You could use the QueryService like:

Map<String, String> m = Collections.singletonMap("omero.group", "-1");
IQueryPrx service = gateway.getQueryService(ctx);
IObject result = service.findByQuery("select i from Image i where i.id<http://i.id>="+imageId, null, m);
ImageData img = new ImageData((ImageI)result);

This would work for Dataset etc. too. I'd recommend to wrap the IObject
into the appropriate Gateway class (e.g. DatasetI into DatasetData). When
loading objects with this method you have to keep in mind that they are shallow
loaded, so methods like img.getAnnotations() won't work (or Dataset.getImages(),
etc. )

If you subsequently want to do something with the image, you'd have to work
with the right group, e. g. with a new SecurityContext like:

SecurityContext imgCtx = new SecurityContext(img.getGroupId());

I'll put this issue on the ToDo list for the Java Gateway, there should be an easier
way to do this.

With respect to the 'scripts repository': We don't have a specific repository
for user generated scripts. The scripts we use in the workshops are in
https://github.com/ome/training-scripts . Please feel free to add your scripts
to ome/training-scripts/practical . We'd like to see more user contributed
scripts there.

Kind Regards,
Dominik


On 10 May 2019, at 12:02, Ian Dobbie <ian.dobbie at bioch.ox.ac.uk<mailto:ian.dobbie at bioch.ox.ac.uk>> wrote:

Hi,

Not sure if this should be in Devel or users list, sorry if it is in the
wrong place.


I have a script that accesses images from OMERO in Fiji from a dataset,
defined by the datasetID. If this data is in your default group this
works fine. If it is in another group, which you are a member of, then
this fails unless you also call

SecurityContext(group_id)

I have the data ImageID and am able to access the image but my code
fails unless I set the correct security context. Is there any way to
automatically find the correct Security Context to remove the need to
find the correct groupID manually before running the code?


As an additional point is there a central repository for user generated
Fiji (imageJ) scripts to automate analysis of data?


Thanks,

Ian
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
https://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20190513/fbcb367f/attachment.html>


More information about the ome-devel mailing list