Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeElements(e io.Writer, elems []*dicom.Element) error
- func EncodeMessage(out io.Writer, v Message) error
- func NewElement(tag tag.Tag, value any) (*dicom.Element, error)
- type CEchoRq
- type CEchoRsp
- type CFindRq
- type CFindRsp
- type CGetRq
- type CGetRsp
- type CMoveRq
- type CMoveRsp
- type CStoreRq
- type CStoreRsp
- type CommandAssembler
- type CommandDataSetType
- type DimseCommand
- type Message
- type MessageDecoder
- func (d *MessageDecoder) Decode(commandField uint16) (Message, error)
- func (d *MessageDecoder) GetCommandDataSetType() (CommandDataSetType, error)
- func (d *MessageDecoder) GetStatus() (s Status, err error)
- func (d *MessageDecoder) GetString(tag dicomtag.Tag, optional isOptionalElement) (string, error)
- func (d *MessageDecoder) GetUInt16(tag dicomtag.Tag, optional isOptionalElement) (uint16, error)
- func (d *MessageDecoder) UnparsedElements() []*dicom.Element
- type MessageID
- type Status
- type StatusCode
Constants ¶
const ( CommandFieldCStoreRq uint16 = 0x0001 CommandFieldCStoreRsp uint16 = 0x8001 CommandFieldCFindRq uint16 = 0x0020 CommandFieldCFindRsp uint16 = 0x8020 CommandFieldCGetRq uint16 = 0x0010 CommandFieldCGetRsp uint16 = 0x8010 CommandFieldCMoveRq uint16 = 0x0021 CommandFieldCMoveRsp uint16 = 0x8021 CommandFieldCEchoRq uint16 = 0x0030 CommandFieldCEchoRsp uint16 = 0x8030 )
const ( RequiredElement isOptionalElement = iota OptionalElement )
Variables ¶
var Success = Status{Status: StatusSuccess}
Success is an OK status for a call.
Functions ¶
func EncodeElements ¶
Encode the given elements. The elements are sorted in ascending tag order.
func EncodeMessage ¶
EncodeMessage serializes the given message. Errors are reported through e.Error()
Types ¶
type CEchoRq ¶
type CEchoRq struct { MessageID MessageID CommandDataSetType CommandDataSetType Extra []*dicom.Element // Unparsed elements }
func (*CEchoRq) CommandField ¶
func (*CEchoRq) GetMessageID ¶
type CEchoRsp ¶
type CEchoRsp struct { MessageIDBeingRespondedTo MessageID CommandDataSetType CommandDataSetType Status Status Extra []*dicom.Element // Unparsed elements }
func (*CEchoRsp) CommandField ¶
func (*CEchoRsp) GetMessageID ¶
type CFindRq ¶
type CFindRq struct { AffectedSOPClassUID string MessageID MessageID Priority uint16 CommandDataSetType CommandDataSetType Extra []*dicom.Element // Unparsed elements }
func (*CFindRq) CommandField ¶
func (*CFindRq) GetMessageID ¶
type CFindRsp ¶
type CFindRsp struct { AffectedSOPClassUID string MessageIDBeingRespondedTo MessageID CommandDataSetType CommandDataSetType Status Status Extra []*dicom.Element // Unparsed elements }
func (*CFindRsp) CommandField ¶
func (*CFindRsp) GetMessageID ¶
type CGetRq ¶
type CGetRq struct { AffectedSOPClassUID string MessageID MessageID Priority uint16 CommandDataSetType CommandDataSetType Extra []*dicom.Element // Unparsed elements }
func (*CGetRq) CommandField ¶
func (*CGetRq) GetMessageID ¶
type CGetRsp ¶
type CGetRsp struct { AffectedSOPClassUID string MessageIDBeingRespondedTo MessageID CommandDataSetType CommandDataSetType NumberOfRemainingSuboperations uint16 NumberOfCompletedSuboperations uint16 NumberOfFailedSuboperations uint16 NumberOfWarningSuboperations uint16 Status Status Extra []*dicom.Element // Unparsed elements }
func (*CGetRsp) CommandField ¶
func (*CGetRsp) GetMessageID ¶
type CMoveRq ¶
type CMoveRq struct { AffectedSOPClassUID string MessageID MessageID Priority uint16 MoveDestination string CommandDataSetType CommandDataSetType Extra []*dicom.Element // Unparsed elements }
func (*CMoveRq) CommandField ¶
func (*CMoveRq) GetMessageID ¶
type CMoveRsp ¶
type CMoveRsp struct { AffectedSOPClassUID string MessageIDBeingRespondedTo MessageID CommandDataSetType CommandDataSetType NumberOfRemainingSuboperations uint16 NumberOfCompletedSuboperations uint16 NumberOfFailedSuboperations uint16 NumberOfWarningSuboperations uint16 Status Status Extra []*dicom.Element // Unparsed elements }
func (*CMoveRsp) CommandField ¶
func (*CMoveRsp) GetMessageID ¶
type CStoreRq ¶
type CStoreRq struct { AffectedSOPClassUID string MessageID MessageID Priority uint16 CommandDataSetType CommandDataSetType AffectedSOPInstanceUID string MoveOriginatorApplicationEntityTitle string MoveOriginatorMessageID MessageID Extra []*dicom.Element // Unparsed elements }
func (*CStoreRq) CommandField ¶
func (*CStoreRq) GetMessageID ¶
type CStoreRsp ¶
type CStoreRsp struct { AffectedSOPClassUID string MessageIDBeingRespondedTo MessageID CommandDataSetType CommandDataSetType AffectedSOPInstanceUID string Status Status Extra []*dicom.Element // Unparsed elements }
func (*CStoreRsp) CommandField ¶
func (*CStoreRsp) GetMessageID ¶
type CommandAssembler ¶
type CommandAssembler struct {
// contains filtered or unexported fields
}
CommandAssembler is a helper that assembles a DIMSE command message and data payload from a sequence of P_DATA_TF PDUs.
func (*CommandAssembler) AddDataPDU ¶
func (commandAssembler *CommandAssembler) AddDataPDU(pdu *pdu.PDataTf) (byte, Message, *DimseCommand, error)
AddDataPDU is to be called for each P_DATA_TF PDU received from the network. If the fragment is marked as the last one, AddDataPDU returns <SOPUID, TransferSyntaxUID, payload, nil>. If it needs more fragments, it returns <"", "", nil, nil>. On error, it returns a non-nil error.
type CommandDataSetType ¶
type CommandDataSetType uint16
const ( // CommandDataSetTypeNull indicates that the DIMSE message has no data payload, // when set in dicom.TagCommandDataSetType. Any other value indicates the // existence of a payload. CommandDataSetTypeNull CommandDataSetType = 0x101 // CommandDataSetTypeNonNull indicates that the DIMSE message has a data // payload, when set in dicom.TagCommandDataSetType. CommandDataSetTypeNonNull CommandDataSetType = 1 )
type DimseCommand ¶
type DimseCommand struct {
// contains filtered or unexported fields
}
func NewDimseCommand ¶
func NewDimseCommand(fpath string) *DimseCommand
func (*DimseCommand) Ack ¶
func (dc *DimseCommand) Ack() error
func (*DimseCommand) AppendData ¶
func (dc *DimseCommand) AppendData(data []byte) error
func (*DimseCommand) Close ¶
func (dc *DimseCommand) Close() error
func (*DimseCommand) Read ¶
func (dc *DimseCommand) Read(p []byte) (int, error)
Read implements io.Reader by delegating to an internal *os.File reader.
func (*DimseCommand) ReadData ¶
func (dc *DimseCommand) ReadData() io.Reader
func (*DimseCommand) Size ¶
func (dc *DimseCommand) Size() int64
Size returns the current size of the underlying file. Returns -1 on error.
type Message ¶
type Message interface { fmt.Stringer // Print human-readable description for debugging. Encode(io.Writer) error // GetMessageID extracts the message ID field. GetMessageID() MessageID // CommandField returns the command field value of this message. CommandField() uint16 // GetStatus returns the the response status value. It is nil for request message // types, and non-nil for response message types. GetStatus() *Status // HasData is true if we expect P_DATA_TF packets after the command packets. HasData() bool }
Message defines the common interface for all DIMSE message types.
type MessageDecoder ¶
type MessageDecoder struct {
// contains filtered or unexported fields
}
Helper class for extracting values from a list of DicomElement.
func (*MessageDecoder) Decode ¶
func (d *MessageDecoder) Decode(commandField uint16) (Message, error)
func (*MessageDecoder) GetCommandDataSetType ¶
func (d *MessageDecoder) GetCommandDataSetType() (CommandDataSetType, error)
func (*MessageDecoder) GetStatus ¶
func (d *MessageDecoder) GetStatus() (s Status, err error)
func (*MessageDecoder) GetString ¶
func (d *MessageDecoder) GetString(tag dicomtag.Tag, optional isOptionalElement) (string, error)
func (*MessageDecoder) GetUInt16 ¶
func (d *MessageDecoder) GetUInt16(tag dicomtag.Tag, optional isOptionalElement) (uint16, error)
Find an element with "tag", and extract a uint16 from it. Errors are reported in d.err.
func (*MessageDecoder) UnparsedElements ¶
func (d *MessageDecoder) UnparsedElements() []*dicom.Element
type Status ¶
type Status struct { // Status==StatusSuccess on success. A non-zero value on error. Status StatusCode // Optional error payloads. ErrorComment string // Encoded as (0000,0902) }
Status represents a result of a DIMSE call. P3.7 C defines list of status codes and error payloads.
type StatusCode ¶
type StatusCode uint16
StatusCode represents a DIMSE service response code, as defined in P3.7
const ( StatusSuccess StatusCode = 0 StatusCancel StatusCode = 0xFE00 StatusSOPClassNotSupported StatusCode = 0x0112 StatusInvalidArgumentValue StatusCode = 0x0115 StatusInvalidAttributeValue StatusCode = 0x0106 StatusInvalidObjectInstance StatusCode = 0x0117 StatusUnrecognizedOperation StatusCode = 0x0211 StatusNotAuthorized StatusCode = 0x0124 StatusPending StatusCode = 0xff00 // C-STORE-specific status codes. P3.4 GG4-1 CStoreOutOfResources StatusCode = 0xa700 CStoreCannotUnderstand StatusCode = 0xc000 CStoreDataSetDoesNotMatchSOPClass StatusCode = 0xa900 // C-FIND-specific status codes. CFindUnableToProcess StatusCode = 0xc000 // C-MOVE/C-GET-specific status codes. CMoveOutOfResourcesUnableToCalculateNumberOfMatches StatusCode = 0xa701 CMoveOutOfResourcesUnableToPerformSubOperations StatusCode = 0xa702 CMoveMoveDestinationUnknown StatusCode = 0xa801 CMoveDataSetDoesNotMatchSOPClass StatusCode = 0xa900 // Warning codes. StatusAttributeValueOutOfRange StatusCode = 0x0116 StatusAttributeListError StatusCode = 0x0107 )
func (StatusCode) String ¶
func (i StatusCode) String() string