From bc0da638d88c8f95baac344cb5667d54f3fed686 Mon Sep 17 00:00:00 2001 From: Caleb Hulbert Date: Thu, 31 Aug 2023 16:37:13 -0400 Subject: [PATCH] fix: test and opening on windows --- .../kotlin/org/janelia/saalfeldlab/util/n5/N5Helpers.kt | 6 ++++-- .../saalfeldlab/paintera/data/n5/CommitCanvasN5Test.java | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/janelia/saalfeldlab/util/n5/N5Helpers.kt b/src/main/kotlin/org/janelia/saalfeldlab/util/n5/N5Helpers.kt index c8ffc351f..e9918d403 100644 --- a/src/main/kotlin/org/janelia/saalfeldlab/util/n5/N5Helpers.kt +++ b/src/main/kotlin/org/janelia/saalfeldlab/util/n5/N5Helpers.kt @@ -21,6 +21,7 @@ import org.janelia.saalfeldlab.labels.blocks.LabelBlockLookupAdapter import org.janelia.saalfeldlab.labels.blocks.n5.LabelBlockLookupFromN5Relative import org.janelia.saalfeldlab.n5.DatasetAttributes import org.janelia.saalfeldlab.n5.N5Reader +import org.janelia.saalfeldlab.n5.N5URI import org.janelia.saalfeldlab.n5.N5Writer import org.janelia.saalfeldlab.n5.hdf5.N5HDF5Reader import org.janelia.saalfeldlab.n5.universe.N5DatasetDiscoverer @@ -721,8 +722,9 @@ object N5Helpers { ?.takeIf { it.isJsonObject } ?.let { gson.fromJson(it, LabelBlockLookup::class.java) as LabelBlockLookup } ?: let { - val labelToBlockDataset = Paths.get(group, "label-to-block-mapping").toString() - val relativeLookup = LabelBlockLookupFromN5Relative("label-to-block-mapping/s%d") + val labelToBlockDataset = N5URI.normalizeGroupPath(group + reader.groupSeparator + "label-to-block-mapping"); + val scaleDatasetPattern = N5URI.normalizeGroupPath("label-to-block-mapping" + reader.groupSeparator + "s%d") + val relativeLookup = LabelBlockLookupFromN5Relative(scaleDatasetPattern) val numScales = if (metadataState is MultiScaleMetadataState) metadataState.scaleTransforms.size else 1 val labelBlockLookupMetadata = LabelBlockLookupGroup(labelToBlockDataset, numScales) labelBlockLookupMetadata.write(metadataState.writer!!) diff --git a/src/test/java/org/janelia/saalfeldlab/paintera/data/n5/CommitCanvasN5Test.java b/src/test/java/org/janelia/saalfeldlab/paintera/data/n5/CommitCanvasN5Test.java index 536d1fcbe..78b9e3029 100644 --- a/src/test/java/org/janelia/saalfeldlab/paintera/data/n5/CommitCanvasN5Test.java +++ b/src/test/java/org/janelia/saalfeldlab/paintera/data/n5/CommitCanvasN5Test.java @@ -603,10 +603,6 @@ public DummyMetadataState(String labelsDataset, N5Writer container) { } - @Override public void setWriter(@Nullable N5Writer writer) { - - } - @Override public void setGroup(String group) { }