Page 3 of 4

Re: Edit metadata

PostPosted: Fri Feb 21, 2014 9:58 pm
by gsl1
Online source appears to be viewable at:

view it online

Source appears to be downloadable at:

GIT source

LOCI Bio-Formats Descriptive info

-=> Gregg <=-

Re: Edit metadata

PostPosted: Mon Feb 24, 2014 11:11 am
by jmoore
Hi Gregg,

gsl1 wrote:Online source appears to be viewable at:


The stable (4.4) version of the IMetadata class you're looking for is best found on github: https://github.com/openmicroscopy/bioformats/blob/dev_4_4/components/scifio/src/loci/formats/meta/IMetadata.java, and the overall documentation under https://www.openmicroscopy.org/site/support/bio-formats4/

The upcoming major release (5.0) has moved this class and it is now available on github at https://github.com/openmicroscopy/bioformats/blob/dev_5_0/components/ome-xml/src/ome/xml/meta/IMetadata.java. For full documentation, see https://www.openmicroscopy.org/site/support/bio-formats5/

Cheers,
~Josh

Re: Edit metadata

PostPosted: Tue Feb 25, 2014 1:16 am
by mlinkert
Hi Gonzalo and Gregg,

In addition to what Josh has linked, please note that the IMetadata interface is closely tied to the OME-XML schema, so you may find it useful to reference the schema when reading the interface Javadoc. The schema version used by Bio-Formats 4.4.x is here:

http://www.openmicroscopy.org/Schemas/O ... 06/ome.xsd

and the version used by Bio-Formats 5.0.x is here:

http://www.openmicroscopy.org/Schemas/O ... 06/ome.xsd

If you have questions about what specific IMetadata methods or schema values are used for, or are unsure of which methods to call to set a specific piece of metadata, then please let us know.

Regards,
-Melissa

Re: Edit metadata

PostPosted: Fri Mar 07, 2014 7:15 pm
by GonzaloO
Hi Melissa.

We continue seeing information about how to use the IMetadata interface. We want to ask you some questions about the following example:
https://github.com/openmicroscopy/biofo ... eTiff.java

We don't understand lines 55 to 57.
ServiceFactory factory = new ServiceFactory();
OMEXMLService service = factory.getInstance(OMEXMLService.class);
IMetadata omexmlMeta = service.createOMEXMLMetadata();

What is the concept behind "service"? Why do you use it?
Where do you link the Java objects with the XML model? In some of this methods?


On the other hand, do you have an example where you add an SA:AnnotationRef to an Image element (not in the OME element) in a xml file?


Regards,
Gonzalo

Re: Edit metadata

PostPosted: Sun Mar 09, 2014 11:09 pm
by mtbc
I am sure that Melissa will soon get to helping you with the OME-XML aspects but in the meantime I can mention that it is through services offered by the OMERO server that the clients can communicate with it and make requests of it, generally within the context of an authenticated session. Various services are offered by the server, including the meta-data service, each with their own methods appropriate for their purpose. One may read more about the services at http://www.openmicroscopy.org/site/supp ... s/Api.html and about the object model mapping at http://www.openmicroscopy.org/site/supp ... Model.html. I hope that there may be something among that documentation that provides further illumination for your endeavors.

Cheers,
Mark

Re: Edit metadata

PostPosted: Tue Mar 11, 2014 10:09 am
by jmoore
Similar to the remote services for OMERO that Mark mentions, in Bio-Formats services allow us to abstract away certain implementation details. For example, if certain libraries are not installed, your code can still be compiled because use of the library is behind an interface.

Cheers,
~Josh

Re: Edit metadata

PostPosted: Wed Mar 12, 2014 2:06 pm
by wmoore
Here's an example OME-XML file with Structured Annotations. https://gist.github.com/will-moore/9507510

Hope it has the info you need.

Will.

Re: Edit metadata

PostPosted: Thu Mar 13, 2014 9:03 pm
by GonzaloO
Thanks Mark and Josh.
Despite of we have read the links, we continue confused about where the XML model is mapped with the Java objects. Where do you say to the program that you are going to use this schema: http://www.openmicroscopy.org/Schemas/O ... 06/ome.xsd?

Thanks Will.
We already had that example. We are looking another one where the Image element has an SA:AnnotationRef. This is the xsd:element that appears before the xsd:attributes ID and Name. (we are trying to use the schema http://www.openmicroscopy.org/Schemas/O ... 06/ome.xsd). If you have one example using this element, we would appreciate you send it to us.

Regards,
Gonzalo

Re: Edit metadata

PostPosted: Mon Mar 24, 2014 4:03 pm
by ajpatterson
Hello Gonzalo,

If you are building using maven the current schema is set in 'pom.xml' using '<xsdfu.schemaver>'.
If you are building using ant the current schema is set in 'ant/xsd-fu.xml' using 'property name="xsdfu.schemaver"'.

A minimal xml block for an Image with an Annotation using the 2013-06 schema is:

Code: Select all
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2013-06"
   xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2013-06"
   xmlns:SA="http://www.openmicroscopy.org/Schemas/SA/2013-06"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06
   http://www.openmicroscopy.org/Schemas/OME/2013-06/ome.xsd">
   
   <Image ID="Image:1" Name="ImageWithAnnotation">
      <AcquisitionDate>2010-03-02T10:01:15</AcquisitionDate>
      <Pixels ID="Pixels:1" Type="uint8"
         SizeX="18" SizeY="24" SizeZ="5"
         SizeC="1" SizeT="1"
         DimensionOrder="XYZCT">
         <MetadataOnly/>
      </Pixels>
      <!-- Link the annotation to the image -->
      <SA:AnnotationRef ID="Annotation:1"/>
   </Image>

   <!-- All the annotations are stores in this block-->
   <SA:StructuredAnnotations>
      <!-- Define the type and value for the annotation to the image -->
      <SA:CommentAnnotation ID="Annotation:1"
         Namespace="my.domain.name/myapplicationname/myannotationtype">
         <SA:Value></SA:Value>
      </SA:CommentAnnotation>
   </SA:StructuredAnnotations>
</OME>

Re: Edit metadata

PostPosted: Mon Apr 21, 2014 6:18 pm
by GonzaloO
Thanks Andrew,

We keep doing tests in the OMERO server.
We had a problem with the metadata block: we couldn't view the description nor the experimenter of the image. Are these metadatas displayed in the OMERO.insight?

I attached the xml file that we extracted with the tiffcomment command. It was validated with the xmlvalid command.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?><!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: http://ome-xml.org/wiki/OmeTiff. -->
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2013-06"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    UUID="urn:uuid:15609cc5-57b0-4d68-ba6a-2d12367fa635"
    xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2013-06 http://www.openmicroscopy.org/Schemas/OME/2013-06/ome.xsd">
   <Experimenter ID="Experimenter:0" Email="turco@hotmail" FirstName="Turc" Institution="FI-UNER" LastName="T M"/>
    <Instrument ID="Instrument:0">
        <Objective Correction="PlanApo" ID="Objective:12003" Immersion="Oil" LensNA="1.4"
            Manufacturer="Nikon" Model="93110" NominalMagnification="100.0" WorkingDistance="130.0"
        />
    </Instrument>
    <Image
        ID="urn:lsid:export.openmicroscopy.org:Image:97b0d9a5-f1dc-436b-b8da-74d9742f53d6_116:3554"
        Name="/home/omero/Documentos/Datos_OMERO/Pruebas a OMERO/IMG001.jpg">
        <AcquisitionDate>2014-02-07T18:52:34</AcquisitionDate>
        <ExperimenterRef ID="Experimenter:0"/>
        <Description>Dónde se almacena esta descripción.</Description>
        <InstrumentRef ID="Instrument:0"/>
        <ImagingEnvironment/>
        <Pixels DimensionOrder="XYZCT"
            ID="urn:lsid:export.openmicroscopy.org:Pixels:97b0d9a5-f1dc-436b-b8da-74d9742f53d6_116:3557"
            SizeC="3" SizeT="1" SizeX="2048" SizeY="1536" SizeZ="1" Type="uint8">
            <Channel Color="-16776961"
                ID="urn:lsid:export.openmicroscopy.org:Channel:97b0d9a5-f1dc-436b-b8da-74d9742f53d6_128:3558"
                Name="Red" SamplesPerPixel="1">
                <LightPath/>
            </Channel>
            <Channel Color="16711935"
                ID="urn:lsid:export.openmicroscopy.org:Channel:97b0d9a5-f1dc-436b-b8da-74d9742f53d6_129:3558"
                Name="Green" SamplesPerPixel="1">
                <LightPath/>
            </Channel>
            <Channel Color="65535"
                ID="urn:lsid:export.openmicroscopy.org:Channel:97b0d9a5-f1dc-436b-b8da-74d9742f53d6_130:3558"
                Name="Blue" SamplesPerPixel="1">
                <LightPath/>
            </Channel>
            <TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1">
                <UUID FileName="__omero_export__2222389819106164029.ome.tiff"
                    >urn:uuid:15609cc5-57b0-4d68-ba6a-2d12367fa635</UUID>
            </TiffData>
            <TiffData FirstC="1" FirstT="0" FirstZ="0" IFD="1" PlaneCount="1">
                <UUID FileName="__omero_export__2222389819106164029.ome.tiff"
                    >urn:uuid:15609cc5-57b0-4d68-ba6a-2d12367fa635</UUID>
            </TiffData>
            <TiffData FirstC="2" FirstT="0" FirstZ="0" IFD="2" PlaneCount="1">
                <UUID FileName="__omero_export__2222389819106164029.ome.tiff"
                    >urn:uuid:15609cc5-57b0-4d68-ba6a-2d12367fa635</UUID>
            </TiffData>
        </Pixels>
        <AnnotationRef xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06" ID="Annotation:0"/>
        <AnnotationRef xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06" ID="Annotation:1"/>
        <AnnotationRef xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06" ID="Annotation:2"/>
        <AnnotationRef xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06" ID="Annotation:3"/>
        <AnnotationRef xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06" ID="Annotation:4"/>
    </Image>

   <StructuredAnnotations xmlns="http://www.openmicroscopy.org/Schemas/SA/2013-06">
        <TagAnnotation ID="Annotation:0">
            <Value>TAG#1</Value>
        </TagAnnotation>
        <XMLAnnotation ID="Annotation:1">
            <Value>
                <OriginalMetadata xmlns="openmicroscopy.org/OriginalMetadata">
                    <Key>PixelTypeTurco</Key>
                    <Value>16 bit signed integer</Value>
                </OriginalMetadata>
            </Value>
        </XMLAnnotation>
        <ListAnnotation ID="Annotation:2">
            <Description>Esto es una ListAnnotation</Description>
        </ListAnnotation>
        <CommentAnnotation ID="Annotation:3">
            <Value>Esto es una CommentAnnotation</Value>
        </CommentAnnotation>
       <TermAnnotation ID="Annotation:4">
            <Value>Esto es una TermAnnotation</Value>
        </TermAnnotation>
    </StructuredAnnotations>

</OME>


Greetings.