Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OriginalMetadata from 2003-FC lost in transform process #142

Closed
dgault opened this issue May 17, 2021 · 2 comments · Fixed by #145
Closed

OriginalMetadata from 2003-FC lost in transform process #142

dgault opened this issue May 17, 2021 · 2 comments · Fixed by #145

Comments

@dgault
Copy link
Member

dgault commented May 17, 2021

Issue is a follow up to image.sc thread https://forum.image.sc/t/bio-formats-returns-all-metadata-except-ome-meta-data/52295/2

Using the sample file provided in the thread and correcting validation errors shows that the original metadata (stored in 2003-FC spec) gets lost when going through the transform update process. The particular transform the issue occurs with is
2008-09-to-2009-09.xsl

The data that gets lost is stored using the OriginalMetadata tag such as below (adding the CA namespace didn't resolve the issue):

<CustomAttributes>
<OriginalMetadata ID="OriginalMetadata:3" Name="Acquisition Parameters/Channel 2" Value="Fluorescence"/>
</CustomAttributes>

In the transform this should be handled by the following, transforming the metadata to an XMLAnnotation:

  <xsl:template match="CA:*">
    <xsl:element name="{name()}" namespace="{$newCANS}">
      <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
  </xsl:template>

  <!-- Transform the CustomAttributes into XMLAnnotation -->
  <xsl:template match="CA:CustomAttributes">
    <xsl:if test="count(@*|node()) &gt; 0">
      <xsl:element name="StructuredAnnotations" namespace="{$newSANS}">
        <xsl:element name="XMLAnnotation" namespace="{$newSANS}">
          <xsl:attribute name="ID">Annotation:1</xsl:attribute>
          <xsl:element name="Value" namespace="{$newSANS}">
            <xsl:apply-templates select="@*|node()"/>
          </xsl:element>
        </xsl:element>
      </xsl:element>
    </xsl:if>
  </xsl:template>
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/bio-formats-returns-all-metadata-except-ome-meta-data/52295/11

@dgault
Copy link
Member Author

dgault commented May 21, 2021

As a follow up to this a PR has been opened which aims to resolve this bug (#144) along with some new unit tests showing the original failure (ome/bioformats#3695).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants