├── xsd-fu ├── .gitignore ├── python │ ├── ome │ │ ├── __init__.py │ │ └── modeltools │ │ │ ├── __init__.py │ │ │ └── exceptions.py │ └── generateDS │ │ ├── __init__.py │ │ ├── PKG-INFO │ │ └── LICENSE └── templates │ └── java │ ├── OMEXMLMetadataImpl_Channel_ID.template │ ├── OMEXMLModelObject_Reference.template │ ├── OMEXMLModelObject_XMLAnnotation_asXMLElement_Value.template │ └── OMEXMLModelObject_XMLAnnotation_update_Value.template ├── requirements.txt ├── .gitignore ├── .gitattributes ├── specification ├── src │ └── main │ │ └── resources │ │ └── released-schema │ │ ├── 2003-RC5 │ │ └── catalog.xml │ │ ├── 2003-RC6 │ │ └── catalog.xml │ │ ├── 2016-06 │ │ └── catalog.xml │ │ ├── 2008-04 │ │ └── catalog.xml │ │ ├── 2003-IR1 │ │ └── catalog.xml │ │ ├── 2003-RC2 │ │ └── catalog.xml │ │ ├── 2003-RC3 │ │ └── catalog.xml │ │ ├── 2003-RC4 │ │ └── catalog.xml │ │ ├── 2003-IR2 │ │ └── catalog.xml │ │ ├── external │ │ └── catalog.xml │ │ ├── 2003-IR3 │ │ └── catalog.xml │ │ ├── 2012-06 │ │ └── catalog.xml │ │ ├── 2013-06 │ │ └── catalog.xml │ │ ├── 2015-01 │ │ └── catalog.xml │ │ ├── 2010-04 │ │ └── catalog.xml │ │ ├── 2010-06 │ │ └── catalog.xml │ │ ├── 2011-06 │ │ └── catalog.xml │ │ ├── 2003-RC1 │ │ └── catalog.xml │ │ ├── 2003-FC │ │ └── catalog.xml │ │ ├── 2007-06 │ │ └── catalog.xml │ │ ├── 2008-02 │ │ └── catalog.xml │ │ ├── catalog.xml │ │ ├── 2008-09 │ │ └── catalog.xml │ │ └── 2009-09 │ │ └── catalog.xml ├── .classpath-template └── samples │ ├── 2016-06 │ ├── metadata-only.ome.xml │ ├── minimum-specification.ome.xml │ ├── no-date.ome.xml │ ├── single-image.ome.xml │ ├── commentannotation.ome.xml │ ├── xmlannotation-multi-value.ome.xml │ ├── multi-channel.ome.xml │ ├── mapannotation.ome.xml │ ├── xmlannotation-body-space.ome.xml │ ├── tagannotation.ome.xml │ ├── hcs.ome.xml │ └── ROI.ome.xml │ ├── 2010-06 │ ├── metadata-only.ome.xml │ ├── no-date.ome.xml │ ├── single-image.ome.xml │ ├── multi-channel.ome.xml │ └── ROI.ome.xml │ ├── 2011-06 │ ├── metadata-only.ome.xml │ ├── no-date.ome.xml │ ├── single-image.ome.xml │ ├── multi-channel.ome.xml │ └── ROI.ome.xml │ ├── 2010-04 │ ├── metadata-only.ome.xml │ ├── single-image.ome.xml │ ├── multi-channel.ome.xml │ └── ROI.ome.xml │ ├── 2013-06 │ ├── metadata-only.ome.xml │ ├── no-date.ome.xml │ ├── single-image.ome.xml │ ├── commentannotation.ome.xml │ ├── multi-channel.ome.xml │ ├── xmlannotation-multi-value.ome.xml │ ├── xmlannotation-body-space.ome.xml │ ├── tagannotation.ome.xml │ └── ROI.ome.xml │ ├── 2015-01 │ ├── minimum-specification.ome.xml │ ├── metadata-only.ome.xml │ ├── no-date.ome.xml │ ├── single-image.ome.xml │ ├── commentannotation.ome.xml │ ├── xmlannotation-multi-value.ome.xml │ ├── multi-channel.ome.xml │ ├── mapannotation.ome.xml │ ├── xmlannotation-body-space.ome.xml │ ├── tagannotation.ome.xml │ ├── hcs.ome.xml │ └── ROI.ome.xml │ ├── 2012-06 │ ├── single-image.ome.xml │ ├── no-date.ome.xml │ ├── metadata-only.ome.xml │ ├── multi-channel.ome.xml │ ├── tagannotation.ome.xml │ └── ROI.ome.xml │ ├── 2009-09 │ ├── metadata-only.ome.xml │ ├── single-image.ome.xml │ └── multi-channel.ome.xml │ └── 2008-09 │ ├── single-image.ome.xml │ ├── multi-pixel-default.ome.xml │ ├── multi-pixel-aquired.ome.xml │ ├── multi-channel.ome.xml │ └── dataset-group-project.ome.xml ├── .github └── workflows │ ├── python.yml │ ├── codeql.yml │ └── maven.yml ├── .mailmap ├── .ruff.toml ├── LICENSE.md ├── ome-xml └── src │ ├── main │ ├── resources │ │ └── ome │ │ │ └── xml │ │ │ └── model │ │ │ └── omemodel.properties │ └── java │ │ └── ome │ │ ├── xml │ │ ├── package.html │ │ ├── model │ │ │ ├── enums │ │ │ │ ├── Enumeration.java │ │ │ │ ├── EnumerationException.java │ │ │ │ └── handlers │ │ │ │ │ └── IEnumerationHandler.java │ │ │ ├── primitives │ │ │ │ ├── PrimitiveNumber.java │ │ │ │ ├── PositiveLong.java │ │ │ │ ├── PositiveFloat.java │ │ │ │ ├── PositiveInteger.java │ │ │ │ ├── NonNegativeLong.java │ │ │ │ ├── NonNegativeFloat.java │ │ │ │ ├── NonNegativeInteger.java │ │ │ │ ├── PercentFraction.java │ │ │ │ └── PrimitiveType.java │ │ │ └── OMEModel.java │ │ └── meta │ │ │ ├── MetadataRoot.java │ │ │ ├── OMEXMLMetadata.java │ │ │ ├── BaseMetadata.java │ │ │ ├── IMetadata.java │ │ │ └── OMEXMLMetadataRoot.java │ │ └── units │ │ └── quantity │ │ └── Quantity.java │ └── test │ ├── resources │ ├── logback.xml │ └── testng.xml │ └── java │ └── ome │ └── xml │ └── utests │ ├── SingularBackReferenceTest.java │ ├── NonNegativeLongTest.java │ ├── PositiveLongTest.java │ ├── PercentFractionTest.java │ ├── NonNegativeFloatTest.java │ └── NonNegativeIntegerTest.java ├── README.md ├── .classpath-template └── CONTRIBUTING.md /xsd-fu/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /xsd-fu/python/ome/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /xsd-fu/python/ome/modeltools/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Python requirements 2 | # =================== 3 | # 4 | # pip install -r requirements.txt 5 | # 6 | Genshi 7 | -------------------------------------------------------------------------------- /xsd-fu/templates/java/OMEXMLMetadataImpl_Channel_ID.template: -------------------------------------------------------------------------------- 1 | if (o3.getLightPath() == null) 2 | { 3 | o3.setLightPath(new LightPath()); 4 | } 5 | -------------------------------------------------------------------------------- /xsd-fu/python/generateDS/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Pseudo-package to import generateDS. 3 | """ 4 | 5 | 6 | from . import generateDS 7 | 8 | __all__ = ["generateDS"] 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .*un~ 2 | .DS_Store 3 | target 4 | .idea 5 | 6 | # Python files 7 | *.pyc 8 | build 9 | dist 10 | ome_model.egg-info 11 | ome_model/__init__.py 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | *.svg binary 3 | *.tiff binary 4 | *.png binary 5 | *.jpg binary 6 | *.pdf binary 7 | *.zip binary 8 | *.jar binary 9 | *.dll binary 10 | *.so binary 11 | *.dylib binary 12 | *.h5 binary 13 | *.mdb binary 14 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC5/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC6/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2016-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2008-04/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-IR1/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /xsd-fu/python/generateDS/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: generateDS 3 | Version: 1.18c 4 | Summary: Generation of Python data structures and XML parser from Xschema 5 | Home-page: http://www.rexx.com/~dkuhlman 6 | Author: Dave Kuhlman 7 | Author-email: dkuhlman@rexx.com 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /xsd-fu/templates/java/OMEXMLModelObject_Reference.template: -------------------------------------------------------------------------------- 1 | /** 2 | * Retrieves the reference's target object ID. 3 | * @return See above. 4 | */ 5 | public abstract String getID(); 6 | 7 | /** 8 | * Sets the reference's target object ID. 9 | * @param id The object ID to set. 10 | */ 11 | public abstract void setID(String id); 12 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC2/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC3/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC4/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-IR2/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/external/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.github/workflows/python.yml: -------------------------------------------------------------------------------- 1 | name: Python linting 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - '*' 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | ruff: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: astral-sh/ruff-action@v3 17 | - name: Lint with Ruff 18 | run: ruff check --output-format=github 19 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-IR3/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /specification/.classpath-template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2012-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2013-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2015-01/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Andrew Patterson 2 | Chris Allan 3 | Chris Allan 4 | Curtis Rueden 5 | Jean-Marie Burel 6 | Johannes Schindelin 7 | Josh Moore 8 | Kristin Briney 9 | Mark Hiner 10 | Melissa Linkert 11 | Premysl Fiala 12 | Roger Leigh 13 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2010-04/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2010-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2011-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/samples/2016-06/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-03-02T10:01:15 8 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-RC1/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/samples/2016-06/minimum-specification.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | ZGVmYXVsdA== 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /specification/samples/2016-06/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /specification/samples/2016-06/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | 11 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.ruff.toml: -------------------------------------------------------------------------------- 1 | [lint] 2 | extend-select = [ 3 | "W", # pycodestyle (Warning) 4 | "I", # isort 5 | "UP", # pyupgrade 6 | "B", # flake8-bugbear 7 | "C4", # flake8-comprehensions 8 | "ISC", # flake8-implicit-str-concat 9 | "G", # flake8-logging-format 10 | "PIE", # flake8-pie 11 | "PYI", # flake8-pyi 12 | "PERF", # Perflint 13 | "FURB", # refurb 14 | "RUF", 15 | ] 16 | ignore = [ 17 | "UP015", # Unnecessary open mode parameters 18 | "UP031", # Use format specifiers instead of percent format 19 | "B903", 20 | "B904", 21 | "C408", # Unnecessary `list()`/`dict()` call (rewrite as a literal) 22 | "G002", # Logging statement uses `%` 23 | "G010", # Logging statement uses `warn` instead of `warning` 24 | "FURB154", # Use of repeated consecutive `global` 25 | "RUF031", # Avoid parentheses for tuples in subscripts 26 | ] 27 | -------------------------------------------------------------------------------- /xsd-fu/templates/java/OMEXMLModelObject_XMLAnnotation_asXMLElement_Value.template: -------------------------------------------------------------------------------- 1 | Document Value_document; 2 | try 3 | { 4 | javax.xml.parsers.DocumentBuilderFactory factory = 5 | javax.xml.parsers.DocumentBuilderFactory.newInstance(); 6 | factory.setNamespaceAware(false); 7 | javax.xml.parsers.DocumentBuilder parser = 8 | factory.newDocumentBuilder(); 9 | org.xml.sax.InputSource is = new org.xml.sax.InputSource(); 10 | is.setCharacterStream(new java.io.StringReader(""+value+"")); 11 | Value_document = parser.parse(is); 12 | } 13 | catch (Exception e) 14 | { 15 | throw new RuntimeException(e); 16 | } 17 | 18 | NodeList value_subNodes = Value_document.getChildNodes(); 19 | Node value_subNode = value_subNodes.item(0); 20 | value_subNode = document.importNode(value_subNode, true); 21 | 22 | XMLAnnotation_element.appendChild(value_subNode); 23 | -------------------------------------------------------------------------------- /specification/samples/2010-06/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-03-02T10:01:15 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /specification/samples/2011-06/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-03-02T10:01:15 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/samples/2010-04/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 2010-03-02T10:01:15 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /specification/samples/2013-06/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-03-02T10:01:15 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/samples/2015-01/minimum-specification.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 2009-03-16T15:41:51.0Z 9 | 18 | ZGVmYXVsdA== 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /specification/samples/2012-06/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/samples/2011-06/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/samples/2013-06/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/samples/2010-06/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2003-FC/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /specification/samples/2013-06/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/samples/2016-06/commentannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | 11 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 13 | 14 | 15 | 16 | 17 | 18 | Fred 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /specification/samples/2015-01/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-03-02T10:01:15 13 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /specification/samples/2010-06/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /specification/samples/2010-04/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 2010-02-23T12:51:30 11 | 14 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /specification/samples/2015-01/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 14 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2007-06/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2008-02/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /specification/samples/2015-01/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | 16 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /xsd-fu/python/generateDS/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | License agreement for generateDS 3 | ================================ 4 | 5 | Copyright (c) 2002 Dave Kuhlman 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | -------------------------------------------------------------------------------- /specification/samples/2016-06/xmlannotation-multi-value.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | A 20 | B 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /specification/samples/2009-09/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 2010-03-02T10:01:15 15 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /specification/samples/2013-06/commentannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | 12 | 13 | Fred 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL Advanced" 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | schedule: 9 | - cron: '32 4 * * 0' 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze (${{ matrix.language }}) 14 | runs-on: ubuntu-latest 15 | permissions: 16 | # required for all workflows 17 | security-events: write 18 | 19 | # required to fetch internal or private CodeQL packs 20 | packages: read 21 | 22 | # only required for workflows in private repositories 23 | actions: read 24 | contents: read 25 | 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | include: 30 | - language: java-kotlin 31 | build-mode: none 32 | - language: python 33 | build-mode: none 34 | - language: actions 35 | build-mode: none 36 | 37 | steps: 38 | - name: Checkout repository 39 | uses: actions/checkout@v4 40 | 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v3 43 | with: 44 | languages: ${{ matrix.language }} 45 | build-mode: ${{ matrix.build-mode }} 46 | 47 | - name: Perform CodeQL Analysis 48 | uses: github/codeql-action/analyze@v3 49 | with: 50 | category: "/language:${{matrix.language}}" 51 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2008-09/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /specification/samples/2016-06/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | 12 | 14 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 19 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /specification/samples/2012-06/no-date.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /specification/samples/2012-06/metadata-only.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 2010-03-02T10:01:15 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /specification/src/main/resources/released-schema/2009-09/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /specification/samples/2009-09/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 2010-02-23T12:51:30 15 | 18 | 19 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /specification/samples/2015-01/commentannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | 16 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 18 | 19 | 20 | 21 | 22 | 23 | Fred 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /specification/samples/2011-06/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 2010-02-23T12:51:30 11 | 13 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | 21 | 22 | 23 | foo 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /specification/samples/2016-06/mapannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 2010-02-23T12:51:30 7 | 8 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | This is the description of the sample map A 17 | 18 | SampleValueA 19 | 20 | 21 | 22 | 23 | This is the description of the sample map B 24 | 25 | SampleValueB-1 26 | SampleValueB-2 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /specification/samples/2008-09/single-image.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 2010-02-23T12:51:30 6 | 7 | 8 | 9 | 12 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /specification/samples/2011-06/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /specification/samples/2013-06/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2013–2016 Open Microscopy Environment: 2 | - Massachusetts Institute of Technology 3 | - National Institutes of Health 4 | - University of Dundee 5 | - Board of Regents of the University of Wisconsin-Madison 6 | - Glencoe Software, Inc. 7 | All rights reserved. 8 | 9 | Redistribution and use in source and binary forms, with or without modification, 10 | are permitted provided that the following conditions are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright notice, this 13 | list of conditions and the following disclaimer. 14 | 15 | 2. Redistributions in binary form must reproduce the above copyright notice, 16 | this list of conditions and the following disclaimer in the documentation 17 | and/or other materials provided with the distribution. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /specification/samples/2013-06/xmlannotation-multi-value.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 2010-02-23T12:51:30 12 | 14 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | A 24 | B 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /specification/samples/2016-06/xmlannotation-body-space.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | There should be a space 20 | between the bold and italics words. 21 | There should not be a spacebetween the bold and italics 22 | words. 23 | There should be a space between the bold 24 | and italics words. 25 | There should not be a spacebetween the bold 26 | and italics words. 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /specification/samples/2015-01/xmlannotation-multi-value.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | A 25 | B 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /specification/samples/2010-06/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /specification/samples/2010-04/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 2010-02-23T12:51:30 11 | 14 | 16 | 18 | 19 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 21 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 23 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /specification/samples/2016-06/tagannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 12 | 13 | 14 | 15 | 16 | 17 | 18 | This is the description of the sample tag A 19 | SampleTagA 20 | 21 | 22 | 23 | This is the description of the sample tag B 24 | SampleTagB 25 | 26 | 27 | 28 | This is the description of the sample tagset 29 | 30 | 31 | SampleTagset 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ome-xml/src/main/resources/ome/xml/model/omemodel.properties: -------------------------------------------------------------------------------- 1 | ### 2 | # #%L 3 | # OME XML library 4 | # %% 5 | # Copyright (C) 2006 - 2023 Open Microscopy Environment: 6 | # - Board of Regents of the University of Wisconsin-Madison 7 | # - Glencoe Software, Inc. 8 | # - University of Dundee 9 | # %% 10 | # Redistribution and use in source and binary forms, with or without 11 | # modification, are permitted provided that the following conditions are met: 12 | # 13 | # 1. Redistributions of source code must retain the above copyright notice, 14 | # this list of conditions and the following disclaimer. 15 | # 2. Redistributions in binary form must reproduce the above copyright notice, 16 | # this list of conditions and the following disclaimer in the documentation 17 | # and/or other materials provided with the distribution. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 23 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | # #L% 31 | ### 32 | schema.version = ${ome.model.schemaver} 33 | -------------------------------------------------------------------------------- /specification/samples/2015-01/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | 17 | 19 | 20 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 22 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 24 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /specification/samples/2008-09/multi-pixel-default.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 2010-02-23T12:51:30 6 | 7 | 8 | 9 | 12 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 13 | 14 | 17 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /specification/samples/2008-09/multi-pixel-aquired.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 2010-02-23T12:51:30 6 | 7 | 8 | 9 | 12 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 13 | 14 | 17 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/package.html: -------------------------------------------------------------------------------- 1 | 34 | 35 | OME-XML Java library for working with OME-XML metadata structures. 36 | 37 | -------------------------------------------------------------------------------- /specification/samples/2008-09/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 2010-02-23T12:51:30 6 | 7 | 8 | 9 | 10 | 11 | 14 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 15 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 16 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /xsd-fu/python/ome/modeltools/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | Object model and helper classes used in the generation of classes from 3 | an OME XML (http://www.ome-xml.org) XSD document. 4 | """ 5 | 6 | # Copyright (C) 2009 - 2016 Open Microscopy Environment: 7 | # - Board of Regents of the University of Wisconsin-Madison 8 | # - Glencoe Software, Inc. 9 | # - University of Dundee 10 | # All rights reserved. 11 | # 12 | # Redistribution and use in source and binary forms, with or without 13 | # modification, are permitted provided that the following conditions are met: 14 | # 15 | # 1. Redistributions of source code must retain the above copyright notice, 16 | # this list of conditions and the following disclaimer. 17 | # 2. Redistributions in binary form must reproduce the above copyright notice, 18 | # this list of conditions and the following disclaimer in the documentation 19 | # and/or other materials provided with the distribution. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | # POSSIBILITY OF SUCH DAMAGE. 32 | 33 | 34 | class ModelProcessingError(Exception): 35 | """ 36 | Raised when there is an error during model processing. 37 | """ 38 | -------------------------------------------------------------------------------- /specification/samples/2015-01/mapannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 2010-02-23T12:51:30 12 | 13 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | This is the description of the sample map A 22 | 23 | SampleValueA 24 | 25 | 26 | 27 | 28 | This is the description of the sample map B 29 | 30 | SampleValueB-1 31 | SampleValueB-2 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /specification/samples/2009-09/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 2010-02-23T12:51:30 15 | 18 | 19 | 20 | 21 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 23 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 25 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OME Data Model 2 | 3 | [![Build Status](https://github.com/ome/ome-model/workflows/Maven/badge.svg)](https://github.com/ome/ome-model/actions) 4 | [![Maven Central](https://img.shields.io/maven-central/v/org.openmicroscopy/ome-xml.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openmicroscopy%22%20AND%20a%3A%22ome-xml%22) 5 | [![Javadocs](http://javadoc.io/badge/org.openmicroscopy/ome-xml.svg)](http://javadoc.io/doc/org.openmicroscopy/ome-xml) 6 | 7 | OME data model specification, code generator and implementation. 8 | 9 | Links 10 | ----- 11 | 12 | - [Documentation](https://ome-model.readthedocs.io/en/stable/) 13 | - [Java API reference](http://javadoc.io/doc/org.openmicroscopy/ome-xml/) 14 | - [OME-TIFF sample images](https://downloads.openmicroscopy.org/images/OME-TIFF/) 15 | - [OME-XML sample images](https://downloads.openmicroscopy.org/images/OME-XML/) 16 | 17 | Contribute 18 | ---------- 19 | 20 | To contribute to the OME Model documentation, go to the [documentation repository](https://github.com/ome/ome-model-documentation). 21 | 22 | Pull request testing 23 | -------------------- 24 | 25 | We welcome pull requests from anyone, but ask that you please verify the 26 | following before submitting a pull request: 27 | 28 | * verify that the branch merges cleanly into ```master``` 29 | * verify that the branch compiles using Maven 30 | * verify that the branch does not use syntax or API specific to Java 1.8+ 31 | * internal developers only: [run the data 32 | tests](https://bio-formats.readthedocs.io/en/stable/developers/commit-testing.html) 33 | against directories corresponding to the affected format(s) 34 | * make sure that your commits contain the correct authorship information and, 35 | if necessary, a signed-off-by line 36 | * make sure that the commit messages or pull request comment contains 37 | sufficient information for the reviewer(s) to understand what problem was 38 | fixed and how to test it 39 | -------------------------------------------------------------------------------- /xsd-fu/templates/java/OMEXMLModelObject_XMLAnnotation_update_Value.template: -------------------------------------------------------------------------------- 1 | List Value_nodeList = 2 | getChildrenByTagName(element, "Value"); 3 | if (Value_nodeList.size() > 1) 4 | { 5 | // TODO: Should be its own Exception 6 | throw new RuntimeException(String.format( 7 | "Value node list size %d != 1", 8 | Value_nodeList.size())); 9 | } 10 | else if (Value_nodeList.size() != 0) 11 | { 12 | // Element property Value which is complex (has only 13 | // sub-elements, no attributes, no text content) 14 | java.io.StringWriter sw = new java.io.StringWriter(); 15 | javax.xml.transform.stream.StreamResult sr = 16 | new javax.xml.transform.stream.StreamResult(sw); 17 | javax.xml.transform.TransformerFactory tf = 18 | javax.xml.transform.TransformerFactory.newInstance(); 19 | 20 | try 21 | { 22 | javax.xml.transform.Transformer t = tf.newTransformer(); 23 | t.setOutputProperty( 24 | javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); 25 | t.setOutputProperty( 26 | javax.xml.transform.OutputKeys.INDENT, "no"); 27 | NodeList childNodeList = Value_nodeList.get(0).getChildNodes(); 28 | for (int i = 0; i < childNodeList.getLength(); i++) 29 | { 30 | // some parsers will pick up text nodes here, which we can ignore 31 | if (childNodeList.item(i).getNodeType() == Node.ELEMENT_NODE) { 32 | try { 33 | t.transform(new javax.xml.transform.dom.DOMSource( 34 | childNodeList.item(i)), sr); 35 | } 36 | catch (javax.xml.transform.TransformerException te) { 37 | LOGGER.warn("Failed to transform node #" + i, te); 38 | } 39 | } 40 | } 41 | setValue(sw.toString().trim()); 42 | } 43 | catch (Exception e) 44 | { 45 | throw new RuntimeException(e); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/enums/Enumeration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.enums; 36 | 37 | /** 38 | * Abstract superclass for all enumerations. 39 | */ 40 | public interface Enumeration { 41 | // TODO 42 | } 43 | -------------------------------------------------------------------------------- /specification/samples/2013-06/xmlannotation-body-space.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 2010-02-23T12:51:30 12 | 14 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | There should be a space between 24 | the bold and italics words. 25 | There should not be a spacebetween the bold and italics 26 | words. 27 | There should be a space between the bold 28 | and italics words. 29 | There should not be a spacebetween the bold 30 | and italics words. 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /specification/samples/2012-06/multi-channel.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 2010-02-23T12:51:30 6 | 7 | 8 | 9 | 10 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 11 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 12 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /ome-xml/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 33 | 34 | 35 | 36 | 37 | %d [%t] %-5p %c - %m%n 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /specification/samples/2013-06/tagannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 7 | 8 | 9 | 10 | 11 | 12 | 13 | This is the description of the sample tag A 14 | SampleTagA 15 | 16 | 17 | 18 | This is the description of the sample tag B 19 | SampleTagB 20 | 21 | 22 | 23 | This is the description of the sample tagset 24 | 25 | 26 | SampleTagset 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /specification/samples/2015-01/xmlannotation-body-space.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | There should be a space 25 | between the bold and italics words. 26 | There should not be a spacebetween the bold and italics 27 | words. 28 | There should be a space between the bold 29 | and italics words. 30 | There should not be a spacebetween the bold 31 | and italics words. 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PrimitiveNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * A primitive type from an XSD definition with a given set of constraints. 39 | * 40 | * @author callan 41 | */ 42 | public interface PrimitiveNumber{ 43 | Number getNumberValue(); 44 | } 45 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/meta/MetadataRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.meta; 36 | 37 | /** 38 | * Abstract metadata root node. 39 | * 40 | *

The MetadataRoot interface is implemented by the 41 | * root node of metadata storage implementations. 42 | * 43 | * @author Roger Leigh r.leigh at dundee.ac.uk 44 | */ 45 | public interface MetadataRoot { } 46 | -------------------------------------------------------------------------------- /specification/samples/2015-01/tagannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | 18 | 19 | 20 | 21 | 22 | 23 | This is the description of the sample tag A 24 | SampleTagA 25 | 26 | 27 | 28 | This is the description of the sample tag B 29 | SampleTagB 30 | 31 | 32 | 33 | This is the description of the sample tagset 34 | 35 | 36 | SampleTagset 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/units/quantity/Quantity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2014 - 2016 Open Microscopy Environment: 6 | * - Board of Regents of the University of Wisconsin-Madison 7 | * - Glencoe Software, Inc. 8 | * - University of Dundee 9 | * %% 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | * #L% 31 | */ 32 | 33 | package ome.units.quantity; 34 | 35 | import ome.units.unit.Unit; 36 | 37 | /** 38 | * An abstract quantity. 39 | * 40 | * This represents a quantity (value) for a given unit system. 41 | * 42 | * @since 5.1 43 | */ 44 | public abstract class Quantity 45 | { 46 | /** 47 | * Get the numerical value of this quantity. 48 | * 49 | * @return the value. 50 | */ 51 | public abstract Number value(); 52 | 53 | /** 54 | * Get the unit for this quantity. 55 | * 56 | * @return the unit. 57 | */ 58 | public abstract Unit unit(); 59 | } 60 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/meta/OMEXMLMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.meta; 36 | 37 | /** 38 | * A utility class for constructing and manipulating OME-XML DOMs. 39 | * 40 | * @author Chris Allan callan at blackcat dot ca 41 | */ 42 | public interface OMEXMLMetadata extends IMetadata { 43 | 44 | /** 45 | * Dumps the given OME-XML DOM tree to a string. 46 | * @return OME-XML as a string. 47 | */ 48 | String dumpXML(); 49 | 50 | /** 51 | * Resolve model object cross-references. 52 | */ 53 | int resolveReferences(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/enums/EnumerationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.enums; 36 | 37 | /** 38 | * EnumerationException is the exception thrown when an enumeration is 39 | * invalid or not found. 40 | */ 41 | public class EnumerationException extends Exception { 42 | 43 | public EnumerationException() { super(); } 44 | public EnumerationException(String s) { super(s); } 45 | public EnumerationException(String s, Throwable cause) { super(s, cause); } 46 | public EnumerationException(Throwable cause) { super(cause); } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /ome-xml/src/test/resources/testng.xml: -------------------------------------------------------------------------------- 1 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/meta/BaseMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.meta; 36 | 37 | /** 38 | * A proxy capable of bidirectional communication of biological image data to 39 | * and from a particular storage medium. 40 | * 41 | *

The BaseMetadata interface is implemented by 42 | * metadata storage implementations that handles both storage (see 43 | * {@link MetadataStore}) and retrieval (see {@link MetadataRetrieve}) 44 | * of metadata fields. It exists mainly to store 45 | * MetadataStore and MetadataRetrieve object 46 | * types within the same container. 47 | * 48 | * @author Roger Leigh r.leigh at dundee.ac.uk 49 | */ 50 | public interface BaseMetadata { } 51 | -------------------------------------------------------------------------------- /specification/samples/2012-06/tagannotation.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 2010-02-23T12:51:30 6 | 7 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 8 | 9 | 10 | 11 | 12 | 13 | 14 | This is the description of the sample tag A 15 | SampleTagA 16 | 17 | 18 | 19 | This is the description of the sample tag B 20 | SampleTagB 21 | 22 | 23 | 24 | This is the description of the sample tagset 25 | 26 | 27 | SampleTagset 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/OMEModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model; 36 | 37 | import java.util.List; 38 | import java.util.Map; 39 | 40 | /** 41 | * @author callan 42 | * 43 | */ 44 | public interface OMEModel { 45 | 46 | @SuppressWarnings("UnusedReturnValue") 47 | OMEModelObject addModelObject(String id, OMEModelObject object); 48 | 49 | OMEModelObject removeModelObject(String id); 50 | 51 | OMEModelObject getModelObject(String id); 52 | 53 | Map getModelObjects(); 54 | 55 | @SuppressWarnings("UnusedReturnValue") 56 | boolean addReference(OMEModelObject a, Reference b); 57 | 58 | Map> getReferences(); 59 | 60 | int resolveReferences(); 61 | } 62 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/meta/IMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.meta; 36 | 37 | /** 38 | * A proxy capable of bidirectional communication of biological image data to 39 | * and from a particular storage medium. 40 | * 41 | *

The IMetadata interface is a shorthand for a metadata 42 | * storage implementation that handles both storage (see {@link MetadataStore}) 43 | * and retrieval (see {@link MetadataRetrieve}) of metadata fields. It exists 44 | * mainly to reduce the need to cast between MetadataStore and 45 | * MetadataRetrieve object types. 46 | * 47 | * @author Curtis Rueden ctrueden at wisc.edu 48 | */ 49 | public interface IMetadata extends MetadataRetrieve, MetadataStore { } 50 | -------------------------------------------------------------------------------- /specification/samples/2008-09/dataset-group-project.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This project contains the datasets using cell line A. 5 | 6 | 7 | This is the set of data collect for the Control 8 | 9 | 10 | 11 | John 12 | Smith 13 | j.smith@ome.example.com 14 | Open Microscopy Environment 15 | ome-jsmith 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 2010-02-23T12:51:30 25 | 26 | This image is linked to the Control Set 27 | 28 | 29 | 30 | 31 | 34 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/enums/handlers/IEnumerationHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.enums.handlers; 36 | 37 | import ome.xml.model.enums.Enumeration; 38 | import ome.xml.model.enums.EnumerationException; 39 | 40 | /** 41 | * An enumeration provider for making OME data model enumerations available. 42 | */ 43 | public interface IEnumerationHandler { 44 | 45 | /** 46 | * Attempt to find an enumeration from a list of enumeration values. 47 | * @param value Value for which to find an enumeration. 48 | */ 49 | Enumeration getEnumeration(String value) throws EnumerationException; 50 | 51 | /** 52 | * Retrieve the entity corresponding to this handler. 53 | */ 54 | Class getEntity(); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Maven 3 | 4 | on: 5 | push: 6 | pull_request: 7 | schedule: 8 | - cron: '0 0 * * 0' 9 | 10 | jobs: 11 | build: 12 | permissions: 13 | contents: read 14 | strategy: 15 | matrix: 16 | java: [8, 11, 17, 21] 17 | os: [ubuntu-latest, windows-latest, macos-latest] 18 | python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] 19 | exclude: 20 | - java: 8 21 | python-version: '3.9' 22 | - java: 8 23 | python-version: '3.10' 24 | - java: 8 25 | python-version: '3.11' 26 | - java: 8 27 | python-version: '3.12' 28 | - java: 8 29 | python-version: '3.13' 30 | - java: 17 31 | python-version: '3.9' 32 | - java: 17 33 | python-version: '3.10' 34 | - java: 17 35 | python-version: '3.11' 36 | - java: 17 37 | python-version: '3.12' 38 | - java: 17 39 | python-version: '3.13' 40 | - java: 21 41 | python-version: '3.9' 42 | - java: 21 43 | python-version: '3.10' 44 | - java: 21 45 | python-version: '3.11' 46 | - java: 21 47 | python-version: '3.12' 48 | - java: 21 49 | python-version: '3.13' 50 | runs-on: ${{ matrix.os }} 51 | env: 52 | maven_commands: install 53 | steps: 54 | - uses: actions/checkout@v4 55 | - name: Set up Python 56 | uses: actions/setup-python@v5 57 | with: 58 | python-version: ${{ matrix.python-version }} 59 | - name: Install dependencies 60 | run: | 61 | python -m pip install --upgrade pip 62 | pip install -r requirements.txt 63 | - name: Set up JDK ${{ matrix.java }} 64 | uses: actions/setup-java@v4 65 | with: 66 | java-version: ${{ matrix.java }} 67 | distribution: 'zulu' 68 | cache: 'maven' 69 | - name: Build 70 | run: mvn ${{ env.maven_commands }} 71 | release: 72 | permissions: 73 | contents: write 74 | needs: build 75 | if: startsWith(github.ref, 'refs/tags') 76 | runs-on: ubuntu-latest 77 | steps: 78 | - uses: actions/checkout@v4 79 | - name: Create a GitHub release 80 | run: gh release create --generate-notes "${GITHUB_REF#refs/tags/}" 81 | env: 82 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 83 | -------------------------------------------------------------------------------- /specification/samples/2016-06/hcs.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 2008-02-06T13:43:19 36 | An example OME compliant file, based on Olympus.oib 37 | 41 | 44 | 47 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PositiveLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * An integer whose constraints are bound to Java's 64-bit signed integer type 39 | * and a further positive restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class PositiveLong extends NonNegativeLong { 44 | 45 | public PositiveLong(Long value) { 46 | super(value); 47 | if (value == null || value < 1) { 48 | throw new IllegalArgumentException( 49 | value + " must be non-null and strictly positive."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an PositiveLong object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static PositiveLong valueOf(String s) { 64 | return new PositiveLong(Long.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PositiveFloat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * A float whose constraints are bound to Java's 64-bit float (double) and a 39 | * further positive restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class PositiveFloat extends NonNegativeFloat { 44 | 45 | public PositiveFloat(Double value) { 46 | super(value); 47 | if (value == null || value <= 0) { 48 | throw new IllegalArgumentException( 49 | value + " must be non-null and strictly positive."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an PositiveFloat object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static PositiveFloat valueOf(String s) { 64 | return new PositiveFloat(Double.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PositiveInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * An integer whose constraints are bound to Java's 32-bit signed integer type 39 | * and a further positive restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class PositiveInteger extends NonNegativeInteger { 44 | 45 | public PositiveInteger(Integer value) { 46 | super(value); 47 | if (value == null || value < 1) { 48 | throw new IllegalArgumentException( 49 | value + " must be non-null and strictly positive."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an PositiveInteger object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static PositiveInteger valueOf(String s) { 64 | return new PositiveInteger(Integer.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /specification/samples/2013-06/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/NonNegativeLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * An integer whose constraints are bound to Java's 64-bit signed integer type 39 | * and a further non-negative restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class NonNegativeLong extends PrimitiveType implements PrimitiveNumber { 44 | 45 | public NonNegativeLong(Long value) { 46 | super(value); 47 | if (value == null || value < 0) { 48 | throw new IllegalArgumentException( 49 | value + " must be neither null nor strictly negative."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an NonNegativeLong object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static NonNegativeLong valueOf(String s) { 64 | return new NonNegativeLong(Long.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/NonNegativeFloat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * A float whose constraints are bound to Java's 64-bit float (double) and a 39 | * further non-negative restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class NonNegativeFloat extends PrimitiveType implements PrimitiveNumber { 44 | 45 | public NonNegativeFloat(Double value) { 46 | super(value); 47 | if (value == null || value < 0) { 48 | throw new IllegalArgumentException( 49 | value + " must be neither null nor strictly negative."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an NonNegativeFloat object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static NonNegativeFloat valueOf(String s) { 64 | return new NonNegativeFloat(Double.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/NonNegativeInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * An integer whose constraints are bound to Java's 32-bit signed integer type 39 | * and a further non-negative restriction. 40 | * 41 | * @author callan 42 | */ 43 | public class NonNegativeInteger extends PrimitiveType implements PrimitiveNumber { 44 | 45 | public NonNegativeInteger(Integer value) { 46 | super(value); 47 | if (value == null || value < 0) { 48 | throw new IllegalArgumentException( 49 | value + " must be neither null nor strictly negative."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an NonNegativeInteger object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static NonNegativeInteger valueOf(String s) { 64 | return new NonNegativeInteger(Integer.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PercentFraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * A floating point value whose constraints are bound to Java's 32-bit floating 39 | * point type and a further 0.0f minimum and 1.0f maximum. 40 | * 41 | * @author callan 42 | */ 43 | public class PercentFraction extends PrimitiveType implements PrimitiveNumber { 44 | 45 | public PercentFraction(Float value) { 46 | super(value); 47 | if (value == null || value < 0.0 || value > 1.0) { 48 | throw new IllegalArgumentException( 49 | value + " must be non-null and between 0.0 and 1.0 inclusive."); 50 | } 51 | } 52 | 53 | public Number getNumberValue() { 54 | return value; 55 | } 56 | 57 | /** 58 | * Returns an PercentFraction object holding the value of 59 | * the specified string. 60 | * @param s The string to be parsed. 61 | * @return See above. 62 | */ 63 | public static PercentFraction valueOf(String s) { 64 | return new PercentFraction(Float.valueOf(s)); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /specification/samples/2012-06/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /specification/samples/2010-06/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Hello World! 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /.classpath-template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Bio-Formats 2 | 3 | Guidance for contributing to OME projects in general can be found at 4 | https://docs.openmicroscopy.org/contributing/ 5 | 6 | Developer documentation specifically for Bio-Formats is at 7 | https://docs.openmicroscopy.org/latest/bio-formats/developers/ 8 | 9 | The README file gives instructions for testing your code before opening a PR, 10 | please ensure you read these. 11 | 12 | ## The Quick Version 13 | 14 | * Fork the GitHub repository. 15 | * Create a branch for your work based on the latest `dev_x` e.g. dev_5_0 or 16 | `develop` branch. Unless you are targeting a specific release, it is 17 | best to default to working against `develop`. 18 | * Make your commits, test your changes locally as per the README, and open a 19 | PR. 20 | * Make sure you include details of the problem you are fixing and how to test 21 | your changes. 22 | * We may need you to submit some test data 23 | [via Zenodo](https://zenodo.org/communities/bio-formats/). If the 24 | files are particularly large (> ~2 GB), contact the 25 | [image.sc forum](https://forum.image.sc/) 26 | and we will get back to you with secure upload details. 27 | 28 | ## External Contributors 29 | 30 | * PRs submitted from outside OME will get an initial review to identify if 31 | they are suitable to pass into our continuous integration system for 32 | building and testing. We try to do this within 2 days of submission but 33 | please be patient if we are busy and it takes longer. 34 | 35 | * If there are any obvious issues, we will comment and wait for you to fix 36 | them. You can help this process by ensuring that the Travis build is passing 37 | when you first submit the PR. 38 | 39 | * Once we are confident the PR contains no obvious errors, an "include" label 40 | will be added which means the PR will be included in the merge build jobs 41 | for the appropriate branch. 42 | 43 | * Build failures will then be noted on the PR and we will either submit a 44 | patch or provide sufficient information for you to fix the problem yourself. 45 | The "include" label will be removed until this is completed. 46 | 47 | * The PR will be merged once all the builds are green with the "include" label 48 | added. 49 | 50 | ## Contributing to Bio-Formats Documentation 51 | 52 | The documentation hosted at 53 | https://docs.openmicroscopy.org/latest/bio-formats/ is built from the 54 | `/docs/sphinx/` directory. Contributions are welcome but please follow the 55 | style guidance from the 56 | [OME Documentation Repository README](https://github.com/openmicroscopy/ome-documentation/blob/develop/README.rst#conventions-used). 57 | 58 | Documentation for new supported formats is auto-generated so it is best to 59 | contact the [image.sc forum](https://forum.image.sc/) 60 | before embarking on such a change, or submit your new reader code and let one 61 | of the main OME team deal with the documentation for you. 62 | -------------------------------------------------------------------------------- /specification/samples/2010-04/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 2010-02-23T12:51:30 11 | 14 | 16 | 18 | 19 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 21 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 23 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 52 | 53 | Hello World! 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /specification/samples/2016-06/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 2010-02-23T12:51:30 8 | 10 | 12 | 14 | 15 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 17 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 19 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | AOnpAA== 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/model/primitives/PrimitiveType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.model.primitives; 36 | 37 | /** 38 | * A primitive type from an XSD definition with a given set of constraints. 39 | * 40 | * @author callan 41 | */ 42 | public abstract class PrimitiveType { 43 | 44 | /** The delegate value. */ 45 | T value; 46 | 47 | /** 48 | * Default constructor. 49 | * @param value The delegate value to use. 50 | */ 51 | PrimitiveType(T value) { 52 | this.value = value; 53 | } 54 | 55 | /** 56 | * Default constructor. 57 | */ 58 | PrimitiveType() { 59 | } 60 | 61 | /** 62 | * Retrieves the concrete delegate value. 63 | * @return See above. 64 | */ 65 | public T getValue() { 66 | return value; 67 | } 68 | 69 | /* (non-Javadoc) 70 | * @see java.lang.Object#toString() 71 | */ 72 | @Override 73 | public String toString() { 74 | return value.toString(); 75 | } 76 | 77 | /* (non-Javadoc) 78 | * @see java.lang.Object#equals(java.lang.Object) 79 | */ 80 | @Override 81 | public boolean equals(Object obj) { 82 | if (obj instanceof PrimitiveType) { 83 | return value.equals(((PrimitiveType) obj).getValue()); 84 | } 85 | return value.equals(obj); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/SingularBackReferenceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.Detector; 40 | import ome.xml.model.Instrument; 41 | 42 | import org.testng.annotations.BeforeMethod; 43 | import org.testng.annotations.Test; 44 | 45 | /** 46 | */ 47 | public class SingularBackReferenceTest { 48 | 49 | public static final String DETECTOR_ID = "Detector:1"; 50 | 51 | public static final String INSTRUMENT_ID = "Instrument:1"; 52 | 53 | private Instrument instrument; 54 | 55 | private Detector detector; 56 | 57 | @BeforeMethod 58 | public void setUp() { 59 | instrument = new Instrument(); 60 | instrument.setID(INSTRUMENT_ID); 61 | detector = new Detector(); 62 | detector.setID("DETECTOR_ID"); 63 | instrument.addDetector(detector); 64 | } 65 | 66 | @Test 67 | public void testDetectorInstrumentBackReference() { 68 | Instrument backReference = detector.getInstrument(); 69 | assertEquals(1, instrument.sizeOfDetectorList()); 70 | Detector forwardReference = instrument.getDetector(0); 71 | assertNotNull(forwardReference); 72 | assertNotNull(backReference); 73 | assertEquals(INSTRUMENT_ID, backReference.getID()); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /specification/samples/2015-01/hcs.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 2008-02-06T13:43:19 39 | An example OME compliant file, based on Olympus.oib 40 | 44 | 47 | 50 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /specification/samples/2015-01/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 2010-02-23T12:51:30 13 | 15 | 17 | 19 | 20 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 22 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 24 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/NonNegativeLongTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.primitives.NonNegativeLong; 40 | 41 | import org.testng.annotations.Test; 42 | 43 | /** 44 | */ 45 | public class NonNegativeLongTest { 46 | 47 | @Test(expectedExceptions={IllegalArgumentException.class}) 48 | public void testMinusOne() { 49 | new NonNegativeLong(-1L); 50 | } 51 | 52 | @Test 53 | public void testZero() { 54 | new NonNegativeLong(0L); 55 | } 56 | 57 | @Test 58 | public void testPositiveOne() { 59 | new NonNegativeLong(1L); 60 | } 61 | 62 | @Test 63 | public void testEquivalence() { 64 | NonNegativeLong a = new NonNegativeLong(1L); 65 | NonNegativeLong b = new NonNegativeLong(1L); 66 | NonNegativeLong c = new NonNegativeLong(2L); 67 | Long d = new Long(1L); 68 | Long e = new Long(2L); 69 | Long f = new Long(3L); 70 | assertFalse(a == b); 71 | assertFalse(a == c); 72 | assertTrue(a.equals(b)); 73 | assertFalse(a.equals(c)); 74 | assertTrue(a.equals(d)); 75 | assertFalse(a.equals(e)); 76 | assertTrue(c.equals(e)); 77 | assertFalse(a.equals(f)); 78 | } 79 | 80 | @Test 81 | public void testToString() { 82 | assertEquals("1", new NonNegativeLong(1L).toString()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /specification/samples/2011-06/ROI.ome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2010-02-23T12:51:30 5 | 6 | 7 | 8 | 9 | /wCrzur//wB5oMPi/wBIbJO3AP8ePGCF 10 | AP+rzuv/AAB5n8Pi/wBHbJO3//8dPGCF 11 | //+szuv/AP95n8PiAABHbZO3AP8dPF+G 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Hello World! 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/PositiveLongTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.primitives.PositiveLong; 40 | 41 | import org.testng.annotations.Test; 42 | 43 | /** 44 | */ 45 | public class PositiveLongTest { 46 | 47 | @Test(expectedExceptions={IllegalArgumentException.class}) 48 | public void testMinusOne() { 49 | new PositiveLong(-1L); 50 | } 51 | 52 | @Test(expectedExceptions={IllegalArgumentException.class}) 53 | public void testZero() { 54 | new PositiveLong(0L); 55 | } 56 | 57 | @Test 58 | public void testPositiveOne() { 59 | new PositiveLong(1L); 60 | } 61 | 62 | @Test 63 | public void testEquivalence() { 64 | PositiveLong a = new PositiveLong(1L); 65 | PositiveLong b = new PositiveLong(1L); 66 | PositiveLong c = new PositiveLong(2L); 67 | Long d = new Long(1L); 68 | Long e = new Long(2L); 69 | Long f = new Long(3L); 70 | assertFalse(a == b); 71 | assertFalse(a == c); 72 | assertTrue(a.equals(b)); 73 | assertFalse(a.equals(c)); 74 | assertTrue(a.equals(d)); 75 | assertFalse(a.equals(e)); 76 | assertTrue(c.equals(e)); 77 | assertFalse(a.equals(f)); 78 | } 79 | 80 | @Test 81 | public void testToString() { 82 | assertEquals("1", new PositiveLong(1L).toString()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/PercentFractionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.primitives.PercentFraction; 40 | 41 | import org.testng.annotations.Test; 42 | 43 | /** 44 | */ 45 | public class PercentFractionTest { 46 | 47 | @Test(expectedExceptions={IllegalArgumentException.class}) 48 | public void testMinusOne() { 49 | new PercentFraction(-1.0f); 50 | } 51 | 52 | @Test 53 | public void testZero() { 54 | new PercentFraction(0.0f); 55 | } 56 | 57 | @Test 58 | public void testPositiveOne() { 59 | new PercentFraction(1.0f); 60 | } 61 | 62 | @Test 63 | public void testEquivalence() { 64 | PercentFraction a = new PercentFraction(0.5f); 65 | PercentFraction b = new PercentFraction(0.5f); 66 | PercentFraction c = new PercentFraction(1.0f); 67 | Float d = new Float(0.5f); 68 | Float e = new Float(1.0f); 69 | Float f = new Float(1.5f); 70 | assertFalse(a == b); 71 | assertFalse(a == c); 72 | assertTrue(a.equals(b)); 73 | assertFalse(a.equals(c)); 74 | assertTrue(a.equals(d)); 75 | assertFalse(a.equals(e)); 76 | assertTrue(c.equals(e)); 77 | assertFalse(a.equals(f)); 78 | } 79 | 80 | @Test 81 | public void testToString() { 82 | assertEquals("1.0", new PercentFraction(1.0f).toString()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/NonNegativeFloatTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.primitives.NonNegativeFloat; 40 | 41 | import org.testng.annotations.Test; 42 | 43 | /** 44 | */ 45 | public class NonNegativeFloatTest { 46 | 47 | @Test(expectedExceptions={IllegalArgumentException.class}) 48 | public void testMinusOne() { 49 | new NonNegativeFloat(-1.0); 50 | } 51 | 52 | @Test 53 | public void testZero() { 54 | new NonNegativeFloat(0.0); 55 | } 56 | 57 | @Test 58 | public void testPositiveOne() { 59 | new NonNegativeFloat(1.0); 60 | } 61 | 62 | @Test 63 | public void testEquivalence() { 64 | NonNegativeFloat a = new NonNegativeFloat(0.1); 65 | NonNegativeFloat b = new NonNegativeFloat(0.1); 66 | NonNegativeFloat c = new NonNegativeFloat(2.0); 67 | Double d = new Double(0.1); 68 | Double e = new Double(2.0); 69 | Double f = new Double(3.0); 70 | assertFalse(a == b); 71 | assertFalse(a == c); 72 | assertTrue(a.equals(b)); 73 | assertFalse(a.equals(c)); 74 | assertTrue(a.equals(d)); 75 | assertFalse(a.equals(e)); 76 | assertTrue(c.equals(e)); 77 | assertFalse(a.equals(f)); 78 | } 79 | 80 | @Test 81 | public void testToString() { 82 | assertEquals("0.1", new NonNegativeFloat(0.1).toString()); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ome-xml/src/main/java/ome/xml/meta/OMEXMLMetadataRoot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.meta; 36 | 37 | import org.w3c.dom.Element; 38 | 39 | import ome.xml.model.OME; 40 | import ome.xml.model.OMEModel; 41 | import ome.xml.model.enums.EnumerationException; 42 | 43 | /** 44 | * A utility class for constructing and manipulating OME-XML DOMs. 45 | * 46 | * @author Roger Leigh rleigh at dundee.ac.uk 47 | */ 48 | public class OMEXMLMetadataRoot extends OME implements MetadataRoot { 49 | 50 | /** Default constructor. */ 51 | public OMEXMLMetadataRoot() 52 | { 53 | super(); 54 | } 55 | 56 | /** 57 | * Constructs OME recursively from an XML DOM tree. 58 | * @param element Root of the XML DOM tree to construct a model object 59 | * graph from. 60 | * @param model Handler for the OME model which keeps track of instances 61 | * and references seen during object population. 62 | * @throws EnumerationException If there is an error instantiating an 63 | * enumeration during model object creation. 64 | */ 65 | public OMEXMLMetadataRoot(Element element, OMEModel model) 66 | throws EnumerationException 67 | { 68 | super(element, model); 69 | } 70 | 71 | /** 72 | * Construct from existing OME instance. 73 | * 74 | * @param ome the OME instance to copy. 75 | */ 76 | public OMEXMLMetadataRoot(OME ome) 77 | { 78 | super(ome); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /ome-xml/src/test/java/ome/xml/utests/NonNegativeIntegerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * #%L 3 | * OME XML library 4 | * %% 5 | * Copyright (C) 2006 - 2016 Open Microscopy Environment: 6 | * - Massachusetts Institute of Technology 7 | * - National Institutes of Health 8 | * - University of Dundee 9 | * - Board of Regents of the University of Wisconsin-Madison 10 | * - Glencoe Software, Inc. 11 | * %% 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 25 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * #L% 33 | */ 34 | 35 | package ome.xml.utests; 36 | 37 | import static org.testng.AssertJUnit.*; 38 | 39 | import ome.xml.model.primitives.NonNegativeInteger; 40 | 41 | import org.testng.annotations.Test; 42 | 43 | /** 44 | */ 45 | public class NonNegativeIntegerTest { 46 | 47 | @Test(expectedExceptions={IllegalArgumentException.class}) 48 | public void testMinusOne() { 49 | new NonNegativeInteger(-1); 50 | } 51 | 52 | @Test 53 | public void testZero() { 54 | new NonNegativeInteger(0); 55 | } 56 | 57 | @Test 58 | public void testPositiveOne() { 59 | new NonNegativeInteger(1); 60 | } 61 | 62 | @Test 63 | public void testEquivalence() { 64 | NonNegativeInteger a = new NonNegativeInteger(1); 65 | NonNegativeInteger b = new NonNegativeInteger(1); 66 | NonNegativeInteger c = new NonNegativeInteger(2); 67 | Integer d = new Integer(1); 68 | Integer e = new Integer(2); 69 | Integer f = new Integer(3); 70 | assertFalse(a == b); 71 | assertFalse(a == c); 72 | assertTrue(a.equals(b)); 73 | assertFalse(a.equals(c)); 74 | assertTrue(a.equals(d)); 75 | assertFalse(a.equals(e)); 76 | assertTrue(c.equals(e)); 77 | assertFalse(a.equals(f)); 78 | } 79 | 80 | @Test 81 | public void testToString() { 82 | assertEquals("1", new NonNegativeInteger(1).toString()); 83 | } 84 | } 85 | --------------------------------------------------------------------------------