Skip to content

Commit

Permalink
Support bioformats2raw.layout images
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Feb 9, 2023
1 parent e1e01af commit 4811ff1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 4 additions & 3 deletions public/zarr_samples.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"urls": [
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0048A/9846152.zarr/",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0048A/9846152.zarr",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.3/9836842.zarr",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.2/6001240.zarr",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/4495402.zarr"
]
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/4495402.zarr",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0048A/9846151.zarr"
]
}
21 changes: 15 additions & 6 deletions src/ImageItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ export default function ImageItem({ source }) {

React.useEffect(() => {
const fn = async function () {
const node = await open(config.source);

const attrs = await node.attrs.asObject();
let node = await open(config.source);
let attrs = await node.attrs.asObject();
console.log("attrs", attrs);

if (attrs.plate) {
return;
} else if (attrs['bioformats2raw.layout']) {
// Use the first image at /0
source = source + "/0";
config = {source}
node = await open(config.source);
attrs = await node.attrs.asObject();
console.log("attrs", attrs);
}

const axes = getNgffAxes(attrs.multiscales);

let layerData = await loadOmeroMultiscales(config, node, attrs);
Expand Down Expand Up @@ -59,9 +70,7 @@ export default function ImageItem({ source }) {
};

let sizes = ["x", "y", "z", "c", "t"].map((dim) => (
<td key={dim}>
{imgInfo?.dims?.[dim]}
</td>
<td key={dim}>{imgInfo?.dims?.[dim]}</td>
));

return (
Expand Down

0 comments on commit 4811ff1

Please sign in to comment.