dicom
dicom copied to clipboard
EOF
Version
0.4.5
Intro
It appears that issue 109 from the v1.0 rewrite that we fixed a few days ago is also present in v0.4.5 given the proper circumstances. I encountered this error when attempting to parse a file without dropping pixel data.
Relevant Code
p, err := dicom.NewParserFromFile(location, nil)
if err != nil {
return nil, err
}
defer p.Finish()
parsedData, err := p.Parse(dicom.ParseOptions{})
if err != nil { // Doesn't get past this because it returns "EOF" as an error
return nil, err
}
Adding in the DropPixelData parse option, however, like this parsedData, err := p.Parse(dicom.ParseOptions{DropPixelData: true})
, fixes this error and the parser makes it through the files without issue.
Sample DICOMs
One of the following two files is an artificially generated DICOM, but it appears that the specific DICOM files don't matter for this error as I haven't been able to find one that does work.
Credits
- Work on this bug report was sponsored by: Segmed Inc.
@IChocked I have not been able to reproduce this issue on the fromissue65.dcm
in the zip in the latest v1.0.0 cut. I do see an error in the artifical dicom you included, but may need to dig more into why that is (could be something non-traditional in the dicom too if it was artificially generated).