Loading DICOM from zip archive

540 views Asked by At

I am trying to load DICOMs from a DICOM Server. Loading a single file with the URL is working fine. Now I want to load a whole series of DICOM Data. I get the data from the server with an HTTP-request as a zip archive.

I have tried to unzip the response with the zip.js library and pass the unziped text to the loader.parse function, to load the DICOMs as in the example "viewers_upload". But I get the error that the file could not be parsed.

Is there a way to load the data without the URL? Or how do I have to modify the example so that it will work for a zip archive?

This is the code from unzipping the file and passing it to the parser:

reader.getEntries(function(entries) {
    if (entries.length) {
        //getting one entry from the zipfile
        entries[0].getData(new zip.ArrayBufferWriter(), function (dicom) {
              loader.parse({url: "dicomName", dicom});
        } , function (current, total) {
            });
    }

The error message is:
"dicomParser.readFixedString: attempt to read past end of buffer"
"Uncaught (in promise) parsers.dicom could not parse the file"

I think the problem might be with the returned datatype of the zipfile? Which type do I have to pass to the parse function? How has the structure of the data in the parser has to be? What length of the buffer does the parser expect?

0

There are 0 answers