pdu

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentProtocolVersion uint16 = 1

Variables

This section is empty.

Functions

func EncodePDU

func EncodePDU(pdu PDU) ([]byte, error)

EncodePDU serializes "pdu" into []byte.

Types

type AAbort

type AAbort struct {
	Source SourceType
	Reason AbortReasonType
}

func (AAbort) Read

func (AAbort) Read(d *dicomio.Reader) (PDU, error)

func (*AAbort) String

func (pdu *AAbort) String() string

func (*AAbort) Write

func (pdu *AAbort) Write() ([]byte, error)

type AAssociateAC

type AAssociateAC struct {
	ProtocolVersion uint16
	// Reserved uint16
	CalledAETitle  string // For .._AC, the value is copied from A_ASSOCIATE_RQ
	CallingAETitle string // For .._AC, the value is copied from A_ASSOCIATE_RQ
	Items          []pdu_item.SubItem
}

Defines A_ASSOCIATE_AC. P3.8 9.3.2 and 9.3.3

func (AAssociateAC) Read

func (AAssociateAC) Read(d *dicomio.Reader) (PDU, error)

func (*AAssociateAC) String

func (pdu *AAssociateAC) String() string

func (*AAssociateAC) Write

func (pdu *AAssociateAC) Write() ([]byte, error)

type AAssociateRQ

type AAssociateRQ struct {
	ProtocolVersion uint16
	// Reserved uint16
	CalledAETitle  string // For .._AC, the value is copied from A_ASSOCIATE_RQ
	CallingAETitle string // For .._AC, the value is copied from A_ASSOCIATE_RQ
	Items          []pdu_item.SubItem
}

Defines A_ASSOCIATE_AC. P3.8 9.3.2 and 9.3.3

func (AAssociateRQ) Read

func (AAssociateRQ) Read(d *dicomio.Reader) (PDU, error)

func (*AAssociateRQ) String

func (pdu *AAssociateRQ) String() string

func (*AAssociateRQ) Write

func (pdu *AAssociateRQ) Write() ([]byte, error)

type AAssociateRj

type AAssociateRj struct {
	Result RejectResultType
	Source SourceType
	Reason RejectReasonType
}

P3.8 9.3.4

func (AAssociateRj) Read

func (AAssociateRj) Read(d *dicomio.Reader) (PDU, error)

func (*AAssociateRj) String

func (pdu *AAssociateRj) String() string

func (*AAssociateRj) Write

func (pdu *AAssociateRj) Write() ([]byte, error)

type AReleaseRp

type AReleaseRp struct {
}

func (AReleaseRp) Read

func (AReleaseRp) Read(d *dicomio.Reader) (PDU, error)

func (*AReleaseRp) String

func (pdu *AReleaseRp) String() string

func (*AReleaseRp) Write

func (pdu *AReleaseRp) Write() ([]byte, error)

type AReleaseRq

type AReleaseRq struct {
}

func (AReleaseRq) Read

func (AReleaseRq) Read(d *dicomio.Reader) (PDU, error)

func (*AReleaseRq) String

func (pdu *AReleaseRq) String() string

func (*AReleaseRq) Write

func (pdu *AReleaseRq) Write() ([]byte, error)

type AbortReasonType

type AbortReasonType byte
const (
	AbortReasonNotSpecified             AbortReasonType = 0
	AbortReasonUnexpectedPDU            AbortReasonType = 2
	AbortReasonUnrecognizedPDUParameter AbortReasonType = 3
	AbortReasonUnexpectedPDUParameter   AbortReasonType = 4
	AbortReasonInvalidPDUParameterValue AbortReasonType = 5
)

func (AbortReasonType) String

func (i AbortReasonType) String() string

type PDU

type PDU interface {
	fmt.Stringer
	Write() ([]byte, error)
	Read(*dicomio.Reader) (PDU, error)
}

PDU is the interface for DUL messages like A-ASSOCIATE-AC, P-DATA-TF.

func ReadPDU

func ReadPDU(in io.Reader, maxPDUSize int) (PDU, error)

EncodePDU reads a "pdu" from a stream. maxPDUSize defines the maximum possible PDU size, in bytes, accepted by the caller.

type PDataTf

type PDataTf struct {
	Items []PresentationDataValueItem
}

func (PDataTf) Read

func (PDataTf) Read(d *dicomio.Reader) (PDU, error)

func (*PDataTf) String

func (pdu *PDataTf) String() string

func (*PDataTf) Write

func (pdu *PDataTf) Write() ([]byte, error)

type PresentationDataValueItem

type PresentationDataValueItem struct {
	// Length: 2 + len(Value)
	ContextID byte

	// P3.8, E.2: the following two fields encode a single byte.
	Command bool // Bit 7 (LSB): 1 means command 0 means data
	Last    bool // Bit 6: 1 means last fragment. 0 means not last fragment.

	// Payload, either command or data
	Value []byte
}

P3.8 9.3.2.2.1 & 9.3.2.2.2

func ReadPresentationDataValueItem

func ReadPresentationDataValueItem(d *dicomio.Reader) (PresentationDataValueItem, error)

func (*PresentationDataValueItem) String

func (v *PresentationDataValueItem) String() string

func (*PresentationDataValueItem) Write

type RejectReasonType

type RejectReasonType byte

Possible values for AAssociateRj.Reason

const (
	RejectReasonNone                               RejectReasonType = 1
	RejectReasonApplicationContextNameNotSupported RejectReasonType = 2
	RejectReasonCallingAETitleNotRecognized        RejectReasonType = 3
	RejectReasonCalledAETitleNotRecognized         RejectReasonType = 7
)

func (RejectReasonType) String

func (i RejectReasonType) String() string

type RejectResultType

type RejectResultType byte

Possible values for AAssociateRj.Result

const (
	ResultRejectedPermanent RejectResultType = 1
	ResultRejectedTransient RejectResultType = 2
)

func (RejectResultType) String

func (i RejectResultType) String() string

type SourceType

type SourceType byte

Possible values for AAssociateRj.Source

const (
	SourceULServiceUser                 SourceType = 1
	SourceULServiceProviderACSE         SourceType = 2
	SourceULServiceProviderPresentation SourceType = 3
)

func (SourceType) String

func (i SourceType) String() string

type Type

type Type byte

Type defines type of the PDU packet.

const (
	TypeAAssociateRq Type = 1 // A_ASSOCIATE_RQ
	TypeAAssociateAc Type = 2 // A_ASSOCIATE_AC
	TypeAAssociateRj Type = 3 // A_ASSOCIATE_RJ
	TypePDataTf      Type = 4 // P_DATA_TF
	TypeAReleaseRq   Type = 5 // A_RELEASE_RQ
	TypeAReleaseRp   Type = 6 // A_RELEASE_RP
	TypeAAbort       Type = 7 // A_ABORT
)

func (Type) String

func (i Type) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL