<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Ian,
<div class=""><br class="">
</div>
<div class="">as Mark already said, there is unfortunately no method yet in the Java Gateway </div>
<div class="">to directly request objects across groups. But some services of the underlying </div>
<div class="">Java API allow to do that by setting a parameter "omero.group" to "-1".</div>
<div class="">You could use the QueryService like:</div>
<div class=""><br class="">
</div>
<div class="">Map<String, String> m = Collections.singletonMap("omero.group", "-1");<br class="">
IQueryPrx service = gateway.getQueryService(ctx);<br class="">
IObject result = service.findByQuery("select i from Image i where <a href="http://i.id" class="">
i.id</a>="+imageId, null, m);<br class="">
ImageData img = new ImageData((ImageI)result);</div>
<div class=""><br class="">
</div>
<div class="">This would work for Dataset etc. too. I'd recommend to wrap the IObject </div>
<div class="">into the appropriate Gateway class (e.g. DatasetI into DatasetData). When </div>
<div class="">loading objects with this method you have to keep in mind that they are shallow </div>
<div class="">loaded, so methods like img.getAnnotations() won't work (or Dataset.getImages(),</div>
<div class="">etc. )</div>
<div class=""><br class="">
</div>
<div class="">If you subsequently want to do something with the image, you'd have to work </div>
<div class="">with the right group, e. g. with a new SecurityContext like:</div>
<div class=""><br class="">
</div>
<div class="">SecurityContext imgCtx = new SecurityContext(img.getGroupId());</div>
<div class=""><br class="">
</div>
<div class="">I'll put this issue on the ToDo list for the Java Gateway, there should be an easier </div>
<div class="">way to do this.</div>
<div class=""><br class="">
</div>
<div class="">With respect to the 'scripts repository': We don't have a specific repository </div>
<div class="">for user generated scripts. The scripts we use in the workshops are in </div>
<div class=""><a href="https://github.com/ome/training-scripts" class="">https://github.com/ome/training-scripts</a> . Please feel free to add your scripts </div>
<div class="">to ome/training-scripts/practical . We'd like to see more user contributed </div>
<div class="">scripts there.</div>
<div class=""><br class="">
</div>
<div class="">Kind Regards,</div>
<div class="">Dominik</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 10 May 2019, at 12:02, Ian Dobbie <<a href="mailto:ian.dobbie@bioch.ox.ac.uk" class="">ian.dobbie@bioch.ox.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi,<br class="">
<br class="">
Not sure if this should be in Devel or users list, sorry if it is in the<br class="">
wrong place.<br class="">
<br class="">
<br class="">
I have a script that accesses images from OMERO in Fiji from a dataset,<br class="">
defined by the datasetID. If this data is in your default group this<br class="">
works fine. If it is in another group, which you are a member of, then<br class="">
this fails unless you also call<br class="">
<br class="">
SecurityContext(group_id)<br class="">
<br class="">
I have the data ImageID and am able to access the image but my code<br class="">
fails unless I set the correct security context. Is there any way to<br class="">
automatically find the correct Security Context to remove the need to<br class="">
find the correct groupID manually before running the code?<br class="">
<br class="">
<br class="">
As an additional point is there a central repository for user generated<br class="">
Fiji (imageJ) scripts to automate analysis of data?<br class="">
<br class="">
<br class="">
Thanks,<br class="">
<br class="">
Ian<br class="">
_______________________________________________<br class="">
ome-devel mailing list<br class="">
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" class="">ome-devel@lists.openmicroscopy.org.uk</a><br class="">
https://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>