dcmjs-org / dcmjs

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

Reading dicom file #373

Open Hyunsoo-dev opened 6 months ago

Hyunsoo-dev commented 6 months ago

When i used the code below,

let DicomDict = dcmjs.data.DicomMessage.readFile(dicomFile);

i got the error as below.

Using multiple character sets is not supported: ,ISO 2022 IR 149

But the standard document says you can put multiple values in a specific character set (0008, 0005). I'm curious why you limited the number of character set, can you change this restriction?

image
/// dcmjs.js -> line 10072
if (readInfo.values.length > 1) {
    if (ignoreErrors) {
        log.warn("Using multiple character sets is not supported, proceeding with just the first character set", readInfo.values);
    } else {
        throw Error("Using multiple character sets is not supported: ".concat(readInfo.values));
   }
}
readInfo.values = ["ISO_IR 192"]; // change SpecificCharacterSet to UTF-8
pieper commented 6 months ago

There were probably no example datasets available when the code was written or it wasn't a priority for any of the developers/users. It would be great if you could propose a change to make dcmjs more compliant with the standards and provide tests so that further compliance can be tested. It would be good to compare how other toolkits work with this kind of data.

WillianVarela commented 2 weeks ago

setting the option { ignoreErrors: true } worked for me