Hi,
Is it possible to retrieve image metadata (as channel name, resolution …) from ImageData loaded on OMERO server using java. May be as OMEXMLService from image file ???
An other question when I try to retrieve projects from connected user I get all projects from the group. I tried with ctx = new SecurityContext(user.getGroupId()); and ctx = new SecurityContext(user.geId()); .
without success
Thanks
Philippe
Hi Philippe,
if you’re using the Java Gateway you can get various metadata with the methods of the ‘MetadataFacility’, e.g.
MetadataFacility mf = gateway.getFacility(MetadataFacility.class);
ImageAcquisitionData acData = mf.getImageAcquisitionData(ctx, imageId);
System.out.println(acData.getObjective().getManufacturer());
for(ChannelData ch : mf.getChannelData(ctx, imageId)) {
System.out.println(ch.getIndex()+" "+ch.getChannelLabeling());
}
Using the ‘BrowseFacility’ you can get the Projects for a specific user like this:
ExperimenterData exp = gateway.connect(credentials);
SecurityContext ctx = new SecurityContext(exp.getGroupId()); // SecurityContext is group specific
//...
BrowseFacility bf = gateway.getFacility(BrowseFacility.class);
for (ProjectData proj : bf.getProjects(ctx, exp.getId())) {
System.out.println(proj.getName());
for (DatasetData ds : proj.getDatasets())
System.out.println(ds.getName());
}
For more information see: https://docs.openmicroscopy.org/omero/5.6.1/developers/Java.html
Kind Regards,
Dominik
Thanks for the info.
Philippe