Permalink
Browse files

Downgrade transform almost working, see #8134

  • Loading branch information...
1 parent fbbf970 commit ad480088bfba6d88d7625d19797dab6ef9dda5c9 @qidane committed Mar 22, 2012
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2012-06"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ROI="http://www.openmicroscopy.org/Schemas/ROI/2012-06"
+ xmlns:SA="http://www.openmicroscopy.org/Schemas/SA/2012-06"
+ xmlns:SPW="http://www.openmicroscopy.org/Schemas/SPW/2012-06"
+ xmlns:Bin="http://www.openmicroscopy.org/Schemas/BinaryFile/2012-06"
+ xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2012-06 ../../../InProgress/ome.xsd">
+
+ <OME:Project xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06" ID="Project:1">
+ <OME:ExperimenterGroupRef ID="ExperimenterGroup:Group:1"/>
+ <!--Insert DatasetRef elements-->
+ <OME:DatasetRef ID="Dataset:1"/>
+ <SA:AnnotationRef ID="Annotation:1"/>
+ </OME:Project>
+ <OME:Dataset xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06" ID="Dataset:1">
+ <OME:ExperimenterGroupRef ID="ExperimenterGroup:Group:1"/>
+ <!--Insert ImageRef elements-->
+ <OME:ImageRef ID="Image:0"/>
+ <SA:AnnotationRef ID="Annotation:2"/>
+ </OME:Dataset>
+ <SPW:Plate ID="Plate:1">
+ <SPW:Well ID="Well:1" Column="1" Row="1" Color="-2147483648" Type="TheWellStatus">
+ <SPW:WellSample ID="WellSample:1" Index="1">
+ <OME:ImageRef xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06"
+ ID="Image:0"/>
+ </SPW:WellSample>
+ </SPW:Well>
+ </SPW:Plate>
+ <SPW:Screen ID="Screen:1">
+ <SPW:PlateRef ID="Plate:1"/>
+ </SPW:Screen>
+ <OME:Experimenter xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06"
+ ID="Experimenter:1">
+ <OME:ExperimenterGroupRef ID="ExperimenterGroup:Group:1"/>
+ </OME:Experimenter>
+ <OME:Experimenter xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06"
+ ID="Experimenter:2" FirstName="John" MiddleName="Andrew" LastName="Smith"
+ Email="john@example.org"> </OME:Experimenter>
+ <OME:ExperimenterGroup xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06"
+ Name="MyGroup" ID="ExperimenterGroup:Group:1">
+ <Description>A description for my group.
+Complete with basic formating, like new lines.</Description>
+ <Leader ID="Experimenter:1"/>
+ <Contact ID="Experimenter:1"/>
+ </OME:ExperimenterGroup>
+
+ <Instrument ID="Instrument:1">
+ <Objective ID="Objective:1" LotNumber="123" Manufacturer="OME-Labs"
+ NominalMagnification="20" CalibratedMagnification="20.34"/>
+
+ <!--OTF elements cannot be converted to 2012-06 Schema, they are not supported.-->
+ </Instrument>
+ <OME:Image xmlns:OME="http://www.openmicroscopy.org/Schemas/OME/2012-06" ID="Image:0"
+ Name="6x6x1x8-swatch.tif">
+ <OME:AcquisitionDate>2010-02-23T12:51:30</OME:AcquisitionDate>
+ <ExperimenterRef ID="Experimenter:2"/>
+ <OME:ExperimenterGroupRef ID="ExperimenterGroup:Group:1"/>
+ <OME:Pixels DimensionOrder="XYCZT" ID="Pixels:0:0" PhysicalSizeX="10000.0"
+ PhysicalSizeY="10000.0" Type="uint8" SizeC="3" SizeT="1" SizeX="6" SizeY="4" SizeZ="1">
+ <OME:Channel AcquisitionMode="LaserScanningConfocalMicroscopy" Color="-2147483648"
+ ID="Channel:0">
+ <!--OTFRef elements cannot be converted to 2012-06 Schema, they are not supported.-->
+ </OME:Channel>
+ <OME:Channel AcquisitionMode="LaserScanningConfocalMicroscopy" Color="-2147483648"
+ ID="Channel:1">
+ <!--OTFRef elements cannot be converted to 2012-06 Schema, they are not supported.-->
+ </OME:Channel>
+ <OME:Channel AcquisitionMode="MultiPhotonMicroscopy" Color="-2147483648" ID="Channel:2">
+ <!--OTFRef elements cannot be converted to 2012-06 Schema, they are not supported.-->
+ </OME:Channel>
+ <Bin:BinData BigEndian="false" Length="32"
+ >/wCrzur//wB5oMPi/wBIbJO3AP8ePGCF</Bin:BinData>
+ <Bin:BinData BigEndian="false" Length="32"
+ >AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF</Bin:BinData>
+ <Bin:BinData BigEndian="false" Length="32"
+ >//+szuv/AP95n8PiAABHbZO3AP8dPF+G</Bin:BinData>
+ </OME:Pixels>
+ <ROI:ROIRef ID="ROI:1"/>
+ <ROI:ROIRef ID="ROI:2"/>
+ <ROI:ROIRef ID="ROI:3"/>
+ </OME:Image>
+ <SA:StructuredAnnotations>
+ <SA:XMLAnnotation ID="Annotation:1">
+ <SA:Value><test1/>
+ </SA:Value>
+ </SA:XMLAnnotation>
+ <SA:XMLAnnotation ID="Annotation:2">
+ <SA:Value><test2/>
+ </SA:Value>
+ </SA:XMLAnnotation>
+ </SA:StructuredAnnotations>
+ <ROI:ROI ID="ROI:1">
+ <ROI:Union>
+ <ROI:Shape ID="Shape:1" TheC="0">
+ <ROI:Point X="1" Y="1"/>
+ </ROI:Shape>
+ </ROI:Union>
+ </ROI:ROI>
+ <ROI:ROI ID="ROI:2">
+ <ROI:Union>
+ <ROI:Shape ID="Shape:2" FillRule="NonZero" FontFamily="sans-serif" FontSize="1"
+ FontStyle="Bold" LineCap="Butt" StrokeDashArray="1" StrokeWidth="1" TheC="2"
+ FillColor="1" StrokeColor="1" Text="Hello">
+ <ROI:Point X="1" Y="1"/>
+ </ROI:Shape>
+ </ROI:Union>
+ </ROI:ROI>
+ <ROI:ROI ID="ROI:3">
+ <ROI:Union>
+ <ROI:Shape ID="Shape:3" FillRule="EvenOdd" Text="Hi There!">
+ <ROI:Rectangle X="1" Y="2" Width="3" Height="4"/>
+ <ROI:Transform A00="10" A10="20" A01="30" A11="40" A02="50" A12="60"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:4" FillRule="EvenOdd" FontStyle="Normal" FontFamily="serif"
+ Text="Hello" FillColor="1" FontSize="1" LineCap="Butt" StrokeColor="1"
+ StrokeDashArray="10 10" StrokeWidth="1" TheC="1" TheT="1" TheZ="1" Visibility="true">
+ <ROI:Label X="1" Y="1"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:5" StrokeWidth="2" StrokeColor="1">
+ <ROI:Polygon Points="1,1 10,20, 20,20 20,10"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:6" StrokeWidth="2" StrokeColor="1">
+ <ROI:Polyline Points="15,15 15,25, 25,25 25,15" MarkerStart="Arrow"
+ MarkerEnd="Arrow"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:6a" StrokeWidth="2" StrokeColor="1">
+ <ROI:Polyline Points="1,1 10,20, 20,20 20,10" MarkerStart="Circle"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:7" StrokeWidth="2" StrokeColor="1">
+ <ROI:Line X1="1" Y1="2" X2="3" Y2="4" MarkerStart="Square" MarkerEnd="Circle"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:7a" StrokeWidth="2" StrokeColor="1">
+ <ROI:Line X1="1" Y1="2" X2="3" Y2="4" MarkerEnd="Circle"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:7b" StrokeWidth="2" StrokeColor="1">
+ <ROI:Line X1="1" Y1="2" X2="3" Y2="4" MarkerEnd="Circle"/>
+ </ROI:Shape>
+
+ </ROI:Union>
+ </ROI:ROI>
+ <ROI:ROI ID="ROI:4">
+ <ROI:Union>
+ <ROI:Shape ID="Shape:9" Visibility="false" Text="Removed Path">
+ <!--
+ Path elements cannot be converted to 2012-06 Schema, they are not
+ supported.-->
+ <ROI:Label X="0" Y="0"/>
+ </ROI:Shape>
+ </ROI:Union>
+ </ROI:ROI>
+ <ROI:ROI ID="ROI:5">
+ <ROI:Union>
+ <ROI:Shape ID="Shape:10" Visibility="false" Text="Removed Path">
+ <!--
+ Path elements cannot be converted to 2012-06 Schema, they are not
+ supported.-->
+ <ROI:Label X="0" Y="0"/>
+ </ROI:Shape>
+ <ROI:Shape ID="Shape:11" Visibility="false" Text="Removed Path">
+ <!--
+ Path elements cannot be converted to 2012-06 Schema, they are not
+ supported.-->
+ <ROI:Label X="0" Y="0"/>
+ </ROI:Shape>
+ </ROI:Union>
+ </ROI:ROI>
+</OME>
@@ -59,6 +59,49 @@
<!-- Actual schema changes -->
+ <xsl:template match="OME:Dataset">
+ <xsl:element name="OME:Dataset" namespace="{$newOMENS}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="* [not (local-name(.) = 'ImageRef' or local-name(.) = 'AnnotationRef')]"/>
+ <xsl:comment>Insert ProjectRef elements</xsl:comment>
+ <!-- Insert ProjectRef elements -->
+ <xsl:variable name="datasetID" select="@ID"/>
+ <xsl:for-each select="exsl:node-set(//OME:Project/OME:DatasetRef[@ID=$datasetID])">
+ <xsl:element name="OME:ProjectRef" namespace="{$newOMENS}">
+ <xsl:attribute name="ID"><xsl:for-each select=" parent::node()">
+ <xsl:value-of select="@ID"/>
+ </xsl:for-each></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="* [local-name(.) = 'AnnotationRef']"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="OME:Project">
+ <xsl:element name="OME:Project" namespace="{$newOMENS}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="* [not (local-name(.) = 'DatasetRef')]"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="OME:Image">
+ <xsl:element name="OME:Image" namespace="{$newOMENS}">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="* [local-name(.) = 'AcquiredDate' or local-name(.) = 'ExperimenterRef' or local-name(.) = 'Description' or local-name(.) = 'ExperimentRef' or local-name(.) = 'GroupRef']"/>
+ <xsl:comment>Insert DatasetRef elements</xsl:comment>
+ <!-- Insert DatasetRef elements -->
+ <xsl:variable name="imageID" select="@ID"/>
+ <xsl:for-each select="exsl:node-set(//OME:Dataset/OME:ImageRef[@ID=$imageID])">
+ <xsl:element name="OME:DatasetRef" namespace="{$newOMENS}">
+ <xsl:attribute name="ID"><xsl:for-each select=" parent::node()">
+ <xsl:value-of select="@ID"/>
+ </xsl:for-each></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="* [local-name(.) = 'InstrumentRef' or local-name(.) = 'ObjectiveSettings' or local-name(.) = 'ImagingEnvironment' or local-name(.) = 'StageLabel' or local-name(.) = 'Pixels' or local-name(.) = 'ROIRef' or local-name(.) = 'MicrobeamManipulationRef' or local-name(.) = 'AnnotationRef']"/>
+ </xsl:element>
+ </xsl:template>
+
<xsl:template match="OME:AcquisitionDate">
<xsl:element name="OME:AcquiredDate" namespace="{$newOMENS}">
<xsl:apply-templates select="node()"/>
@@ -68,6 +111,7 @@
<xsl:template match="OME:Experimenter">
<xsl:element name="OME:Experimenter" namespace="{$newOMENS}">
<!-- Calculate DisplayName -->
+ <xsl:attribute name="DisplayName"><xsl:value-of select="@FirstName"/>/<xsl:value-of select="@MiddleName"/>/<xsl:value-of select="@LastName"/>(<xsl:value-of select="@UserName"/>)[<xsl:value-of select="@Email"/>]</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
@@ -114,9 +158,47 @@
</xsl:element>
</xsl:template>
+ <xsl:template match="ROI:Shape">
+ <xsl:element name="ROI:Shape" namespace="{$newROINS}">
+ <xsl:for-each
+ select="@* [not(name() = 'FillColor' or name() = 'StrokeColor' or name() = 'Text' or name() = 'Visibility')]">
+ <xsl:attribute name="{local-name(.)}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="@* [name() = 'FillColor']">
+ <xsl:attribute name="Fill">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="@* [name() = 'StrokeColor']">
+ <xsl:attribute name="Stroke">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="@* [name() = 'Text']">
+ <xsl:attribute name="Label">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="* [local-name(.) = 'Transform']">
+ <xsl:attribute name="Transform"><xsl:value-of select="@A00"/>, <xsl:value-of
+ select="@A10"/>, <xsl:value-of select="@A01"/>, <xsl:value-of select="@A11"
+ />, <xsl:value-of select="@A02"/>, <xsl:value-of select="@A12"/></xsl:attribute>
+ </xsl:for-each>
+ <!-- end of attributes -->
+ <xsl:for-each select="* [not(local-name(.) = 'Transform')]">
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
<xsl:template match="ROI:Label">
<xsl:element name="ROI:Text" namespace="{$newROINS}">
<xsl:apply-templates select="@*|node()"/>
+ <xsl:element name="ROI:Value" namespace="{$newROINS}"><xsl:for-each select=" parent::node()">
+ <xsl:value-of select="@Text"/>
+ </xsl:for-each></xsl:element>
</xsl:element>
</xsl:template>
@@ -163,7 +245,7 @@
xmlns:ROI="http://www.openmicroscopy.org/Schemas/ROI/2011-06"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2011-06
- ome.xsd">
+ ../../../Released-Schema/2011-06/V1/ome.xsd">
<xsl:apply-templates/>
</OME>
</xsl:template>

0 comments on commit ad48008

Please sign in to comment.