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 extends Quantity> 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 extends Enumeration> 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 |
45 |
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 |
--------------------------------------------------------------------------------