Public
Edited
Nov 14, 2021
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
parse = byteArray =>
{
try {
// test header
dicomParser.readPart10Header(byteArray);
return dicomParser.parseDicom(byteArray);
} catch (error) {
// workaround of missing P10 header
// https://github.com/cornerstonejs/dicomParser/issues/112#issuecomment-443759299
// TODO: remove the assumption of little endian and implcit data set
var byteStream = new dicomParser.ByteStream(dicomParser.littleEndianByteArrayParser, byteArray, 0);
var dataSet = new dicomParser.DataSet(byteStream.byteArrayParser, byteStream.byteArray, {});
dicomParser.parseDicomDataSetImplicit(dataSet, byteStream, byteStream.byteArray.length, {});
return dataSet;
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/* get the dicom uid list from fo-dicom/fo-dicom */
/*
dicom_uids = {
const res = await soFetch(
'https://raw.githubusercontent.com/fo-dicom/fo-dicom/development/DICOM/Dictionaries/DICOM Dictionary.xml'
);
const xmlStr = await res.text();
const parser = new DOMParser();
const dom = parser.parseFromString(xmlStr, "application/xml");
var uids = {};
dom.querySelectorAll('uid').forEach(el => {
uids[el.getAttribute("uid")] = {
keyword: el.getAttribute("keyword"),
type: el.getAttribute("type"),
name: el.textContent
};
});
return uids;
}
*/
Insert cell
Insert cell
Insert cell
/* get the dicom tag list from fo-dicom/fo-dicom */
/*
dicom_tags = {
const res = await soFetch(
'https://raw.githubusercontent.com/fo-dicom/fo-dicom/development/DICOM/Dictionaries/DICOM Dictionary.xml'
);
const xmlStr = await res.text();
const parser = new DOMParser();
const dom = parser.parseFromString(xmlStr, "application/xml");
var tags = {};
dom.querySelectorAll('tag').forEach(el => {
let group = el.getAttribute("group");
let element = el.getAttribute("element");
tags[group + element] = {
keyword: el.getAttribute("keyword"),
vr: el.getAttribute("vr"),
vm: el.getAttribute("vm"),
name: el.textContent
};
});
return tags;
}
*/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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