From ffbcb67f5461844c98c82b1ae57ef472cf07a942 Mon Sep 17 00:00:00 2001
From: Henry Pinkard <7969470+henrypinkard@users.noreply.github.com>
Date: Fri, 17 Nov 2023 15:01:58 -0800
Subject: [PATCH] add method for reading metadata without reading image
---
java/pom.xml | 2 +-
.../java/org/micromanager/ndtiffstorage/NDRAMStorage.java | 5 +++++
.../java/org/micromanager/ndtiffstorage/NDTiffAPI.java | 8 ++++++++
.../org/micromanager/ndtiffstorage/NDTiffStorage.java | 8 ++++++++
4 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/java/pom.xml b/java/pom.xml
index 8f17312..5ca4175 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -2,7 +2,7 @@
4.0.0
org.micro-manager.ndtiffstorage
NDTiffStorage
- 2.15.3
+ 2.16.0
jar
NDTiff Storage file format
Java-based writer and reader used for NDTiffStorage format
diff --git a/java/src/main/java/org/micromanager/ndtiffstorage/NDRAMStorage.java b/java/src/main/java/org/micromanager/ndtiffstorage/NDRAMStorage.java
index 91cae0b..7950339 100644
--- a/java/src/main/java/org/micromanager/ndtiffstorage/NDRAMStorage.java
+++ b/java/src/main/java/org/micromanager/ndtiffstorage/NDRAMStorage.java
@@ -108,6 +108,11 @@ public TaggedImage getImage(HashMap axes) {
return new TaggedImage(images_.get(axes), metadata_.get(axes));
}
+ @Override
+ public JSONObject getImageMetadata(HashMap axes) {
+ return metadata_.get(axes);
+ }
+
@Override
public TaggedImage getSubImage(HashMap axes, int xOffset, int yOffset, int width,
int height) {
diff --git a/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffAPI.java b/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffAPI.java
index e073072..b8fe4f9 100644
--- a/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffAPI.java
+++ b/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffAPI.java
@@ -114,6 +114,14 @@ public Future putImage(Object pixels, JSONObject metadata, HashM
*/
public TaggedImage getImage(HashMap axes);
+ /**
+ * Get the metadata for a single image
+ *
+ * @param axes
+ * @return
+ */
+ public JSONObject getImageMetadata(HashMap axes);
+
/**
* Get a sub-image of the image with the specified axes
*
diff --git a/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffStorage.java b/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffStorage.java
index 666dca5..ac49f72 100644
--- a/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffStorage.java
+++ b/java/src/main/java/org/micromanager/ndtiffstorage/NDTiffStorage.java
@@ -943,6 +943,14 @@ public TaggedImage getImage(HashMap axes) {
return getImage(axes, 0);
}
+ @Override
+ public JSONObject getImageMetadata(HashMap axes) {
+ if (fullResStorage_ == null) {
+ return null;
+ }
+ return fullResStorage_.getImageTags(IndexEntryData.serializeAxes(axes));
+ }
+
@Override
public TaggedImage getSubImage(HashMap axes, int xOffset, int yOffset, int width,
int height) {