Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igoroctaviano/68c65f3e7a1359b5019c355ca228e314 to your computer and use it in GitHub Desktop.
Save igoroctaviano/68c65f3e7a1359b5019c355ca228e314 to your computer and use it in GitHub Desktop.
This is how to parse a DICOM binary to the dicomweb-client's format using dcmjs.
import dcmjs from 'dcmjs';
const { data } = dcmjs;
const { DicomMessage, DicomMetaDictionary } = data;
const arrayBufferOfDICOM = /** Your DICOM file binary */
const dicomDataInTheCorrectResponseFormat = DicomMessage.readFile(arrayBufferOfDICOM).dict;
const dicomDataInANaturalizedFormat = DicomMetaDictionary.naturalizeDataset(dicomDataInTheCorrectResponseFormat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment