rexcardan / Evil-DICOM

A C# DICOM Library
168 stars 98 forks source link

Destination array is not long enough to copy all the items in the collection. Check array index and length. #34

Closed foodaemon closed 7 years ago

foodaemon commented 8 years ago

I am getting the following error while trying to parse a DICOM file. This is the file with the Transfer Syntax of Explicit Little Endian (EXPLICIT_VR_LITTLE_ENDIAN).

Destination array is not long enough to copy all the items in the collection. Check array index and length. System.Exception {System.ArgumentException}

Below is my code:

var dicomFile = System.IO.File.ReadAllBytes(file);
var tst = DICOMFileReader.ReadFileMetadata(file);
var dcm = DICOMObject.Read(file);

Any Help would be highly appreciated. Thanks, Robin

rexcardan commented 8 years ago

You don't by chance have an anonymized version you can give me do you? I can debug with a copy and find the root of the issue. I prioritize this kind of error highly.

--I will say that the metadata method is looking at elements with the Group number 0002. These elements should be encoded in implicit VR little endian from the DICOM standard, regardless of what the rest of the object is encoded as.