Skip to content

Instantly share code, notes, and snippets.

@sbesson
Created March 18, 2016 00:01
Show Gist options
  • Select an option

  • Save sbesson/867f9ca2f1802b867cbc to your computer and use it in GitHub Desktop.

Select an option

Save sbesson/867f9ca2f1802b867cbc to your computer and use it in GitHub Desktop.
MATLAB snippet for creating an OME-XML to be used for BinaryOnly OME-TIFF (e.g. with a companion metadata file)
% Create OME-XML metadata object
OMEXMLService = loci.formats.services.OMEXMLServiceImpl();
metadata = OMEXMLService.createOMEXMLMetadata();
% Create the root object
metadata.createRoot();
% Set the UUID for the OME-TIFF
ometiff_uuid = char(java.util.UUID.randomUUID);
metadata.setUUID(ometiff_uuid);
% Set the UUID and filename of the companion metadata file
companion_uuid = char(java.util.UUID.randomUUID);
metadata.setBinaryOnlyMetadataFile('name.companion.file');
metadata.setBinaryOnlyUUID(companion_uuid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment