From 3b3cda8c9a10f6d1627a0ac27980172d3d396746 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Thu, 24 Oct 2024 08:56:01 -0500 Subject: [PATCH 1/3] Update all actions to v4 --- .github/workflows/maven.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 2887001..6c72c09 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,7 +28,7 @@ jobs: run: mvn ${{ env.maven_commands }} - name: Upload JAR as artifact if: matrix.os == 'ubuntu-latest' && matrix.java == '1.8' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ZarrReader path: target/*.jar @@ -71,7 +71,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Retrieve version id: get_version run: | @@ -86,7 +86,7 @@ jobs: echo server='ome.releases' >> $GITHUB_OUTPUT fi - name: Set up Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 distribution: 'zulu' From 0adcd0bcd9af5f343294a25dcc2ddc48a9d23761 Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Mon, 28 Oct 2024 13:41:28 +0000 Subject: [PATCH 2/3] Channel coeff can be Integer or Double --- src/loci/formats/in/ZarrReader.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/loci/formats/in/ZarrReader.java b/src/loci/formats/in/ZarrReader.java index 86265db..b4dcb00 100644 --- a/src/loci/formats/in/ZarrReader.java +++ b/src/loci/formats/in/ZarrReader.java @@ -5,7 +5,7 @@ * #%L * Implementation of Bio-Formats readers for the next-generation file formats * %% - * Copyright (C) 2020 - 2022 Open Microscopy Environment + * Copyright (C) 2020 - 2024 Open Microscopy Environment * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -930,7 +930,9 @@ private void parseOmeroMetadata(String root, Map attr) throws IO for (int i = 0; i < channels.size(); i++) { Map channel = (Map) channels.get(i); Boolean channelActive = (Boolean) channel.get("active"); - Double channelCoefficient = (Double) channel.get("coefficient"); + Double channelCoefficient = channel.get("coefficient") instanceof Double ? + ((Double) channel.get("coefficient")) : + ((Integer) channel.get("coefficient")).doubleValue(); String channelColor = (String) channel.get("color"); String channelFamily = (String) channel.get("family"); Boolean channelInverted = (Boolean) channel.get("inverted"); From 6a2f88242443907d820434fd6ab2fcd2f2fd648e Mon Sep 17 00:00:00 2001 From: Dominik Lindner Date: Tue, 29 Oct 2024 14:51:50 +0000 Subject: [PATCH 3/3] Fix issue if 'labels' part of filename --- src/loci/formats/in/ZarrReader.java | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/loci/formats/in/ZarrReader.java b/src/loci/formats/in/ZarrReader.java index b4dcb00..4ed5605 100644 --- a/src/loci/formats/in/ZarrReader.java +++ b/src/loci/formats/in/ZarrReader.java @@ -44,7 +44,6 @@ import java.util.Hashtable; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.stream.Stream; import javax.xml.parsers.ParserConfigurationException; @@ -68,8 +67,6 @@ import loci.formats.FormatReader; import loci.formats.FormatTools; import loci.formats.MetadataTools; -import loci.formats.in.DynamicMetadataOptions; -import loci.formats.in.MetadataOptions; import loci.formats.meta.MetadataStore; import loci.formats.ome.OMEXMLMetadata; import loci.formats.services.JZarrServiceImpl; @@ -77,8 +74,6 @@ import ome.xml.meta.MetadataRoot; import ome.xml.model.MapAnnotation; import ome.xml.model.OME; -import ome.xml.model.Plate; -import ome.xml.model.Screen; import ome.xml.model.StructuredAnnotations; import ome.xml.model.primitives.NonNegativeInteger; import ome.xml.model.primitives.PositiveInteger; @@ -1127,6 +1122,7 @@ private Double getDouble(Map src, String key) { public String[] getUsedFiles(boolean noPixels) { FormatTools.assertId(currentId, true, 1); String zarrRootPath = currentId.substring(0, currentId.indexOf(".zarr") + 5); + int rootPathLength = zarrRootPath.length(); ArrayList usedFiles = new ArrayList(); reloadOptionsFile(zarrRootPath); @@ -1134,12 +1130,17 @@ public String[] getUsedFiles(boolean noPixels) { boolean includeLabels = includeLabels(); try (Stream paths = Files.walk(Paths.get(zarrRootPath), FileVisitOption.FOLLOW_LINKS)) { paths.filter(Files::isRegularFile) - .forEach(path -> {if ((!skipPixels && includeLabels) || - (!skipPixels && !includeLabels && !path.toString().toLowerCase().contains("labels")) || - (skipPixels && includeLabels && (path.endsWith(".zgroup") || path.endsWith(".zattrs") || path.endsWith(".xml"))) || - (skipPixels && !includeLabels && !path.toString().toLowerCase().contains("labels") &&(path.endsWith(".zgroup") || path.endsWith(".zattrs") || path.endsWith(".xml")))) - usedFiles.add(path.toFile().getAbsolutePath()); - }); + .forEach(path -> { + if ( + (!skipPixels && includeLabels) || + (!skipPixels && !includeLabels && (path.toString().toLowerCase().lastIndexOf("labels")