Skip to content

Commit

Permalink
DZIP with desktop descriptors
Browse files Browse the repository at this point in the history
QuickNII/VisuAlign JSON can be combined with DZIP pyramids.
  • Loading branch information
Tevemadar committed Mar 27, 2024
1 parent 80eeda5 commit 39ccad3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
12 changes: 11 additions & 1 deletion configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,20 @@ async function transformSeries(series) {
anchoring: section.ouv,
markers: section.markers
}));
series.dziproot = `https://data-proxy.ebrains.eu/api/v1/buckets/${series.bucket}/.nesysWorkflowFiles/zippedPyramids`;
}
if(args.dzip) {
series.dziproot = args.dzip.match(/(.*zippedPyramids).*/)[1];
const prefix = args.dzip.match(/.*zippedPyramids\/(.*)\/.*$/)[1];
for(let section of series.slices) {
section.filename = prefix + "/" + section.filename.split(".")[0] + ".dzip";
}
}
if(series.dziproot) {
const dzipmap = new Map;
loaders.DZILoader = async section_id => {
if(!dzipmap.has(section_id)) {
dzipmap.set(section_id, await netunzip(`https://data-proxy.ebrains.eu/api/v1/buckets/${series.bucket}/.nesysWorkflowFiles/zippedPyramids/${section_id}`));
dzipmap.set(section_id, await netunzip(`${series.dziproot}/${section_id}`));
}
const zip = dzipmap.get(section_id);
return new TextDecoder().decode(await zip.get(zip.entries.get(section_id.match(/.*\/(.*)p/)[1])));
Expand Down
28 changes: 24 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
setlog(`Can't access JSON descriptor at ${jsonurl}. Please verify that the link is correct and that it's available for cross-site access ("CORS").\n${json.message}`);
return;
}
document.getElementById("pyramids").hidden=!!json.bucket;
document.getElementById("pyrs").hidden=!!json.bucket;
if(json.bucket) {
let slices=json.sections;
let length=slices.length;
Expand All @@ -49,6 +49,15 @@
`Nonlinear tools: <a target="_blank" href="${nltools}">${nltools}</a>`;
return;
}
if(pyramids.endsWith(".dzip")) {
let baselink=`${location.href.match(/(.*\/)[^/]*/)[1]}filmstripzoom.html?atlas=${atlas.value}&series=${jsonurl}&dzip=${pyramids}`;
let antools=`${baselink}&tools`;
let nltools=`${antools}&nl`;
log.innerHTML=`Viewer: <a target="_blank" href="${baselink}">${baselink}</a><br>`+
`Annotation tools: <a target="_blank" href="${antools}">${antools}</a><br>`+
`Nonlinear tools: <a target="_blank" href="${nltools}">${nltools}</a>`;
return;
}
let slices=json.slices;
let length=slices.length;
if(!pyramids.length){
Expand Down Expand Up @@ -115,9 +124,20 @@
</head>
<body>
LocaliZoom link configurator<br><br>
<input type="text" id="json" placeholder="Complete URL for JSON, https://object.cscs.ch/.../xy.json" oninput="check()"><br>
<input type="text" id="pyramids" placeholder="Container ID only, like &quot;imgsvc-17b7fa98-a152-995b-86d2-fde75106ce0f&quot;, or a collab-slug prefixed with &quot;buckets/&quot;" oninput="check()"><br>
<select id="atlas">
Dataset descriptor, complete URL of QuickNII/VisuAlign (.json), WebAlign (.waln), WebWarp (.wwrp), or LocaliZoom (.lz) file:<br>
<input type="text" id="json" oninput="check()"><br>
<br>
<div id="pyrs">
Pyramids
<ul>
<li>CSCS container ID, like &quot;imgsvc-17b7fa98-a152-995b-86d2-fde75106ce0f&quot; (see first example)</li>
<li>Collab-slug prefixed with &quot;buckets/&quot; (see second example)</li>
<li>Complete link ("API Url") to any .dzip file from the series</li>
</ul>
<input type="text" id="pyramids" placeholder="Container ID only, like , or a collab-slug prefixed with &quot;buckets/&quot;" oninput="check()"><br>
<br>
</div>
<select id="atlas" oninput="check()">
<option value="WHS_SD_Rat_v4_39um">WHS SD Rat v4 39um</option>
<option value="WHS_SD_Rat_v3_39um">WHS SD Rat v3 39um</option>
<option value="WHS_SD_Rat_v2_39um">WHS SD Rat v2 39um</option>
Expand Down

0 comments on commit 39ccad3

Please sign in to comment.