@abasb75/dicom-parser
v0.0.0-test21
Published
a javascript powerfull dicom parser
Downloads
1,457
Maintainers
Readme
@abasb75/dicom-parser
npm i @abasb75/dicom-parser pako --save
npm i @types/pako --save-dev
Demo
demo link
Usage
- For Download dicom and parse from url:
import { loadAndParseFromUrl } from "@abasb75/dicom-parser";
...
const url = "....dcm";
loadAndParseFromUrl(url)
.then(dataset=>{
console.log(dataset);
})
.catch(err=>{
console.log(error);
})
- For parse dataset from local files:
import { loadAndParseFromFiles } from "@abasb75/dicom-parser";
...
loadAndParseFromFiles(file)
.then(dataset=>{
console.log(dataset);
})
.catch(err=>{
console.log(error);
});
- For parsing arrayBuffer:
import { parse } from "@abasb75/dicom-parser";
...
const dataset = parse(arrayBuffer);
- Getting value for dicom tag
...
const transferSyntaxUID = dataset.get(0x0002,0x0010);
const transferSyntaxUID = dataset.string(0x0002,0x0010);
...
const framePixelData = dataset.getPixelData(0); // requested frame number
...
- get
palette color
map forPALETTE COLOR
photometricInterpretation:
const paletteDataMap = dataset.getPaletteColorData();
if(paletteDataMap){
// apply palette color to pixels
...
}