Published
Edited
Jul 10, 2020
Insert cell
md`# Loading local image files examples`
Insert cell
md`## Load all files in folder`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function compare(){
const checkboxes = Array.from(document.getElementsByName('selectScan'))
const selectedIds = checkboxes.filter(c => c.checked).map(ch => ch.dataset.id);
drawComparisonCanvas(selectedIds, 'comparisonCanvas');
}
Insert cell
Insert cell
Insert cell
Insert cell
loadImage = function(subDir, type, caseNo, sliceNo, algorithm) {
if (algorithm === undefined){
if (multiFileDict[subDir][type][caseNo] !== undefined &&
multiFileDict[subDir][type][caseNo][sliceNo] !== undefined) {
return multiFileDict[subDir][type][caseNo][sliceNo].file;
}
} else {
if (multiFileDict[subDir][type][algorithm] !== undefined &&
multiFileDict[subDir][type][algorithm][caseNo] !== undefined &&
multiFileDict[subDir][type][algorithm][caseNo][sliceNo] !== undefined) {
return multiFileDict[subDir][type][algorithm][caseNo][sliceNo].file;
}
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {html, svg} from "@observablehq/htl";
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more