Skip to content

abasb75/dicom-parser

Repository files navigation

@abasb75/dicom-parser

npm i @abasb75/dicom-parser pako --save
npm i @types/pako --save-dev

Demo

demo link

Usage

  1. 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);
})
  1. For parse dataset from local files:
import { loadAndParseFromFiles } from "@abasb75/dicom-parser";

...

loadAndParseFromFiles(file)
.then(dataset=>{
  console.log(dataset);
})
.catch(err=>{
  console.log(error);
});
  1. For parsing arrayBuffer:
import { parse } from "@abasb75/dicom-parser";

...

const dataset = parse(arrayBuffer);
  1. 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

...
  1. get palette color map for PALETTE COLOR photometricInterpretation:
const paletteDataMap = dataset.getPaletteColorData();

if(paletteDataMap){
  // apply palette color to pixels
  ...
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages