cornerstonejs / dicomParser

JavaScript parser for DICOM Part 10 data
MIT License
712 stars 228 forks source link

Write using DicomParser #263

Closed syedkibrahim closed 8 months ago

syedkibrahim commented 8 months ago

I am new to Cornerstone and DicomParser. As per my understanding, DicomParser can be used to parse DICOM files and read the tag values. I want to know if there is a way to perform de-identification on the tags and write it back using DicomParser ? It can be done using DCMJS but I want to know if we can use DicomParser as well. Also, is it possible to read a file using DicomParser and write it back using dcmjs ?

Any help or inputs will be appreciated, thanks.

yagni commented 8 months ago

Thanks for your question @syedkibrahim. dicomParser is just used for reading, so you'd have to implement the anonymization yourself. This is such a popular request that there's a simple implementation of de-identification in the examples folder here (issue with some additional considerations here). Do note that it gets much more complicated if you want to support de-indentifying attributes within sequences.

As far as writing a dicomParser dataset using dcmjs, I'm not sure there's a way to do that right now, since their dataset formats are different. You'd have to convert from the dicomParser dataset format to the dcmjs dataset format before writing it out.