pdu

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeAAssociateRq Type = 1 // A_ASSOCIATE_RQ
	TypeAAssociateAc      = 2 // A_ASSOCIATE_AC
	TypeAAssociateRj      = 3 // A_ASSOCIATE_RJ
	TypePDataTf           = 4 // P_DATA_TF
	TypeAReleaseRq        = 5 // A_RELEASE_RQ
	TypeAReleaseRp        = 6 // A_RELEASE_RP
	TypeAAbort            = 7 // A_ABORT
)
View Source
const (
	ItemTypeApplicationContext           = 0x10
	ItemTypePresentationContextRequest   = 0x20
	ItemTypePresentationContextResponse  = 0x21
	ItemTypeAbstractSyntax               = 0x30
	ItemTypeTransferSyntax               = 0x40
	ItemTypeUserInformation              = 0x50
	ItemTypeUserInformationMaximumLength = 0x51
	ItemTypeImplementationClassUID       = 0x52
	ItemTypeAsynchronousOperationsWindow = 0x53
	ItemTypeRoleSelection                = 0x54
	ItemTypeImplementationVersionName    = 0x55
)

Possible Type field values for SubItem.

View Source
const CurrentProtocolVersion uint16 = 1
View Source
const DICOMApplicationContextItemName = "1.2.840.10008.3.1.1.1"

The app context for DICOM. The first item in the A-ASSOCIATE-RQ

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) String

func (pdu *AAbort) String() string

func (*AAbort) WritePayload

func (pdu *AAbort) WritePayload(e *dicomio.Encoder)

type AAssociate

type AAssociate struct {
	Type            Type // One of {TypeA_Associate_RQ,TypeA_Associate_AC}
	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          []SubItem
}

Defines A_ASSOCIATE_{RQ,AC}. P3.8 9.3.2 and 9.3.3

func (*AAssociate) String

func (pdu *AAssociate) String() string

func (*AAssociate) WritePayload

func (pdu *AAssociate) WritePayload(e *dicomio.Encoder)

type AAssociateRj

type AAssociateRj struct {
	Result RejectResultType
	Source SourceType
	Reason RejectReasonType
}

P3.8 9.3.4

func (*AAssociateRj) String

func (pdu *AAssociateRj) String() string

func (*AAssociateRj) WritePayload

func (pdu *AAssociateRj) WritePayload(e *dicomio.Encoder)

type AReleaseRp

type AReleaseRp struct {
}

func (*AReleaseRp) String

func (pdu *AReleaseRp) String() string

func (*AReleaseRp) WritePayload

func (pdu *AReleaseRp) WritePayload(e *dicomio.Encoder)

type AReleaseRq

type AReleaseRq struct {
}

func (*AReleaseRq) String

func (pdu *AReleaseRq) String() string

func (*AReleaseRq) WritePayload

func (pdu *AReleaseRq) WritePayload(e *dicomio.Encoder)

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 AbstractSyntaxSubItem

type AbstractSyntaxSubItem subItemWithName

func (*AbstractSyntaxSubItem) String

func (v *AbstractSyntaxSubItem) String() string

func (*AbstractSyntaxSubItem) Write

func (v *AbstractSyntaxSubItem) Write(e *dicomio.Encoder)

type ApplicationContextItem

type ApplicationContextItem subItemWithName

func (*ApplicationContextItem) String

func (v *ApplicationContextItem) String() string

func (*ApplicationContextItem) Write

func (v *ApplicationContextItem) Write(e *dicomio.Encoder)

type AsynchronousOperationsWindowSubItem

type AsynchronousOperationsWindowSubItem struct {
	MaxOpsInvoked   uint16
	MaxOpsPerformed uint16
}

PS3.7 Annex D.3.3.3.1

func (*AsynchronousOperationsWindowSubItem) String

func (*AsynchronousOperationsWindowSubItem) Write

type ImplementationClassUIDSubItem

type ImplementationClassUIDSubItem subItemWithName

PS3.7 Annex D.3.3.2.1

func (*ImplementationClassUIDSubItem) String

func (*ImplementationClassUIDSubItem) Write

type ImplementationVersionNameSubItem

type ImplementationVersionNameSubItem subItemWithName

PS3.7 Annex D.3.3.2.3

func (*ImplementationVersionNameSubItem) String

func (*ImplementationVersionNameSubItem) Write

type PDU

type PDU interface {
	fmt.Stringer

	// WritePayload encodes the PDU payload. The "payload" here excludes the
	// first 6 bytes that are common to all PDU types - they are encoded in
	// EncodePDU separately.
	WritePayload(*dicomio.Encoder)
}

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) String

func (pdu *PDataTf) String() string

func (*PDataTf) WritePayload

func (pdu *PDataTf) WritePayload(e *dicomio.Encoder)

type PresentationContextItem

type PresentationContextItem struct {
	Type      byte // ItemTypePresentationContext*
	ContextID byte

	// Result is meaningful iff Type=0x21, zero else.
	Result PresentationContextResult

	// 1 byte reserved
	Items []SubItem // List of {Abstract,Transfer}SyntaxSubItem
}

P3.8 9.3.2.2, 9.3.3.2

func (*PresentationContextItem) String

func (v *PresentationContextItem) String() string

func (*PresentationContextItem) Write

type PresentationContextResult

type PresentationContextResult byte

Result of abstractsyntax/transfersyntax handshake during A-ACCEPT. P3.8, 90.3.3.2, table 9-18.

const (
	PresentationContextAccepted                                    PresentationContextResult = 0
	PresentationContextUserRejection                               PresentationContextResult = 1
	PresentationContextProviderRejectionNoReason                   PresentationContextResult = 2
	PresentationContextProviderRejectionAbstractSyntaxNotSupported PresentationContextResult = 3
	PresentationContextProviderRejectionTransferSyntaxNotSupported PresentationContextResult = 4
)

func (PresentationContextResult) String

func (i PresentationContextResult) String() string

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.Decoder) PresentationDataValueItem

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 RoleSelectionSubItem

type RoleSelectionSubItem struct {
	SOPClassUID string
	SCURole     byte
	SCPRole     byte
}

PS3.7 Annex D.3.3.4

func (*RoleSelectionSubItem) String

func (v *RoleSelectionSubItem) String() string

func (*RoleSelectionSubItem) Write

func (v *RoleSelectionSubItem) Write(e *dicomio.Encoder)

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 SubItem

type SubItem interface {
	fmt.Stringer

	// Write serializes the item.
	Write(*dicomio.Encoder)
}

SubItem is the interface for DUL items, such as ApplicationContextItem and TransferSyntaxSubItem.

type SubItemUnsupported

type SubItemUnsupported struct {
	Type byte
	Data []byte
}

Container for subitems that this package doesnt' support

func (*SubItemUnsupported) String

func (item *SubItemUnsupported) String() string

func (*SubItemUnsupported) Write

func (item *SubItemUnsupported) Write(e *dicomio.Encoder)

type TransferSyntaxSubItem

type TransferSyntaxSubItem subItemWithName

func (*TransferSyntaxSubItem) String

func (v *TransferSyntaxSubItem) String() string

func (*TransferSyntaxSubItem) Write

func (v *TransferSyntaxSubItem) Write(e *dicomio.Encoder)

type Type

type Type byte

Type defines type of the PDU packet.

func (Type) String

func (i Type) String() string

type UserInformationItem

type UserInformationItem struct {
	Items []SubItem // P3.8, Annex D.
}

P3.8 9.3.2.3

func (*UserInformationItem) String

func (v *UserInformationItem) String() string

func (*UserInformationItem) Write

func (v *UserInformationItem) Write(e *dicomio.Encoder)

type UserInformationMaximumLengthItem

type UserInformationMaximumLengthItem struct {
	MaximumLengthReceived uint32
}

P3.8 D.1

func (*UserInformationMaximumLengthItem) String

func (*UserInformationMaximumLengthItem) Write

Jump to

Keyboard shortcuts

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