Skip to content

dicom.Writer and dicomio.Writer #353

@cajund

Description

@cajund

HI there, this is more of a question than and issue, but I wanted to explain an issue I encountered with the various go-netdicom repos out there (see: #246)

When interacting with a network connection data PDU's (actions DT-1 and AR-7) it's necessary to encode a DIMSE message using what appears to be an equivalent to your dicomio.Writer. (before refactor, is was dicomio.Encoder.). In the original version "WriteElement" was an exposed function from the dicom object, not presented as function receiver. So, it was callable by passing in a dicomio.Encoder. Here's the line:

https://github.com/grailbio/go-dicom/blob/b0e216a1c5cd39a087b0b20538327cc4ae16abdd/writer.go#L117

Here's my challenge, in your dicom.NewWriter() function, you are creating a new dicomio.Writer.

dicom/write.go

Line 40 in 4c45b44

func NewWriter(out io.Writer, opts ...WriteOption) (*Writer, error) {

However, in my situation, I need to pass in an already created dicomio.Writer (or at least an io.Writer) created in previous steps in this process. Would you have any suggestions here, or should I simply update dicomio with a function that returns the embedded io.writer?

Thanks for your help and great work.

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