From b3b3990602f3b52650b084d3ed3360fcf21cc56e Mon Sep 17 00:00:00 2001
From: Melissa Linkert
Date: Tue, 7 Jul 2026 16:40:12 -0500
Subject: [PATCH 01/22] Initial API to allow readers to report axis orientation
---
.../loci/formats/AnatomicalOrientation.java | 74 +++++++++++++++++++
.../loci/formats/IAxisOrientationReader.java | 47 ++++++++++++
.../src/loci/formats/Orientation.java | 65 ++++++++++++++++
.../src/loci/formats/OrientationTerm.java | 39 ++++++++++
.../src/loci/formats/OrientationType.java | 56 ++++++++++++++
5 files changed, 281 insertions(+)
create mode 100644 components/formats-api/src/loci/formats/AnatomicalOrientation.java
create mode 100644 components/formats-api/src/loci/formats/IAxisOrientationReader.java
create mode 100644 components/formats-api/src/loci/formats/Orientation.java
create mode 100644 components/formats-api/src/loci/formats/OrientationTerm.java
create mode 100644 components/formats-api/src/loci/formats/OrientationType.java
diff --git a/components/formats-api/src/loci/formats/AnatomicalOrientation.java b/components/formats-api/src/loci/formats/AnatomicalOrientation.java
new file mode 100644
index 00000000000..9fee0f975cc
--- /dev/null
+++ b/components/formats-api/src/loci/formats/AnatomicalOrientation.java
@@ -0,0 +1,74 @@
+/*
+ * #%L
+ * Top-level reader and writer APIs
+ * %%
+ * Copyright (C) 2023 Open Microscopy Environment:
+ * - Board of Regents of the University of Wisconsin-Madison
+ * - Glencoe Software, Inc.
+ * - University of Dundee
+ * %%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * #L%
+ */
+
+package loci.formats;
+
+/**
+ * Enum of anatomical orientation terms defined in:
+ * https://ngff.openmicroscopy.org/rfc/4/#permissible-values
+ */
+public enum AnatomicalOrientation implements OrientationTerm {
+ LEFT_TO_RIGHT("left-to-right"),
+ RIGHT_TO_LEFT("right-to-left"),
+ ANTERIOR_TO_POSTERIOR("anterior-to-posterior"),
+ POSTERIOR_TO_ANTERIOR("posterior-to-anterior"),
+ INFERIOR_TO_SUPERIOR("inferior-to-superior"),
+ SUPERIOR_TO_INFERIOR("superior-to-inferior"),
+ DORSAL_TO_VENTRAL("dorsal-to-ventral"),
+ VENTRAL_TO_DORSAL("ventral-to-dorsal"),
+ DORSAL_TO_PALMAR("dorsal-to-palmar"),
+ PALMAR_TO_DORSAL("palmar-to-dorsal"),
+ DORSAL_TO_PLANTAR("dorsal-to-plantar"),
+ PLANTAR_TO_DORSAL("plantar-to-dorsal"),
+ ROSTRAL_TO_CAUDAL("rostral-to-caudal"),
+ CAUDAL_TO_ROSTRAL("caudal-to-rostral"),
+ CRANIAL_TO_CAUDAL("cranial-to-caudal"),
+ CAUDAL_TO_CRANIAL("caudal-to-cranial"),
+ PROXIMAL_TO_DISTAL("proximal-to-distal"),
+ DISTAL_TO_PROXIMAL("distal-to-proximal"),
+ SUPERFICIAL_TO_DEEP("superficial-to-deep"),
+ DEEP_TO_SUPERFICIAL("deep-to-superficial"),
+ APICAL_TO_BASAL("apical-to-basal"),
+ BASAL_TO_APICAL("basal-to-apical"),
+ APEX_TO_BASE("apex-to-base"),
+ BASE_TO_APEX("base-to-apex");
+
+ private String definedTerm;
+
+ private AnatomicalOrientation(String term) {
+ definedTerm = term;
+ }
+
+ public String getDefinedTerm() {
+ return definedTerm;
+ }
+}
diff --git a/components/formats-api/src/loci/formats/IAxisOrientationReader.java b/components/formats-api/src/loci/formats/IAxisOrientationReader.java
new file mode 100644
index 00000000000..e118839f5c9
--- /dev/null
+++ b/components/formats-api/src/loci/formats/IAxisOrientationReader.java
@@ -0,0 +1,47 @@
+/*
+ * #%L
+ * Top-level reader and writer APIs
+ * %%
+ * Copyright (C) 2023 Open Microscopy Environment:
+ * - Board of Regents of the University of Wisconsin-Madison
+ * - Glencoe Software, Inc.
+ * - University of Dundee
+ * %%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * #L%
+ */
+
+package loci.formats;
+
+/**
+ * Interface for reading axis orientation metadata.
+ */
+public interface IAxisOrientationReader {
+
+ /**
+ * Get one orientation object per axis (e.g. "X", "Y"), for the current series.
+ * Order matches getDimensionOrder(). Array elements may be null.
+ */
+ default Orientation[] getAxisOrientations() {
+ return new Orientation[5];
+ }
+}
diff --git a/components/formats-api/src/loci/formats/Orientation.java b/components/formats-api/src/loci/formats/Orientation.java
new file mode 100644
index 00000000000..4334b6bd4ad
--- /dev/null
+++ b/components/formats-api/src/loci/formats/Orientation.java
@@ -0,0 +1,65 @@
+/*
+ * #%L
+ * Top-level reader and writer APIs
+ * %%
+ * Copyright (C) 2023 Open Microscopy Environment:
+ * - Board of Regents of the University of Wisconsin-Madison
+ * - Glencoe Software, Inc.
+ * - University of Dundee
+ * %%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * #L%
+ */
+
+package loci.formats;
+
+/**
+ * Defines an orientation that can be associated with an axis.
+ */
+public class Orientation {
+
+ private OrientationType type;
+
+ private OrientationTerm value;
+
+ public Orientation(OrientationType type, OrientationTerm term) {
+ this.type = type;
+ this.value = term;
+ }
+
+ public void setOrientationType(OrientationType type) {
+ this.type = type;
+ }
+
+ public OrientationType getOrientationType() {
+ return type;
+ }
+
+ public void setOrientationTerm(OrientationTerm term) {
+ value = term;
+ }
+
+ public OrientationTerm getOrientationTerm() {
+ return value;
+ }
+
+}
diff --git a/components/formats-api/src/loci/formats/OrientationTerm.java b/components/formats-api/src/loci/formats/OrientationTerm.java
new file mode 100644
index 00000000000..6fb26d4a75d
--- /dev/null
+++ b/components/formats-api/src/loci/formats/OrientationTerm.java
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * Top-level reader and writer APIs
+ * %%
+ * Copyright (C) 2023 Open Microscopy Environment:
+ * - Board of Regents of the University of Wisconsin-Madison
+ * - Glencoe Software, Inc.
+ * - University of Dundee
+ * %%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * #L%
+ */
+
+package loci.formats;
+
+/**
+ * Common interface for orientation values.
+ */
+public interface OrientationTerm {
+}
diff --git a/components/formats-api/src/loci/formats/OrientationType.java b/components/formats-api/src/loci/formats/OrientationType.java
new file mode 100644
index 00000000000..3a6c1958b06
--- /dev/null
+++ b/components/formats-api/src/loci/formats/OrientationType.java
@@ -0,0 +1,56 @@
+/*
+ * #%L
+ * Top-level reader and writer APIs
+ * %%
+ * Copyright (C) 2023 Open Microscopy Environment:
+ * - Board of Regents of the University of Wisconsin-Madison
+ * - Glencoe Software, Inc.
+ * - University of Dundee
+ * %%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ * #L%
+ */
+
+package loci.formats;
+
+/**
+ * Enum of recognized axis orientation types.
+ */
+public enum OrientationType {
+ ANATOMICAL("anatomical", AnatomicalOrientation.class);
+
+ private String definedType;
+ private Class extends OrientationTerm> terms;
+
+ private OrientationType(String type, Class extends OrientationTerm> terms) {
+ definedType = type;
+ this.terms = terms;
+ }
+
+ public String getDefinedType() {
+ return definedType;
+ }
+
+ public Class extends OrientationTerm> getOrientationTermClass() {
+ return terms;
+ }
+}
From f9f17d75d598abb680bf7c53247615fb3b59f156 Mon Sep 17 00:00:00 2001
From: Melissa Linkert
Date: Mon, 13 Jul 2026 18:28:10 -0500
Subject: [PATCH 02/22] Switch version to 9.0.0-SNAPSHOT
---
components/bio-formats-plugins/pom.xml | 2 +-
components/bio-formats-tools/pom.xml | 2 +-
components/bundles/bioformats_package/pom.xml | 2 +-
components/forks/turbojpeg/pom.xml | 2 +-
components/formats-api/pom.xml | 2 +-
components/formats-bsd/pom.xml | 2 +-
components/formats-gpl/pom.xml | 2 +-
components/test-suite/pom.xml | 2 +-
pom.xml | 4 ++--
9 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/components/bio-formats-plugins/pom.xml b/components/bio-formats-plugins/pom.xml
index e2b74e34551..378e4efff07 100644
--- a/components/bio-formats-plugins/pom.xml
+++ b/components/bio-formats-plugins/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/components/bio-formats-tools/pom.xml b/components/bio-formats-tools/pom.xml
index 60f46b1858d..3fb44beb111 100644
--- a/components/bio-formats-tools/pom.xml
+++ b/components/bio-formats-tools/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/components/bundles/bioformats_package/pom.xml b/components/bundles/bioformats_package/pom.xml
index 58a0fce4463..933dce46f6d 100644
--- a/components/bundles/bioformats_package/pom.xml
+++ b/components/bundles/bioformats_package/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../../../
diff --git a/components/forks/turbojpeg/pom.xml b/components/forks/turbojpeg/pom.xml
index 93e0fef2417..e06eb82eb1f 100644
--- a/components/forks/turbojpeg/pom.xml
+++ b/components/forks/turbojpeg/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../../../
diff --git a/components/formats-api/pom.xml b/components/formats-api/pom.xml
index 3fb8b395a8e..27d65cb699c 100644
--- a/components/formats-api/pom.xml
+++ b/components/formats-api/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/components/formats-bsd/pom.xml b/components/formats-bsd/pom.xml
index 9f0fb709eed..bd2cf61ee6f 100644
--- a/components/formats-bsd/pom.xml
+++ b/components/formats-bsd/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/components/formats-gpl/pom.xml b/components/formats-gpl/pom.xml
index c12255e73ce..aeda69ab3b0 100644
--- a/components/formats-gpl/pom.xml
+++ b/components/formats-gpl/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/components/test-suite/pom.xml b/components/test-suite/pom.xml
index 6392ab1b24c..5d685a70c99 100644
--- a/components/test-suite/pom.xml
+++ b/components/test-suite/pom.xml
@@ -8,7 +8,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT../..
diff --git a/pom.xml b/pom.xml
index 7fd4abe7de2..06a7b5c5b48 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
omepom-bio-formats
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOTpomBio-Formats projects
@@ -34,7 +34,7 @@
When possible, we advise using the relevant groupId and version
properties for your dependencies rather than hardcoding them. -->
- 8.6.0-SNAPSHOT
+ 9.0.0-SNAPSHOT${maven.build.timestamp}2017${basedir}
From 3e14c9b3c2ab9e8222b46438d26c5e2e27b66e95 Mon Sep 17 00:00:00 2001
From: Melissa Linkert
Date: Mon, 13 Jul 2026 18:28:43 -0500
Subject: [PATCH 03/22] Make sure defined orientation term can always be
retrieved
---
.../formats-api/src/loci/formats/AnatomicalOrientation.java | 1 +
components/formats-api/src/loci/formats/OrientationTerm.java | 3 +++
2 files changed, 4 insertions(+)
diff --git a/components/formats-api/src/loci/formats/AnatomicalOrientation.java b/components/formats-api/src/loci/formats/AnatomicalOrientation.java
index 9fee0f975cc..21c08fa1869 100644
--- a/components/formats-api/src/loci/formats/AnatomicalOrientation.java
+++ b/components/formats-api/src/loci/formats/AnatomicalOrientation.java
@@ -68,6 +68,7 @@ private AnatomicalOrientation(String term) {
definedTerm = term;
}
+ @Override
public String getDefinedTerm() {
return definedTerm;
}
diff --git a/components/formats-api/src/loci/formats/OrientationTerm.java b/components/formats-api/src/loci/formats/OrientationTerm.java
index 6fb26d4a75d..54c7e660c1d 100644
--- a/components/formats-api/src/loci/formats/OrientationTerm.java
+++ b/components/formats-api/src/loci/formats/OrientationTerm.java
@@ -36,4 +36,7 @@
* Common interface for orientation values.
*/
public interface OrientationTerm {
+
+ /** @return the defined vocabulary term for the orientation */
+ String getDefinedTerm();
}
From e31a3920056f04206ae80adb19e5ed5b3f92df8c Mon Sep 17 00:00:00 2001
From: Melissa Linkert
Date: Mon, 13 Jul 2026 18:29:14 -0500
Subject: [PATCH 04/22] Implement IAxisOrientationReader in InveonReader
---
.../src/loci/formats/in/InveonReader.java | 27 ++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/components/formats-gpl/src/loci/formats/in/InveonReader.java b/components/formats-gpl/src/loci/formats/in/InveonReader.java
index 457cc1896e9..9296cf096bc 100644
--- a/components/formats-gpl/src/loci/formats/in/InveonReader.java
+++ b/components/formats-gpl/src/loci/formats/in/InveonReader.java
@@ -34,11 +34,15 @@
import loci.common.DateTools;
import loci.common.Location;
import loci.common.RandomAccessInputStream;
+import loci.formats.AnatomicalOrientation;
import loci.formats.CoreMetadata;
import loci.formats.FormatException;
import loci.formats.FormatReader;
import loci.formats.FormatTools;
+import loci.formats.IAxisOrientationReader;
import loci.formats.MetadataTools;
+import loci.formats.Orientation;
+import loci.formats.OrientationType;
import loci.formats.meta.MetadataStore;
import ome.xml.model.primitives.Timestamp;
import ome.units.quantity.Length;
@@ -46,7 +50,7 @@
/**
* InveonReader is the file format reader for Inveon files.
*/
-public class InveonReader extends FormatReader {
+public class InveonReader extends FormatReader implements IAxisOrientationReader {
// -- Constants --
@@ -56,6 +60,7 @@ public class InveonReader extends FormatReader {
private String datFile;
private ArrayList dataPointers = new ArrayList();
+ private Orientation zAxis = null;
// -- Constructor --
@@ -68,6 +73,17 @@ public InveonReader() {
datasetDescription = "One .hdr file plus one similarly-named file";
}
+ // -- IAxisOrientationReader API methods --
+
+ /* @see loci.formats.IAxisOrientationReader#getAxisOrientations() */
+ @Override
+ public Orientation[] getAxisOrientations() {
+ FormatTools.assertId(currentId, true, 1);
+ Orientation[] axes = new Orientation[5];
+ axes[getDimensionOrder().indexOf("Z") - 2] = zAxis;
+ return axes;
+ }
+
// -- IFormatReader API methods --
/* @see loci.formats.IFormatReader#isThisType(String, boolean) */
@@ -133,6 +149,7 @@ public void close(boolean fileOnly) throws IOException {
if (!fileOnly) {
datFile = null;
dataPointers.clear();
+ zAxis = null;
}
}
@@ -681,20 +698,28 @@ private String transformSubjectOrientation(String value) {
int orientation = Integer.parseInt(value);
switch (orientation) {
case 1:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.INFERIOR_TO_SUPERIOR);
return "Feet first, prone";
case 2:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.SUPERIOR_TO_INFERIOR);
return "Head first, prone";
case 3:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.INFERIOR_TO_SUPERIOR);
return "Feet first, supine";
case 4:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.SUPERIOR_TO_INFERIOR);
return "Head first, supine";
case 5:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.INFERIOR_TO_SUPERIOR);
return "Feet first, right";
case 6:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.SUPERIOR_TO_INFERIOR);
return "Head first, right";
case 7:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.INFERIOR_TO_SUPERIOR);
return "Feet first, left";
case 8:
+ zAxis = new Orientation(OrientationType.ANATOMICAL, AnatomicalOrientation.SUPERIOR_TO_INFERIOR);
return "Head first, left";
}
return "Unknown";
From cc5bb13dd88f16531ea8aecadcc63ea35bbf0632 Mon Sep 17 00:00:00 2001
From: Melissa Linkert
Date: Tue, 14 Jul 2026 18:12:07 -0500
Subject: [PATCH 05/22] Allow fake reader to set axis orientation (for testing)
---
.../src/loci/formats/OrientationType.java | 9 ++++
.../src/loci/formats/in/FakeReader.java | 45 ++++++++++++++++++-
2 files changed, 53 insertions(+), 1 deletion(-)
diff --git a/components/formats-api/src/loci/formats/OrientationType.java b/components/formats-api/src/loci/formats/OrientationType.java
index 3a6c1958b06..8d103fbcc1e 100644
--- a/components/formats-api/src/loci/formats/OrientationType.java
+++ b/components/formats-api/src/loci/formats/OrientationType.java
@@ -53,4 +53,13 @@ public String getDefinedType() {
public Class extends OrientationTerm> getOrientationTermClass() {
return terms;
}
+
+ public static OrientationType fromString(String type) {
+ for (OrientationType t : OrientationType.class.getEnumConstants()) {
+ if (t.getDefinedType().equals(type)) {
+ return t;
+ }
+ }
+ return null;
+ }
}
diff --git a/components/formats-bsd/src/loci/formats/in/FakeReader.java b/components/formats-bsd/src/loci/formats/in/FakeReader.java
index 2a38cdb4604..0e8e493e393 100644
--- a/components/formats-bsd/src/loci/formats/in/FakeReader.java
+++ b/components/formats-bsd/src/loci/formats/in/FakeReader.java
@@ -67,7 +67,11 @@
import loci.formats.FormatException;
import loci.formats.FormatReader;
import loci.formats.FormatTools;
+import loci.formats.IAxisOrientationReader;
import loci.formats.MetadataTools;
+import loci.formats.Orientation;
+import loci.formats.OrientationTerm;
+import loci.formats.OrientationType;
import loci.formats.ResourceNamer;
import loci.formats.gui.AWTImageTools;
import loci.formats.meta.MetadataStore;
@@ -108,7 +112,7 @@
*