dcmjs-org / dcmjs

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

Getting ERROR: Value exceeds max length for some DICOM tags #374

Closed syedkibrahim closed 6 months ago

syedkibrahim commented 6 months ago

I'm trying to read the DICOM tags using

dcmjs.data.DicomMessage.readFile()

but I am getting the below error for some of the files: Error: Value exceeds max length, vr: AS, value: NX DE_XXXXXXXXXX, length: 16

Same type of error I got for another file: Error: Value exceeds max length, vr: TM, value: NX DE_XXXXXXXXXX, length: 16

I am new to DICOM and DCMJS, so I'm not entirely sure why this error occurs or if there is any workaround for it. Any inputs will be appreciated, thanks.

pieper commented 6 months ago

Hard to say for sure, but if you can replicate this issue with data you can share publicly then someone may be able to have a look.

If you can't share publicly then you might check to see if the dicom file is even valid. This tool is useful: https://www.dclunie.com/dicom3tools/dciodvfy.html but you an also just try loading in a variety of different tools and see if you can narrow down what's different.

I'll close this now but please open a specific issue if you have something you can replicate on data that you can show is valid.

syedkibrahim commented 6 months ago

Thanks for the input. We will look into that. We actually tried passing the allowInvalidVRLength: true while performing the.write() function after performing basic de-identification. This seems to be working for us. Just putting it here for any future reference.