Skip to content

dicom.NewParser() creation limited by 100 bytes #355

@cajund

Description

@cajund

I'm incorporating this library into a new version of the netdicom libraries out there, and during data transfer, it is often necessary to convert byte data to dicom elements. This would normally be performed by the dicom.Parse() function in this library.

However, it is common for the length of bytes that need conversion to be less than the hard coded 100 "peak" bytes in the dicom.NewParser() function:

dicom/parse.go

Line 181 in 4c45b44

next100, err := p.reader.rawReader.Peek(100)

In such a case, the Parser is never created.

Have you considered the addition of a NewBytesParser that is similar to NewParser in that it creates the same structure, but is less restrictive. In most cases in the older dicom and netdicom libraries, a NewBytesDecoder() function was present and the transfer syntax was set by the consumer (as it is required). But in many cases, there's usually a transfer syntax that is standard for various elements on the netdicom process (for example, PDU data is always ILE).

I'm going to experiment with lowering this hard coded 100 byte look ahead value, but I would appreciate your thoughts on this. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions