We're Hiring!

saving the Global Metadata

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

saving the Global Metadata

Postby bhcho » Mon Jun 07, 2010 3:31 pm

Hi All,

Is there any API method that can save the original Global Metadata from TIFF file, when I conver a TIFF image to OME-TIFF?

Thanks in advance.

BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: saving the Global Metadata

Postby mlinkert » Wed Jun 09, 2010 8:11 pm

Is there any API method that can save the original Global Metadata from TIFF file, when I conver a TIFF image to OME-TIFF?


Try something like this:

Code: Select all
  IFormatReader reader = new ImageReader();
  IMetadata metadata = MetadataTools.createOMEXMLMetadata();
  reader.setOriginalMetadataPopulated(true);
  reader.setMetadataStore(metadata);
  reader.setId("/path/to/input/file");

  IFormatWriter writer = new ImageWriter();
  writer.setMetadataRetrieve(metadata);
  // calls to writer.saveBytes go here...
User avatar
mlinkert
Team Member
 
Posts: 353
Joined: Fri May 29, 2009 2:12 pm
Location: Southwest Wisconsin

Re: saving the Global Metadata

Postby bhcho » Thu Jun 10, 2010 2:11 pm

The only difference with my code is
reader.setOriginalMetadataPopulated(true);


But even if I include that code, It still does not work.
(Anyway, createOMEXMLMetadata() in loci.formats.MetadataTools has been deprecated. So I just used OMEXMLService instead of MetadataTools).
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 0 guests