suyashkumar/dicom

EOF error on using Parse function

lafith opened this issue · 3 comments

Hi,
I am trying to parse a dicom file recieved as a byte array, send from Dicomweb-Client. How should I use this function correctly?
Screenshot from 2021-09-17 23-14-14

Hi there! Can you try this with a DICOM we know works with the library (for example one of the ones in here: https://github.com/suyashkumar/dicom/tree/main/testdata).

Also--I'm not super familiar with DICOM servers, but I think it might be possible that you need to grab some HTTP headers for Content-Length (which could prevent you from having to do io.ReadAll), Content-Type and Content-Encoding (see here). From those headers you may need to build metadata elements inserted in front of the actual DICOM payload before parsing (this is my guess looking at a seperate, incompatible implementation). Like I said, I'm not really familiar with this, but hopefully that points you in somewhat the right direction!

I tried with a file from https://github.com/suyashkumar/dicom/tree/main/testdata, still the same error.

I have solved the issue. As per this issue-(ImagingDataCommons/dicomweb-client#54), DicomWeb client was sending data as a Multipart HTTP Response. One can use repos like mime/multipart to handle such responses.