Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Ticket #12121: 0002-specification-Add-Endian-enum.patch
File 0002-specification-Add-Endian-enum.patch,
5.2 KB
(added by rleigh, 10 years ago) |
|
-
From 5d4aa8bedf84e40b942f40451d12a97c7c5e6317 Mon Sep 17 00:00:00 2001
From: Roger Leigh <r.leigh@dundee.ac.uk>
Date: Fri, 18 Apr 2014 17:22:05 +0100
Subject: [PATCH 2/7] specification: Add Endian enum
---
.../src/loci/formats/MetadataTools.java | 3 ++-
.../src/loci/formats/meta/MetadataConverter.java | 4 ++--
.../released-schema/2013-10-dev-2/ome.xsd | 24 ++++++++++++++++++++--
.../templates-java/OMEXMLMetadataImpl.template | 8 ++++----
4 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/components/formats-api/src/loci/formats/MetadataTools.java b/components/formats-api/src/loci/formats/MetadataTools.java
index d5be396..114eb05 100644
a
|
b
|
import ome.xml.meta.MetadataRoot; |
54 | 54 | import ome.xml.meta.OMEXMLMetadataRoot; |
55 | 55 | import ome.xml.model.BinData; |
56 | 56 | import ome.xml.model.enums.DimensionOrder; |
| 57 | import ome.xml.model.enums.Endian; |
57 | 58 | import ome.xml.model.enums.EnumerationException; |
58 | 59 | import ome.xml.model.enums.PixelType; |
59 | 60 | import ome.xml.model.enums.SubChannelInterleaving; |
… |
… |
public final class MetadataTools { |
259 | 260 | int sizeY, int sizeZ, int sizeC, int sizeT, int samplesPerPixel) |
260 | 261 | { |
261 | 262 | store.setPixelsID(createLSID("Pixels", series), series); |
262 | | store.setPixelsBigEndian(!littleEndian, series); |
| 263 | store.setPixelsEndian(!littleEndian ? Endian.BIG : Endian.LITTLE, series); |
263 | 264 | try { |
264 | 265 | store.setPixelsDimensionOrder( |
265 | 266 | DimensionOrder.fromString(dimensionOrder), series); |
-
diff --git a/components/formats-api/src/loci/formats/meta/MetadataConverter.java b/components/formats-api/src/loci/formats/meta/MetadataConverter.java
index 6ef1c38..1ab1c70 100644
a
|
b
|
public final class MetadataConverter { |
858 | 858 | catch (NullPointerException e) { } |
859 | 859 | |
860 | 860 | try { |
861 | | Boolean bigEndian = src.getPixelsBigEndian(i); |
862 | | dest.setPixelsBigEndian(bigEndian, i); |
| 861 | Endian endian = src.getPixelsEndian(i); |
| 862 | dest.setPixelsEndian(endian, i); |
863 | 863 | } |
864 | 864 | catch (NullPointerException e) { } |
865 | 865 | |
-
diff --git a/components/specification/released-schema/2013-10-dev-2/ome.xsd b/components/specification/released-schema/2013-10-dev-2/ome.xsd
index 2ccb091..bd281cd 100644
a
|
b
|
|
416 | 416 | </xsd:restriction> |
417 | 417 | </xsd:simpleType> |
418 | 418 | </xsd:attribute> |
419 | | <xsd:attribute name="BigEndian" use="optional" type="xsd:boolean"> |
| 419 | <xsd:attribute name="Endian" use="optional" type="Endian"> |
420 | 420 | <xsd:annotation> |
421 | 421 | <xsd:documentation> |
422 | | This is true if the pixels data was written in BigEndian order. |
| 422 | This is Big if the pixels data was written in big endian order, or |
| 423 | Little if in little endian order. |
423 | 424 | |
424 | 425 | If this value is present it should match the value used in BinData |
425 | 426 | or TiffData. If it does not a reader should honour the value used |
… |
… |
|
427 | 428 | files and is to allow for future storage solutions. |
428 | 429 | </xsd:documentation> |
429 | 430 | </xsd:annotation> |
| 431 | <xsd:simpleType> |
| 432 | <xsd:restriction base="xsd:string"> |
| 433 | <xsd:enumeration value="Big"/> |
| 434 | <xsd:enumeration value="Little"/> |
| 435 | </xsd:restriction> |
| 436 | </xsd:simpleType> |
430 | 437 | </xsd:attribute> |
431 | 438 | <xsd:attribute name="SizeX" use="required" type="PositiveInt"> |
432 | 439 | <xsd:annotation> |
… |
… |
|
1468 | 1475 | <xsd:enumeration value = "double-complex"/> |
1469 | 1476 | </xsd:restriction> |
1470 | 1477 | </xsd:simpleType> |
| 1478 | |
| 1479 | <xsd:simpleType name="Endian"> |
| 1480 | <xsd:annotation> |
| 1481 | <xsd:documentation> |
| 1482 | The ordering of bits within a pixel |
| 1483 | </xsd:documentation> |
| 1484 | </xsd:annotation> |
| 1485 | <xsd:restriction base="xsd:string"> |
| 1486 | <xsd:enumeration value="Big"/> |
| 1487 | <xsd:enumeration value="Little"/> |
| 1488 | </xsd:restriction> |
| 1489 | </xsd:simpleType> |
| 1490 | |
1471 | 1491 | <xsd:simpleType name="Color"> |
1472 | 1492 | <xsd:annotation> |
1473 | 1493 | <xsd:documentation> |
-
diff --git a/components/xsd-fu/templates-java/OMEXMLMetadataImpl.template b/components/xsd-fu/templates-java/OMEXMLMetadataImpl.template
index 1653e50..a1ea2f3 100644
a
|
b
|
${counter(k, o, v)}\ |
441 | 441 | |
442 | 442 | public Boolean getPixelsBinDataBigEndian(int imageIndex, int binDataIndex) |
443 | 443 | { |
444 | | Boolean bigEndian = root.getImage(imageIndex).getPixels().getBigEndian(); |
445 | | if (bigEndian != null) { |
446 | | return bigEndian; |
| 444 | Endian endian = root.getImage(imageIndex).getPixels().getEndian(); |
| 445 | if (endian != null) { |
| 446 | return endian == Endian.BIG; |
447 | 447 | } |
448 | 448 | return root.getImage(imageIndex).getPixels().getBinData(binDataIndex).getBigEndian(); |
449 | 449 | } |
… |
… |
${getter(k, o, prop, v)}\ |
570 | 570 | o1.setPixels(new Pixels()); |
571 | 571 | } |
572 | 572 | Pixels o2 = o1.getPixels(); |
573 | | o2.setBigEndian(bigEndian); |
| 573 | o2.setEndian(bigEndian ? Endian.BIG : Endian.LITTLE); |
574 | 574 | } |
575 | 575 | |
576 | 576 | public void setMaskBinData(byte[] binData, int ROIIndex, int shapeIndex) |
Download in other formats:
1.3.13-PRO © 2008-2011
Agilo Software all
rights reserved
(this page was served in: 0.25859 sec.)