Skip to content

Commit

Permalink
Cleanup and use schema from ome branch on NGFF repo
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Oct 25, 2024
1 parent 6acf3b2 commit 775c3d2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion public/ngff_viewers.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "neuroglancer",
"logo": "/neuroglancer.png",
"//": "NB: The {URL} in the href is replaced with NGFF image URL",
"href": "https://neuroglancer-demo.appspot.com/#!{%22layers%22:[{%22source%22:%22zarr3://{URL}%22,%22name%22:%22OME-NGFF%22}]}"
"href": "https://neuroglancer-demo.appspot.com/#!{%22layers%22:[{%22source%22:%22zarr://{URL}%22,%22name%22:%22OME-NGFF%22}]}"
},
{
"name": "Allen Cell Feature Explorer 3D viewer",
Expand Down
4 changes: 2 additions & 2 deletions src/Bioformats2rawLayout/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
// MUST match if we have both...
if (series.length !== xmlRsp.images.length) {
rsp.errors = [
`Length mismatch: series: ${series.length} != ome.xml: ${5}`,
`Images length mismatch: series: ${series.length} != ome.xml: ${xmlRsp.images.length}`,
];
}
}
Expand Down Expand Up @@ -109,7 +109,7 @@
</script>
<article>
Reading: <a href={source}>/{zarrName}/{zarrAttrsFileName}</a>
Reading: <a href={source}/{zarrAttrsFileName}>/{zarrName}/{zarrAttrsFileName}</a>
Loading metadata:<a href={metadataUrl}>{metadataName}</a><br />
Expand Down
2 changes: 1 addition & 1 deletion src/JsonBrowser/DetailsPrePanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ details {
overflow: auto;
}
</style>
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script>
// import { openArray, slice } from "zarr";
import { range, getChunkAndShardShapes } from "../../../utils";
import { get, writable } from "svelte/store";
import ChunkViewer from "./ChunkViewer.svelte";
Expand Down Expand Up @@ -40,8 +39,6 @@
// clear previous chunk
chunk = undefined;
// Use zarr like this, otherwise we get "Error: Unknown codec: bytes"
// let zarr = await import("https://cdn.jsdelivr.net/npm/zarrita@next/+esm");
let url = source + "/" + zarrPath;
const store = new zarr.FetchStore(url);
const arr = await zarr.open(store, { kind: "array" });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
try {
console.log('renderImageToCanvas...', chunk.shape)
chunk2d = sliceArray(chunk, chunkSlice);
// chunk2d = chunk;
errorMsg = undefined;
} catch (error) {
errorMsg = `Slicing (${chunk.shape}) failed with slice (${chunkSlice})`;
Expand Down
2 changes: 1 addition & 1 deletion src/JsonValidator/RoCrate/RoCrateValidator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export let jsonData;
// Try to find various fields in the Ro-Crate metadata
// Try to find various fields in the RO-Crate metadata
let license = jsonData["@graph"].find(item => item["license"])?.license;
let name = jsonData["@graph"].find(item => item["name"])?.name;
let description = jsonData["@graph"].find(item => item["description"])?.description;
Expand Down
2 changes: 1 addition & 1 deletion src/JsonValidator/RoCrate/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
background: linear-gradient(to right, #ccc, #aaa);
text-align: center;
}
</style>
</style>
2 changes: 1 addition & 1 deletion src/JsonValidator/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<article>
<p>
Validating: <a href={source}>/{zarrName}/{zarrAttrsFileName}</a>
Validating: <a href={source}/{zarrAttrsFileName}>/{zarrName}/{zarrAttrsFileName}</a>
</p>
{versionMessage}
Expand Down
6 changes: 2 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ export const FILE_NOT_FOUND = "File not found";

export function getSchemaUrl(schemaName, version) {
if (version == "0.5" || version == "0.5-dev2") {
// TEMP: use open PR branch
return `https://raw.githubusercontent.com/normanrz/ngff/spec-rfc2/latest/schemas/${schemaName}.schema`;
} else if (version == "0.5-dev1") {
return `https://raw.githubusercontent.com/d-v-b/ngff/multiple_zarr_versions/0.5-dev1/schemas/${schemaName}.schema`;
// TEMP: use our branch based on Norman's spec-rfc2 PR at https://github.com/ome/ngff/pull/242
return `https://raw.githubusercontent.com/ome/ngff/spec-rfc2/latest/schemas/${schemaName}.schema`;
}
return `https://raw.githubusercontent.com/ome/ngff/main/${version}/schemas/${schemaName}.schema`;
}
Expand Down

0 comments on commit 775c3d2

Please sign in to comment.