Open form: Allows to modify DICOM tags and download the modified image/images
Drag and drop a folder or a list of dicom files to visualize in the current viewer
Tag | Name | Value |
---|
let demoFiles = [];
let counter = 0;
const getDemoFileNames = function () {
let demoFileList = [];
for (let i = 1; i < 25; i++) {
let filename = "anon" + i;
demoFileList.push(filename);
}
return demoFileList;
};
// init all
larvitar.initializeImageLoader();
larvitar.initializeCSTools();
larvitar.store.initialize();
larvitar.store.addViewport("viewer");
async function createFile(fileName, cb) {
let response = await fetch("./demo/" + fileName);
let data = await response.blob();
let file = new File([data], fileName);
demoFiles.push(file);
counter++;
if (counter == 24) {
cb();
}
}
function renderSerie() {
larvitar.resetLarvitarManager();
larvitar
.readFiles(demoFiles)
.then(seriesStack => {
// render the first series of the study
let seriesId = _.keys(seriesStack)[0];
let serie = seriesStack[seriesId];
larvitar.renderImage(serie, "viewer").then(() => {
console.log("Image has been rendered");
});
// optionally cache the series
larvitar.populateLarvitarManager(seriesId, serie);
larvitar.cacheImages(serie, function (resp) {
if (resp.loading == 100) {
let cache = larvitar.cornerstone.imageCache;
console.log(
"Cache size: ",
cache.getCacheInfo().cacheSizeInBytes / 1e6,
"Mb"
);
}
});
larvitar.addDefaultTools();
larvitar.setToolActive("Wwwc");
})
.catch(err => console.log(err));
}
let demoFileList = getDemoFileNames();
_.each(demoFileList, function (demoFile) {
createFile(demoFile, renderSerie);
});