use of ome.xml.meta.OMEXMLMetadataRoot in project bioformats by openmicroscopy.
the class OMETiffWriter method getBinaryOnlyOMEXML.
private String getBinaryOnlyOMEXML(String file, String companion, String companionUUID) throws FormatException, IOException, DependencyException, ServiceException {
ServiceFactory factory = new ServiceFactory();
OMEXMLService service = factory.getInstance(OMEXMLService.class);
OMEXMLMetadata meta = service.createOMEXMLMetadata();
String uuid = "urn:uuid:" + getUUID(new Location(file).getName());
meta.setUUID(uuid);
meta.setBinaryOnlyMetadataFile(new Location(companion).getName());
meta.setBinaryOnlyUUID(companionUUID);
OMEXMLMetadataRoot root = (OMEXMLMetadataRoot) meta.getRoot();
root.setCreator(FormatTools.CREATOR);
return service.getOMEXML(meta);
}
use of ome.xml.meta.OMEXMLMetadataRoot in project bioformats by openmicroscopy.
the class OMETiffWriter method getOMEXML.
private String getOMEXML(String file) throws FormatException, IOException {
// generate UUID and add to OME element
String uuid = "urn:uuid:" + getUUID(new Location(file).getName());
omeMeta.setUUID(uuid);
OMEXMLMetadataRoot root = (OMEXMLMetadataRoot) omeMeta.getRoot();
root.setCreator(FormatTools.CREATOR);
String xml;
try {
xml = service.getOMEXML(omeMeta);
} catch (ServiceException se) {
throw new FormatException(se);
}
return xml;
}
Aggregations