From 9c68cc90b4c8cb9db2e537dfa291bb628cdf6251 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 7 Nov 2023 15:39:54 -0600 Subject: [PATCH 1/2] CZI: fix image name regression for multi-scene datasets --- components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java b/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java index 1e71c08557b..4b921fb9a75 100644 --- a/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java +++ b/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java @@ -3392,7 +3392,8 @@ private void translateExperiment(Element root) throws FormatException { platePositions.add(value); } String name = well.getAttribute("Name"); - for (int f=0; f Date: Tue, 7 Nov 2023 15:45:05 -0600 Subject: [PATCH 2/2] CZI: use stored attachment image name to determine if label or macro --- .../src/loci/formats/in/ZeissCZIReader.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java b/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java index 4b921fb9a75..14ec8f9fe76 100644 --- a/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java +++ b/components/formats-gpl/src/loci/formats/in/ZeissCZIReader.java @@ -1406,14 +1406,9 @@ else if (positions == 1) { } } } - else if (extraIndex == 0) { - store.setImageName("label image", i); - } - else if (extraIndex == 1) { - store.setImageName("macro image", i); - } - else { - store.setImageName("thumbnail image", i); + else if (extraIndex >= 0 && extraIndex < extraImages.size()) { + AttachmentEntry entry = extraImages.get(extraIndex).attachment; + store.setImageName(entry.getNormalizedName(), i); } // remaining acquisition settings (esp. channels) do not apply to @@ -4557,6 +4552,20 @@ public String toString() { ", filePart = " + filePart + ", contentGUID = " + contentGUID + ", contentFileType = " + contentFileType; } + + public String getNormalizedName() { + if (name == null) { + return ""; + } + String n = name.trim(); + if (n.toLowerCase().startsWith("label")) { + return "label image"; + } + else if (n.toLowerCase().startsWith("slidepreview")) { + return "macro image"; + } + return n; + } } static class Channel {