dcmjs-org / dcmjs

Javascript implementation of DICOM manipulation
https://dcmjs.netlify.com/
MIT License
292 stars 111 forks source link

Integration with cornerstoneWADOloader #286

Closed Ouwen closed 2 years ago

Ouwen commented 2 years ago

Hello, I am interested in using dcmjs to parse data in cornerstoneWADOloader. I have an active branch where I am trying to reach parity with the current wadouri code using dicomParser: https://github.com/Ouwen/cornerstoneWADOImageLoader/tree/feat_added_dcmjs

One of the needs is that in parsing pixel data it is important to know whether or not the data is encapsulated. In dicomParser this is determined by whether the data has unknown length (length tag is 0xfffffff).

The tag length metadata is not reported in the dictionary output of dcmjs.data.DicomMessage.readFile(). To get around this, I would like to add a Meta key in addition to the Value key to the output.

This change wouldn't break the current API and it would provide length context or potentially other tag context while parsing.

See #285 for the PR

Ouwen commented 2 years ago

Looking at some of the functions, might be better to use these lines to check for encapsulated dicom: https://github.com/dcmjs-org/dcmjs/blob/a0a0fd59cd67890f182b9dc1bb73609f7822b5d2/src/DicomMessage.js#L12-L30