Documentation
¶
Overview ¶
Package network provides DICOM networking capabilities implementing the DICOM Upper Layer Protocol (DICOM Part 8). It enables communication with PACS, modalities, and other DICOM-compliant systems over TCP.
The package provides both client (SCU - Service Class User) and server (SCP - Service Class Provider) implementations supporting the following DIMSE services:
- C-ECHO: Verification (ping) to test connectivity
- C-STORE: Send/receive DICOM objects
- C-FIND: Query for DICOM objects
- C-MOVE: Retrieve DICOM objects via sub-operations
- C-GET: Retrieve DICOM objects on the same association
SCU (Client) Usage:
scu, err := network.NewSCU(network.SCUConfig{
CallingAE: "MY_APP",
CalledAE: "PACS",
Address: "pacs.hospital.com:11112",
})
if err != nil {
log.Fatal(err)
}
defer scu.Release(ctx)
// Verification
err = scu.Echo(ctx)
// Store a dataset
err = scu.Store(ctx, dataset)
// Query
results, err := scu.Find(ctx, queryDataset)
for result := range results {
fmt.Println(result)
}
SCP (Server) Usage:
scp, err := network.NewSCP(network.SCPConfig{
AETitle: "MY_SCP",
Port: 11112,
})
scp.SetHandler(&MyHandler{})
err = scp.ListenAndServe(ctx)
Index ¶
- Constants
- Variables
- func AllQueryRetrieveSOPClassUIDs() []string
- func AllStorageSOPClassUIDs() []string
- func AllTransferSyntaxUIDs() []string
- func AllWorklistSOPClassUIDs() []string
- func BuildAcceptedContextMap(requested []PresentationContextItem, results []PresentationContextResultItem) map[byte]*PresentationContext
- func BuildCCancelRQ(messageIDBeingRespondedTo uint16) *dataset.Dataset
- func BuildCEchoRQ(messageID uint16) *dataset.Dataset
- func BuildCEchoRSP(messageID uint16, status uint16) *dataset.Dataset
- func BuildCFindRQ(messageID uint16, sopClassUID string, priority uint16) *dataset.Dataset
- func BuildCFindRSP(messageID uint16, sopClassUID string, status uint16, hasDataSet bool) *dataset.Dataset
- func BuildCGetRQ(messageID uint16, sopClassUID string, priority uint16) *dataset.Dataset
- func BuildCGetRSP(messageID uint16, sopClassUID string, status uint16, ...) *dataset.Dataset
- func BuildCMoveRQ(messageID uint16, sopClassUID, moveDestination string, priority uint16) *dataset.Dataset
- func BuildCMoveRSP(messageID uint16, sopClassUID string, status uint16, ...) *dataset.Dataset
- func BuildCStoreRQ(messageID uint16, sopClassUID, sopInstanceUID string, priority uint16) *dataset.Dataset
- func BuildCStoreRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
- func BuildNActionRQ(messageID uint16, sopClassUID, sopInstanceUID string, actionTypeID uint16, ...) *dataset.Dataset
- func BuildNActionRSP(messageID uint16, sopClassUID, sopInstanceUID string, ...) *dataset.Dataset
- func BuildNCreateRQ(messageID uint16, sopClassUID, sopInstanceUID string, hasDataSet bool) *dataset.Dataset
- func BuildNCreateRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
- func BuildNDeleteRQ(messageID uint16, sopClassUID, sopInstanceUID string) *dataset.Dataset
- func BuildNDeleteRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
- func BuildNEventReportRQ(messageID uint16, sopClassUID, sopInstanceUID string, eventTypeID uint16, ...) *dataset.Dataset
- func BuildNEventReportRSP(messageID uint16, sopClassUID, sopInstanceUID string, ...) *dataset.Dataset
- func BuildNGetRQ(messageID uint16, sopClassUID, sopInstanceUID string) *dataset.Dataset
- func BuildNGetRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16, ...) *dataset.Dataset
- func BuildNSetRQ(messageID uint16, sopClassUID, sopInstanceUID string) *dataset.Dataset
- func BuildNSetRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
- func ContextWithAssociationInfo(ctx context.Context, info *AssociationInfo) context.Context
- func DebugLogger()
- func DecodeCommandDataset(data []byte) (*dataset.Dataset, error)
- func DecodeDataset(data []byte, transferSyntax string) (*dataset.Dataset, error)
- func DefaultTransferSyntaxes() []string
- func EncodeCommandDataset(ds *dataset.Dataset) ([]byte, error)
- func EncodeDataset(ds *dataset.Dataset, transferSyntax string) ([]byte, error)
- func EncodePDU(pdu PDU) ([]byte, error)
- func EventTypeString(et EventType) string
- func FindPresentationContextID(accepted map[byte]*PresentationContext, abstractSyntax string) (byte, bool)
- func FormatStatus(status uint16) string
- func GetAffectedSOPClassUID(ds *dataset.Dataset) (string, error)
- func GetAffectedSOPInstanceUID(ds *dataset.Dataset) (string, error)
- func GetDataSetType(ds *dataset.Dataset) (uint16, error)
- func HasDataSet(ds *dataset.Dataset) bool
- func IsCancel(status uint16) bool
- func IsFailure(status uint16) bool
- func IsPending(status uint16) bool
- func IsQueryRetrieveSOPClass(uid string) bool
- func IsStorageSOPClass(uid string) bool
- func IsSuccess(status uint16) bool
- func IsWarning(status uint16) bool
- func LoggingEventHandlers(logger *Logger) map[EventType]EventHandler
- func PDUTypeString(pduType byte) string
- func ParseCommandDataset(ds *dataset.Dataset) (commandField uint16, messageID uint16, status uint16, err error)
- func SetDefaultLogLevel(level LogLevel)
- func UncompressedTransferSyntaxUIDs() []string
- type AbortPDU
- type AssociateAC
- type AssociateRJ
- type AssociateRQ
- type Association
- func (a *Association) Abort(ctx context.Context, source, reason byte) error
- func (a *Association) AcceptAssociation(ctx context.Context, rq *AssociateRQ, ...) error
- func (a *Association) AcceptedContexts() map[byte]*PresentationContext
- func (a *Association) CalledAE() string
- func (a *Association) CallingAE() string
- func (a *Association) MaxPDUSize() uint32
- func (a *Association) PeerUserInformation() UserInformationItem
- func (a *Association) ReceivePData(ctx context.Context) (byte, []byte, bool, error)
- func (a *Association) RejectAssociation(ctx context.Context, result, source, reason byte) error
- func (a *Association) Release(ctx context.Context) error
- func (a *Association) RequestAssociation(ctx context.Context, callingAE, calledAE string, ...) error
- func (a *Association) RequestAssociationWithNegotiation(ctx context.Context, callingAE, calledAE string, ...) error
- func (a *Association) RoleSelectionFor(sopClassUID string) (SCPSCURoleSelection, bool)
- func (a *Association) SendPData(ctx context.Context, contextID byte, data []byte, isCommand bool) error
- func (a *Association) State() AssociationState
- func (a *Association) TransferSyntaxFor(contextID byte) string
- type AssociationError
- type AssociationInfo
- type AssociationState
- type AsynchronousOperationsWindow
- type BaseHandler
- func (h *BaseHandler) HandleCEcho(_ context.Context, req *CEchoRequest) (*CEchoResponse, error)
- func (h *BaseHandler) HandleCFind(_ context.Context, _ *CFindRequest) ([]*CFindResponse, error)
- func (h *BaseHandler) HandleCGet(_ context.Context, _ *CGetRequest) (*CGetResponse, error)
- func (h *BaseHandler) HandleCMove(_ context.Context, _ *CMoveRequest) (*CMoveResponse, error)
- func (h *BaseHandler) HandleCStore(_ context.Context, req *CStoreRequest) (*CStoreResponse, error)
- func (h *BaseHandler) HandleNAction(_ context.Context, _ *NActionRequest) (*NActionResponse, error)
- func (h *BaseHandler) HandleNCreate(_ context.Context, _ *NCreateRequest) (*NCreateResponse, error)
- func (h *BaseHandler) HandleNDelete(_ context.Context, _ *NDeleteRequest) (*NDeleteResponse, error)
- func (h *BaseHandler) HandleNEventReport(_ context.Context, _ *NEventReportRequest) (*NEventReportResponse, error)
- func (h *BaseHandler) HandleNGet(_ context.Context, _ *NGetRequest) (*NGetResponse, error)
- func (h *BaseHandler) HandleNSet(_ context.Context, _ *NSetRequest) (*NSetResponse, error)
- type CEchoRequest
- type CEchoResponse
- type CFindRequest
- type CFindResponse
- type CFindResult
- type CGetRequest
- type CGetResponse
- type CMoveRequest
- type CMoveResponse
- type CStoreRequest
- type CStoreResponse
- type CommunicationError
- type CompositeHandler
- func (h *CompositeHandler) HandleCEcho(ctx context.Context, req *CEchoRequest) (*CEchoResponse, error)
- func (h *CompositeHandler) HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
- func (h *CompositeHandler) HandleCGet(ctx context.Context, req *CGetRequest) (*CGetResponse, error)
- func (h *CompositeHandler) HandleCMove(ctx context.Context, req *CMoveRequest) (*CMoveResponse, error)
- func (h *CompositeHandler) HandleCStore(ctx context.Context, req *CStoreRequest) (*CStoreResponse, error)
- func (h *CompositeHandler) SetEchoHandler(handler Handler)
- func (h *CompositeHandler) SetFindHandler(handler Handler)
- func (h *CompositeHandler) SetGetHandler(handler Handler)
- func (h *CompositeHandler) SetMoveHandler(handler Handler)
- func (h *CompositeHandler) SetStoreHandler(handler Handler)
- type DIMSEError
- type EchoHandler
- type Event
- type EventHandler
- type EventManager
- type EventType
- type ExtendedNegotiation
- type Handler
- type Listener
- type LogLevel
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Warn(format string, args ...interface{})
- type NActionRequest
- type NActionResponse
- type NCreateRequest
- type NCreateResponse
- type NDeleteRequest
- type NDeleteResponse
- type NEventReportRequest
- type NEventReportResponse
- type NGetRequest
- type NGetResponse
- type NSetRequest
- type NSetResponse
- type NetworkConfig
- type NetworkError
- type PDU
- type PDUError
- type PDVItem
- type PDataTF
- type PresentationContext
- type PresentationContextItem
- func AllStoragePresentationContexts() []PresentationContextItem
- func BasicWorklistPresentationContexts() []PresentationContextItem
- func DefaultQueryRetrieveContexts() []PresentationContextItem
- func DefaultStorageContexts() []PresentationContextItem
- func DefaultVerificationContexts() []PresentationContextItem
- func InstanceAvailabilityPresentationContexts() []PresentationContextItem
- func ModalityPerformedProcedurePresentationContexts() []PresentationContextItem
- func NonPatientObjectPresentationContexts() []PresentationContextItem
- func PrintManagementPresentationContexts() []PresentationContextItem
- func QueryRetrievePresentationContexts() []PresentationContextItem
- func StorageCommitmentPresentationContexts() []PresentationContextItem
- func SubstanceAdministrationPresentationContexts() []PresentationContextItem
- func UnifiedProcedureStepPresentationContexts() []PresentationContextItem
- func VerificationPresentationContexts() []PresentationContextItem
- type PresentationContextResultItem
- type QueryRetrieveHandler
- func (h *QueryRetrieveHandler) HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
- func (h *QueryRetrieveHandler) HandleCGet(ctx context.Context, req *CGetRequest) (*CGetResponse, error)
- func (h *QueryRetrieveHandler) HandleCMove(ctx context.Context, req *CMoveRequest) (*CMoveResponse, error)
- type ReleaseRP
- type ReleaseRQ
- type SCP
- type SCPConfig
- type SCPConfigTLS
- type SCPSCURoleSelection
- type SCU
- func (s *SCU) Abort(ctx context.Context) error
- func (s *SCU) Associate(ctx context.Context, contexts []PresentationContextItem) error
- func (s *SCU) Association() *Association
- func (s *SCU) Cancel(ctx context.Context, messageID uint16) error
- func (s *SCU) Echo(ctx context.Context) error
- func (s *SCU) Find(ctx context.Context, queryDS *dataset.Dataset) (<-chan *CFindResult, error)
- func (s *SCU) Get(ctx context.Context, queryDS *dataset.Dataset) error
- func (s *SCU) IsAssociated() bool
- func (s *SCU) Move(ctx context.Context, queryDS *dataset.Dataset, moveDestination string) error
- func (s *SCU) NAction(ctx context.Context, sopClassUID, sopInstanceUID string, actionTypeID uint16, ...) (*NActionResponse, error)
- func (s *SCU) NCreate(ctx context.Context, sopClassUID, sopInstanceUID string, ds *dataset.Dataset) (*NCreateResponse, error)
- func (s *SCU) NDelete(ctx context.Context, sopClassUID, sopInstanceUID string) (*NDeleteResponse, error)
- func (s *SCU) NEventReport(ctx context.Context, sopClassUID, sopInstanceUID string, eventTypeID uint16, ...) (*NEventReportResponse, error)
- func (s *SCU) NGet(ctx context.Context, sopClassUID, sopInstanceUID string) (*NGetResponse, error)
- func (s *SCU) NSet(ctx context.Context, sopClassUID, sopInstanceUID string, ds *dataset.Dataset) (*NSetResponse, error)
- func (s *SCU) Release(ctx context.Context) error
- func (s *SCU) Store(ctx context.Context, ds *dataset.Dataset) error
- type SCUConfig
- type SCUConfigTLS
- type SOPClassExtendedNegotiation
- type Server
- type ServerGroup
- func (g *ServerGroup) Add(ctx context.Context, config SCPConfig, handler Handler) (*Server, error)
- func (g *ServerGroup) AddTLS(ctx context.Context, config SCPConfig, handler Handler, tlsCfg *TLSConfig) (*Server, error)
- func (g *ServerGroup) Count() int
- func (g *ServerGroup) Servers() []*Server
- func (g *ServerGroup) StopAll()
- func (g *ServerGroup) WaitAll()
- type StatusCategory
- type StorageHandler
- type TLSConfig
- type TimeoutError
- type Transport
- func (t *Transport) Close() error
- func (t *Transport) IsClosed() bool
- func (t *Transport) LocalAddr() net.Addr
- func (t *Transport) MaxPDUSize() uint32
- func (t *Transport) ReadPDU(ctx context.Context) (PDU, error)
- func (t *Transport) RemoteAddr() net.Addr
- func (t *Transport) SetMaxPDUSize(size uint32)
- func (t *Transport) WritePDU(ctx context.Context, pdu PDU) error
- type UserIdentityNegotiation
- type UserIdentityResponse
- type UserIdentityType
- type UserInformationItem
- type WorklistHandler
Constants ¶
const ( // DefaultMaxPDUSize is the default maximum PDU size (16 KB). DefaultMaxPDUSize = 16384 // DefaultPort is the default DICOM port. DefaultPort = 11112 // DefaultAETitle is the default Application Entity title. DefaultAETitle = "GODICOM" // DefaultARTIMTimeout is the ARTIM timer timeout (Association Request/Reject/Release Timer). DefaultARTIMTimeout = 30 * time.Second // DefaultDIMSETimeout is the default timeout for DIMSE operations. DefaultDIMSETimeout = 60 * time.Second // DefaultNetworkTimeout is the default TCP connection timeout. DefaultNetworkTimeout = 30 * time.Second // MaxMaxPDUSize is the absolute maximum PDU size allowed. MaxMaxPDUSize = 0 // 0 means no limit (per DICOM standard, negotiated) // MinPDUSize is the minimum PDU size required by the standard. MinPDUSize = 4096 // ProtocolVersion is the DICOM Upper Layer protocol version. ProtocolVersion uint16 = 1 )
const ( CommandCStoreRQ uint16 = 0x0001 CommandCStoreRSP uint16 = 0x8001 CommandCGetRQ uint16 = 0x0010 CommandCGetRSP uint16 = 0x8010 CommandCFindRQ uint16 = 0x0020 CommandCFindRSP uint16 = 0x8020 CommandCMoveRQ uint16 = 0x0021 CommandCMoveRSP uint16 = 0x8021 CommandCEchoRQ uint16 = 0x0030 CommandCEchoRSP uint16 = 0x8030 CommandCCancelRQ uint16 = 0x0FFF )
DIMSE command field values (DICOM Part 7, Annex E).
const ( StatusSuccess uint16 = 0x0000 StatusCancel uint16 = 0xFE00 StatusPending uint16 = 0xFF00 StatusPendingWarning uint16 = 0xFF01 StatusWarning uint16 = 0x0001 // Coercion of Data Elements warning StatusOutOfResources uint16 = 0xA700 StatusUnableToProcess uint16 = 0xC000 StatusDataSetNotMatch uint16 = 0xA900 StatusMoveDestUnknown uint16 = 0xA801 StatusClassNotSupported uint16 = 0x0122 StatusDuplicateSOPInstance uint16 = 0x0111 )
DICOM status values.
const ( CommandDataSetTypeNull uint16 = 0x0101 // No dataset present CommandDataSetTypePresent uint16 = 0x0000 // Dataset present (any value != 0x0101 would work per spec, but 0 is unused) )
DICOM command dataset type values.
const ( PriorityMedium uint16 = 0x0000 PriorityHigh uint16 = 0x0001 PriorityLow uint16 = 0x0002 )
DICOM priority values.
const ( ItemTypeAsyncOperationsWindow byte = 0x53 ItemTypeSCPSCURoleSelection byte = 0x54 ItemTypeSOPClassExtended byte = 0x56 ItemTypeSOPClassCommonExtended byte = 0x57 ItemTypeUserIdentity byte = 0x58 ItemTypeUserIdentityAC byte = 0x59 )
Extended negotiation sub-item types within User Information.
const ( CommandNEventReportRQ uint16 = 0x0100 CommandNEventReportRSP uint16 = 0x8100 CommandNGetRQ uint16 = 0x0110 CommandNGetRSP uint16 = 0x8110 CommandNSetRQ uint16 = 0x0120 CommandNSetRSP uint16 = 0x8120 CommandNActionRQ uint16 = 0x0130 CommandNActionRSP uint16 = 0x8130 CommandNCreateRQ uint16 = 0x0140 CommandNCreateRSP uint16 = 0x8140 CommandNDeleteRQ uint16 = 0x0150 CommandNDeleteRSP uint16 = 0x8150 )
N-DIMSE command field values (DICOM Part 7, Annex E).
const ( PDUTypeAssociateRQ byte = 0x01 PDUTypeAssociateAC byte = 0x02 PDUTypeAssociateRJ byte = 0x03 PDUTypeDataTF byte = 0x04 PDUTypeReleaseRQ byte = 0x05 PDUTypeReleaseRP byte = 0x06 PDUTypeAbort byte = 0x07 )
PDU type constants (DICOM Part 8, Section 9.3).
const ( ItemTypeApplicationContext byte = 0x10 ItemTypePresentationContextRQ byte = 0x20 ItemTypePresentationContextAC byte = 0x21 ItemTypeAbstractSyntax byte = 0x30 ItemTypeTransferSyntax byte = 0x40 ItemTypeUserInformation byte = 0x50 ItemTypeMaxPDULength byte = 0x51 ItemTypeImplementationClass byte = 0x52 ItemTypeImplementationVersion byte = 0x55 )
Item type constants for sub-items within PDUs.
const ( RJResultRejectedPermanent byte = 1 RJResultRejectedTransient byte = 2 )
A-ASSOCIATE-RJ result values.
const ( RJSourceServiceUser byte = 1 RJSourceServiceProviderACSE byte = 2 RJSourceServiceProviderPresentation byte = 3 )
A-ASSOCIATE-RJ source values.
const ( AbortSourceServiceUser byte = 0 AbortSourceServiceProvider byte = 2 )
A-ABORT source values.
const ( PCResultAcceptance byte = 0 PCResultUserRejection byte = 1 PCResultNoReason byte = 2 PCResultAbstractSyntaxNotSupported byte = 3 PCResultTransferSyntaxNotSupported byte = 4 )
Presentation context result values.
const ( VerificationSOPClassUID = "1.2.840.10008.1.1" // Storage SOP Classes CTImageStorageUID = "1.2.840.10008.5.1.4.1.1.2" EnhancedCTImageStorageUID = "1.2.840.10008.5.1.4.1.1.2.1" MRImageStorageUID = "1.2.840.10008.5.1.4.1.1.4" EnhancedMRImageStorageUID = "1.2.840.10008.5.1.4.1.1.4.1" USImageStorageUID = "1.2.840.10008.5.1.4.1.1.6.1" SecondaryCaptureImageStorageUID = "1.2.840.10008.5.1.4.1.1.7" XRayAngiographicImageStorageUID = "1.2.840.10008.5.1.4.1.1.12.1" DigitalXRayImageStorageUID = "1.2.840.10008.5.1.4.1.1.1.1" CRImageStorageUID = "1.2.840.10008.5.1.4.1.1.1" // Query/Retrieve SOP Classes PatientRootQueryRetrieveFind = "1.2.840.10008.5.1.4.1.2.1.1" PatientRootQueryRetrieveMove = "1.2.840.10008.5.1.4.1.2.1.2" PatientRootQueryRetrieveGet = "1.2.840.10008.5.1.4.1.2.1.3" StudyRootQueryRetrieveFind = "1.2.840.10008.5.1.4.1.2.2.1" StudyRootQueryRetrieveMove = "1.2.840.10008.5.1.4.1.2.2.2" StudyRootQueryRetrieveGet = "1.2.840.10008.5.1.4.1.2.2.3" )
Common DICOM SOP Class UIDs used in networking.
const ( // Uncompressed ImplicitVRLittleEndianUID = "1.2.840.10008.1.2" ExplicitVRLittleEndianUID = "1.2.840.10008.1.2.1" DeflatedExplicitVRLittleEndianUID = "1.2.840.10008.1.2.1.99" ExplicitVRBigEndianUID = "1.2.840.10008.1.2.2" // JPEG JPEGBaselineUID = "1.2.840.10008.1.2.4.50" JPEGExtendedUID = "1.2.840.10008.1.2.4.51" JPEGLosslessSV1UID = "1.2.840.10008.1.2.4.57" JPEGLosslessUID = "1.2.840.10008.1.2.4.70" // JPEG-LS JPEGLSLosslessUID = "1.2.840.10008.1.2.4.80" JPEGLSNearLosslessUID = "1.2.840.10008.1.2.4.81" // JPEG 2000 JPEG2000LosslessUID = "1.2.840.10008.1.2.4.90" JPEG2000UID = "1.2.840.10008.1.2.4.91" JPEG2000Part2MultiComponentLosslessUID = "1.2.840.10008.1.2.4.92" JPEG2000Part2MultiComponentUID = "1.2.840.10008.1.2.4.93" // JPIP JPIPReferencedUID = "1.2.840.10008.1.2.4.94" JPIPReferencedDeflateUID = "1.2.840.10008.1.2.4.95" // MPEG2 MPEG2MainProfileUID = "1.2.840.10008.1.2.4.100" MPEG2MainProfileFragmentUID = "1.2.840.10008.1.2.4.100.1" MPEG2MainProfileHighUID = "1.2.840.10008.1.2.4.101" MPEG2MainProfileHighFragmentUID = "1.2.840.10008.1.2.4.101.1" // MPEG-4 AVC/H.264 MPEG4AVCH264HighProfileUID = "1.2.840.10008.1.2.4.102" MPEG4AVCH264HighProfileFragmentUID = "1.2.840.10008.1.2.4.102.1" MPEG4AVCH264BDCompatibleUID = "1.2.840.10008.1.2.4.103" MPEG4AVCH264BDCompatibleFragmentUID = "1.2.840.10008.1.2.4.103.1" MPEG4AVCH264HighProfile2DUID = "1.2.840.10008.1.2.4.104" MPEG4AVCH264HighProfile2DFragmentUID = "1.2.840.10008.1.2.4.104.1" MPEG4AVCH264HighProfile3DUID = "1.2.840.10008.1.2.4.105" MPEG4AVCH264HighProfile3DFragmentUID = "1.2.840.10008.1.2.4.105.1" MPEG4AVCH264StereoHighProfileUID = "1.2.840.10008.1.2.4.106" MPEG4AVCH264StereoHighFragmentUID = "1.2.840.10008.1.2.4.106.1" // HEVC/H.265 HEVCH265MainProfileUID = "1.2.840.10008.1.2.4.107" HEVCH265Main10ProfileUID = "1.2.840.10008.1.2.4.108" // JPEG XL JPEGXLLosslessUID = "1.2.840.10008.1.2.4.110" JPEGXLJPEGRecompressionUID = "1.2.840.10008.1.2.4.111" JPEGXLUID = "1.2.840.10008.1.2.4.112" // High-Throughput JPEG 2000 HTJ2KLosslessUID = "1.2.840.10008.1.2.4.201" HTJ2KLosslessRPCLUID = "1.2.840.10008.1.2.4.202" HTJ2KUID = "1.2.840.10008.1.2.4.203" JPIPHTJ2KReferencedUID = "1.2.840.10008.1.2.4.204" JPIPHTJ2KReferencedDeflateUID = "1.2.840.10008.1.2.4.205" // RLE RLELosslessUID = "1.2.840.10008.1.2.5" // SMPTE ST 2110 SMPTEST2110UncompressedProgressiveUID = "1.2.840.10008.1.2.7.1" SMPTEST2110UncompressedInterlacedUID = "1.2.840.10008.1.2.7.2" SMPTEST2110PCMDigitalAudioUID = "1.2.840.10008.1.2.7.3" )
DICOM Transfer Syntax UIDs — complete set matching pynetdicom.
const ( ComputedRadiographyImageStorageUID = "1.2.840.10008.5.1.4.1.1.1" DigitalXRayImageStorageForPresentationUID = "1.2.840.10008.5.1.4.1.1.1.1" DigitalXRayImageStorageForProcessingUID = "1.2.840.10008.5.1.4.1.1.1.1.1" DigitalMammographyImageStoragePresentUID = "1.2.840.10008.5.1.4.1.1.1.2" DigitalMammographyImageStorageProcessUID = "1.2.840.10008.5.1.4.1.1.1.2.1" DigitalIntraOralXRayImageStoragePresentUID = "1.2.840.10008.5.1.4.1.1.1.3" DigitalIntraOralXRayImageStorageProcessUID = "1.2.840.10008.5.1.4.1.1.1.3.1" )
Computed Radiography and Digital X-Ray
const ( CTImageStorageSOP = "1.2.840.10008.5.1.4.1.1.2" EnhancedCTImageStorageSOP = "1.2.840.10008.5.1.4.1.1.2.1" LegacyConvertedEnhancedCTImageUID = "1.2.840.10008.5.1.4.1.1.2.2" MRImageStorageSOP = "1.2.840.10008.5.1.4.1.1.4" EnhancedMRImageStorageSOP = "1.2.840.10008.5.1.4.1.1.4.1" MRSpectroscopyStorageUID = "1.2.840.10008.5.1.4.1.1.4.2" EnhancedMRColorImageStorageUID = "1.2.840.10008.5.1.4.1.1.4.3" LegacyConvertedEnhancedMRImageUID = "1.2.840.10008.5.1.4.1.1.4.4" )
CT and MR
const ( UltrasoundMultiFrameImageStorageRetiredUID = "1.2.840.10008.5.1.4.1.1.3" UltrasoundMultiFrameImageStorageUID = "1.2.840.10008.5.1.4.1.1.3.1" UltrasoundImageStorageRetiredUID = "1.2.840.10008.5.1.4.1.1.6" UltrasoundImageStorageSOP = "1.2.840.10008.5.1.4.1.1.6.1" EnhancedUSVolumeStorageUID = "1.2.840.10008.5.1.4.1.1.6.2" PhotoacousticImageStorageUID = "1.2.840.10008.5.1.4.1.1.6.3" )
Ultrasound
const ( SecondaryCaptureImageStorageSOP = "1.2.840.10008.5.1.4.1.1.7" MultiFrameSingleBitSecondaryCaptureUID = "1.2.840.10008.5.1.4.1.1.7.1" MultiFrameGrayscaleByteSecondaryCaptureUID = "1.2.840.10008.5.1.4.1.1.7.2" MultiFrameGrayscaleWordSecondaryCaptureUID = "1.2.840.10008.5.1.4.1.1.7.3" MultiFrameTrueColorSecondaryCaptureUID = "1.2.840.10008.5.1.4.1.1.7.4" )
Secondary Capture
const ( NuclearMedicineImageStorageRetiredUID = "1.2.840.10008.5.1.4.1.1.5" NuclearMedicineImageStorageUID = "1.2.840.10008.5.1.4.1.1.20" PositronEmissionTomographyImageUID = "1.2.840.10008.5.1.4.1.1.128" EnhancedPETImageStorageUID = "1.2.840.10008.5.1.4.1.1.130" LegacyConvertedEnhancedPETImageUID = "1.2.840.10008.5.1.4.1.1.128.1" )
Nuclear Medicine and PET
const ( RTImageStorageUID = "1.2.840.10008.5.1.4.1.1.481.1" RTDoseStorageUID = "1.2.840.10008.5.1.4.1.1.481.2" RTStructureSetStorageUID = "1.2.840.10008.5.1.4.1.1.481.3" RTBeamsTreatmentRecordUID = "1.2.840.10008.5.1.4.1.1.481.4" RTPlanStorageUID = "1.2.840.10008.5.1.4.1.1.481.5" RTBrachyTreatmentRecordUID = "1.2.840.10008.5.1.4.1.1.481.6" RTTreatmentSummaryRecordUID = "1.2.840.10008.5.1.4.1.1.481.7" RTIonPlanStorageUID = "1.2.840.10008.5.1.4.1.1.481.8" RTIonBeamsTreatmentRecordUID = "1.2.840.10008.5.1.4.1.1.481.9" RTBeamsDeliveryInstructionUID = "1.2.840.10008.5.1.4.34.7" )
Radiation Therapy
const ( XRayAngiographicImageStorageSOP = "1.2.840.10008.5.1.4.1.1.12.1" EnhancedXAImageStorageUID = "1.2.840.10008.5.1.4.1.1.12.1.1" XRayRadiofluoroscopicImageStorageUID = "1.2.840.10008.5.1.4.1.1.12.2" EnhancedXRFImageStorageUID = "1.2.840.10008.5.1.4.1.1.12.2.1" XRay3DAngiographicImageStorageUID = "1.2.840.10008.5.1.4.1.1.13.1.1" XRay3DCraniofacialImageStorageUID = "1.2.840.10008.5.1.4.1.1.13.1.2" BreastTomosynthesisImageStorageUID = "1.2.840.10008.5.1.4.1.1.13.1.3" BreastProjectionXRayImageStoragePUID = "1.2.840.10008.5.1.4.1.1.13.1.4" BreastProjectionXRayImageStoragePrUID = "1.2.840.10008.5.1.4.1.1.13.1.5" )
X-Ray Angiographic and Fluoroscopy
const ( VLEndoscopicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.1" VideoEndoscopicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.1.1" VLMicroscopicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.2" VideoMicroscopicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.2.1" VLSlideCoordinatesMicroscopicUID = "1.2.840.10008.5.1.4.1.1.77.1.3" VLPhotographicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.4" VideoPhotographicImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.4.1" OphthalmicPhotography8BitUID = "1.2.840.10008.5.1.4.1.1.77.1.5.1" OphthalmicPhotography16BitUID = "1.2.840.10008.5.1.4.1.1.77.1.5.2" StereometricRelationshipStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.5.3" OphthalmicTomographyImageUID = "1.2.840.10008.5.1.4.1.1.77.1.5.4" WideFieldOphthalmicStereoProjectionUID = "1.2.840.10008.5.1.4.1.1.77.1.5.5" WideFieldOphthalmic3DCoordinatesUID = "1.2.840.10008.5.1.4.1.1.77.1.5.6" OphthalmicOCTEnFaceImageUID = "1.2.840.10008.5.1.4.1.1.77.1.5.7" OphthalmicOCTBscanVolumeAnalysisUID = "1.2.840.10008.5.1.4.1.1.77.1.5.8" VLWholeSlideMicroscopyImageUID = "1.2.840.10008.5.1.4.1.1.77.1.6" DermoscopicPhotographyImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.7" ConfocalMicroscopyImageStorageUID = "1.2.840.10008.5.1.4.1.1.77.1.8" ConfocalMicroscopyTiledPyramidalImageUID = "1.2.840.10008.5.1.4.1.1.77.1.9" )
Visible Light / Ophthalmology / Pathology / Microscopy
const ( LensometryMeasurementsStorageUID = "1.2.840.10008.5.1.4.1.1.78.1" AutorefractionMeasurementsStorageUID = "1.2.840.10008.5.1.4.1.1.78.2" KeratometryMeasurementsStorageUID = "1.2.840.10008.5.1.4.1.1.78.3" SubjectiveRefractionMeasurementsUID = "1.2.840.10008.5.1.4.1.1.78.4" VisualAcuityMeasurementsStorageUID = "1.2.840.10008.5.1.4.1.1.78.5" SpectaclePrescriptionReportStorageUID = "1.2.840.10008.5.1.4.1.1.78.6" OphthalmicAxialMeasurementsStorageUID = "1.2.840.10008.5.1.4.1.1.78.7" IntraocularLensCalculationsStorageUID = "1.2.840.10008.5.1.4.1.1.78.8" MacularGridThicknessVolumeReportUID = "1.2.840.10008.5.1.4.1.1.79.1" OphthalmicVisualFieldStaticPerimetryUID = "1.2.840.10008.5.1.4.1.1.80.1" OphthalmicThicknessMapStorageUID = "1.2.840.10008.5.1.4.1.1.81.1" CornealTopographyMapStorageUID = "1.2.840.10008.5.1.4.1.1.82.1" )
Ophthalmic Measurements
const ( IntravascularOCTImageStoragePresentUID = "1.2.840.10008.5.1.4.1.1.14.1" IntravascularOCTImageStorageProcessUID = "1.2.840.10008.5.1.4.1.1.14.2" )
Intravascular OCT
const ( RTPhysicianIntentStorageUID = "1.2.840.10008.5.1.4.1.1.481.10" RTSegmentAnnotationStorageUID = "1.2.840.10008.5.1.4.1.1.481.11" RTRadiationSetStorageUID = "1.2.840.10008.5.1.4.1.1.481.12" CArmPhotonElectronRadiationStorageUID = "1.2.840.10008.5.1.4.1.1.481.13" TomotherapeuticRadiationStorageUID = "1.2.840.10008.5.1.4.1.1.481.14" RoboticArmRadiationStorageUID = "1.2.840.10008.5.1.4.1.1.481.15" RTRadiationRecordSetStorageUID = "1.2.840.10008.5.1.4.1.1.481.16" RTRadiationSalvageRecordStorageUID = "1.2.840.10008.5.1.4.1.1.481.17" TomotherapeuticRadiationRecordStorageUID = "1.2.840.10008.5.1.4.1.1.481.18" CArmPhotonElectronRadiationRecordUID = "1.2.840.10008.5.1.4.1.1.481.19" RoboticArmRadiationRecordStorageUID = "1.2.840.10008.5.1.4.1.1.481.20" RTRadiationSetDeliveryInstructionUID = "1.2.840.10008.5.1.4.1.1.481.21" RTTreatmentPreparationStorageUID = "1.2.840.10008.5.1.4.1.1.481.22" EnhancedRTImageStorageUID = "1.2.840.10008.5.1.4.1.1.481.23" EnhancedContinuousRTImageStorageUID = "1.2.840.10008.5.1.4.1.1.481.24" RTBrachyApplicationSetupDeliveryInstUID = "1.2.840.10008.5.1.4.34.10" )
Additional RT Storage
const ( ExtensibleSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.35" PlannedImagingAgentAdministrationSRUID = "1.2.840.10008.5.1.4.1.1.88.74" PerformedImagingAgentAdministrationSRUID = "1.2.840.10008.5.1.4.1.1.88.75" EnhancedXRayRadiationDoseSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.76" WaveformAnnotationSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.77" ContentAssessmentResultsStorageUID = "1.2.840.10008.5.1.4.1.1.90.1" MicroscopyBulkSimpleAnnotationsStorageUID = "1.2.840.10008.5.1.4.1.1.91.1" )
Additional SR / Annotations / Content
const ( GrayscalePlanarMPRVolumetricPresentUID = "1.2.840.10008.5.1.4.1.1.11.6" CompositingPlanarMPRVolumetricPresentUID = "1.2.840.10008.5.1.4.1.1.11.7" AdvancedBlendingPresentationStateUID = "1.2.840.10008.5.1.4.1.1.11.8" VolumeRenderingVolumetricPresentUID = "1.2.840.10008.5.1.4.1.1.11.9" SegmentedVolumeRenderingVolumetricPresentUID = "1.2.840.10008.5.1.4.1.1.11.10" MultipleVolumeRenderingVolumetricPresentUID = "1.2.840.10008.5.1.4.1.1.11.11" VariableModalityLUTSoftcopyPresentUID = "1.2.840.10008.5.1.4.1.1.11.12" WaveformPresentationStateStorageUID = "1.2.840.10008.5.1.4.1.1.9.100.1" WaveformAcquisitionPresentationStateUID = "1.2.840.10008.5.1.4.1.1.9.100.2" )
Additional Presentation State
const ( General32bitECGWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.1.4" BasicVoiceAudioWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.4.1" )
Additional Waveform
const ( BasicStructuredDisplayStorageUID = "1.2.840.10008.5.1.4.1.1.131" CTPerformedProcedureProtocolStorageUID = "1.2.840.10008.5.1.4.1.1.200.2" XAPerformedProcedureProtocolStorageUID = "1.2.840.10008.5.1.4.1.1.200.8" CTDefinedProcedureProtocolStorageUID = "1.2.840.10008.5.1.4.1.1.200.1" ProtocolApprovalStorageUID = "1.2.840.10008.5.1.4.1.1.200.3" XADefinedProcedureProtocolStorageUID = "1.2.840.10008.5.1.4.1.1.200.7" InventoryStorageUID = "1.2.840.10008.5.1.4.1.1.201.1" TractographyResultsStorageUID = "1.2.840.10008.5.1.4.1.1.66.6" LabelMapSegmentationStorageUID = "1.2.840.10008.5.1.4.1.1.66.7" MediaStorageDirectoryStorageUID = "1.2.840.10008.1.3.10" )
Additional Miscellaneous Storage
const ( TwelveLeadECGWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.1.1" GeneralECGWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.1.2" AmbulatoryECGWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.1.3" HemodynamicWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.2.1" BasicCardiacElectrophysiologyUID = "1.2.840.10008.5.1.4.1.1.9.3.1" ArterialPulseWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.5.1" RespiratoryWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.6.1" GeneralAudioWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.4.2" MultichannelRespiratoryWaveformUID = "1.2.840.10008.5.1.4.1.1.9.6.2" RoutineScalpElectroencephalogramUID = "1.2.840.10008.5.1.4.1.1.9.7.1" ElectromyogramWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.7.2" ElectrooculogramWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.7.3" SleepElectroencephalogramUID = "1.2.840.10008.5.1.4.1.1.9.7.4" BodyPositionWaveformStorageUID = "1.2.840.10008.5.1.4.1.1.9.8.1" )
Waveform Storage
const ( BasicTextSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.11" EnhancedSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.22" ComprehensiveSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.33" Comprehensive3DSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.34" ProcedureLogStorageUID = "1.2.840.10008.5.1.4.1.1.88.40" MammographyCADSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.50" KeyObjectSelectionDocumentUID = "1.2.840.10008.5.1.4.1.1.88.59" ChestCADSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.65" XRayRadiationDoseSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.67" RadiopharmaceuticalRadiationDoseSRUID = "1.2.840.10008.5.1.4.1.1.88.68" ColonCADSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.69" ImplantationPlanSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.70" AcquisitionContextSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.71" SimplifiedAdultEchoSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.72" PatientRadiationDoseSRStorageUID = "1.2.840.10008.5.1.4.1.1.88.73" )
Structured Reporting
const ( GrayscaleSoftcopyPresentationStateUID = "1.2.840.10008.5.1.4.1.1.11.1" ColorSoftcopyPresentationStateUID = "1.2.840.10008.5.1.4.1.1.11.2" PseudoColorSoftcopyPresentationUID = "1.2.840.10008.5.1.4.1.1.11.3" BlendingSoftcopyPresentationStateUID = "1.2.840.10008.5.1.4.1.1.11.4" XAXRFGrayscaleSoftcopyPresentUID = "1.2.840.10008.5.1.4.1.1.11.5" )
Presentation State
const ( SegmentationStorageUID = "1.2.840.10008.5.1.4.1.1.66.4" SurfaceSegmentationStorageUID = "1.2.840.10008.5.1.4.1.1.66.5" SurfaceScanMeshStorageUID = "1.2.840.10008.5.1.4.1.1.68.1" SurfaceScanPointCloudUID = "1.2.840.10008.5.1.4.1.1.68.2" )
Segmentation and Surface
const ( ParametricMapStorageUID = "1.2.840.10008.5.1.4.1.1.30" RealWorldValueMappingUID = "1.2.840.10008.5.1.4.1.1.67" RawDataStorageUID = "1.2.840.10008.5.1.4.1.1.66" SpatialRegistrationStorageUID = "1.2.840.10008.5.1.4.1.1.66.1" SpatialFiducialsStorageUID = "1.2.840.10008.5.1.4.1.1.66.2" DeformableSpatialRegUID = "1.2.840.10008.5.1.4.1.1.66.3" )
Parametric Map and Real World Value
const ( EncapsulatedPDFStorageUID = "1.2.840.10008.5.1.4.1.1.104.1" EncapsulatedCDAStorageUID = "1.2.840.10008.5.1.4.1.1.104.2" EncapsulatedSTLStorageUID = "1.2.840.10008.5.1.4.1.1.104.3" EncapsulatedOBJStorageUID = "1.2.840.10008.5.1.4.1.1.104.4" EncapsulatedMTLStorageUID = "1.2.840.10008.5.1.4.1.1.104.5" )
Encapsulated Document Storage
const ( ModalityWorklistInformationModelFindUID = "1.2.840.10008.5.1.4.31" ModalityPerformedProcedureStepUID = "1.2.840.10008.3.1.2.3.3" ModalityPerformedProcedureStepRetrUID = "1.2.840.10008.3.1.2.3.4" ModalityPerformedProcedureStepNotifUID = "1.2.840.10008.3.1.2.3.5" )
--- Worklist and Procedure Step ---
const ( BasicFilmSessionSOPClassUID = "1.2.840.10008.5.1.1.1" BasicFilmBoxSOPClassUID = "1.2.840.10008.5.1.1.2" BasicGrayscaleImageBoxSOPClassUID = "1.2.840.10008.5.1.1.4" BasicColorImageBoxSOPClassUID = "1.2.840.10008.5.1.1.4.1" PrintJobSOPClassUID = "1.2.840.10008.5.1.1.14" BasicGrayscalePrintManagementUID = "1.2.840.10008.5.1.1.9" BasicColorPrintManagementUID = "1.2.840.10008.5.1.1.18" PrinterSOPClassUID = "1.2.840.10008.5.1.1.16" PrinterConfigurationRetrievalUID = "1.2.840.10008.5.1.1.16.376" )
--- Print Management ---
const ( UnifiedProcedureStepPushUID = "1.2.840.10008.5.1.4.34.6.1" UnifiedProcedureStepWatchUID = "1.2.840.10008.5.1.4.34.6.2" UnifiedProcedureStepPullUID = "1.2.840.10008.5.1.4.34.6.3" UnifiedProcedureStepEventUID = "1.2.840.10008.5.1.4.34.6.4" UnifiedProcedureStepQueryUID = "1.2.840.10008.5.1.4.34.6.5" )
--- Unified Procedure Step ---
const ( SubstanceAdministrationLoggingUID = "1.2.840.10008.1.42" ProductCharacteristicsQueryUID = "1.2.840.10008.5.1.4.41" SubstanceApprovalQueryUID = "1.2.840.10008.5.1.4.42" )
--- Substance Administration ---
const ( HangingProtocolStorageUID = "1.2.840.10008.5.1.4.38.1" ColorPaletteStorageUID = "1.2.840.10008.5.1.4.39.1" GenericImplantTemplateUID = "1.2.840.10008.5.1.4.43.1" ImplantAssemblyTemplateUID = "1.2.840.10008.5.1.4.44.1" ImplantTemplateGroupUID = "1.2.840.10008.5.1.4.45.1" )
--- Non-Patient Object Storage ---
const ( StatusRefusedOutOfResources uint16 = 0x0112 StatusRefusedSOPClassNotSupported uint16 = 0x0122 StatusRefusedNotAuthorized uint16 = 0x0124 StatusInvalidArgumentValue uint16 = 0x0115 StatusInvalidObjectInstance uint16 = 0x0117 StatusMissingAttribute uint16 = 0x0120 StatusMistypedArgument uint16 = 0x0212 StatusNoSuchArgument uint16 = 0x0114 StatusNoSuchSOPClass uint16 = 0x0118 StatusProcessingFailure uint16 = 0x0110 StatusResourceLimitation uint16 = 0x0213 StatusUnrecognizedOperation uint16 = 0x0211 StatusDuplicateInvocation uint16 = 0x0210 )
--- General Status Codes (all services) ---
const ( StatusStorageCoercionOfDataElements uint16 = 0xB000 StatusStorageDataSetNotMatchSOPClass uint16 = 0xB007 StatusStorageElementsDiscarded uint16 = 0xB006 )
--- Storage Service Status Codes ---
const ( StatusQROptionalKeysNotSupported uint16 = 0x0001 StatusQRSubOpsOneOrMoreFailures uint16 = 0xB000 StatusQRRefusedOutOfResourcesFind uint16 = 0xA700 StatusQRRefusedOutOfResourcesMove uint16 = 0xA701 StatusQRIdentifierNotMatch uint16 = 0xA900 StatusQRMoveDestinationUnknown uint16 = 0xA801 StatusQRCancelMatchingTerminated uint16 = 0xFE00 StatusQRPendingMatches uint16 = 0xFF00 StatusQRPendingMatchesWarning uint16 = 0xFF01 )
--- Query/Retrieve Service Status Codes ---
const ( StatusPrintFilmSessionEmpty uint16 = 0xB600 StatusPrintFilmSessionPrintingDone uint16 = 0xB601 StatusPrintFilmSessionSomePrinted uint16 = 0xB602 StatusPrintFilmBoxEmpty uint16 = 0xB603 StatusPrintImageDemagnified uint16 = 0xB604 StatusPrintMinMaxDensityOutOfRange uint16 = 0xB605 StatusPrintImageCropped uint16 = 0xB609 StatusPrintImageDecimated uint16 = 0xB60A )
--- Print Management Service Status Codes ---
const ( StatusWorklistRefusedOutOfResources uint16 = 0xA700 StatusWorklistIdentifierNotMatch uint16 = 0xA900 StatusWorklistCancelMatchTerminated uint16 = 0xFE00 StatusWorklistPendingMatches uint16 = 0xFF00 StatusWorklistPendingMatchesWarning uint16 = 0xFF01 )
--- Modality Worklist Status Codes ---
const ( StatusUPSUnknownActionType uint16 = 0xC300 StatusUPSRefusedNotUpdatable uint16 = 0xC301 StatusUPSCannotDelete uint16 = 0xC302 StatusUPSAlreadyCompleted uint16 = 0xC303 StatusUPSNoSuchProcedureStep uint16 = 0xC307 StatusUPSAlreadyInProgress uint16 = 0xC310 )
--- Unified Procedure Step Status Codes ---
const ( StatusStorageCommitmentRefused uint16 = 0x0110 StatusStorageCommitmentNoSuchObject uint16 = 0x0112 StatusStorageCommitmentResourceLimitation uint16 = 0xA700 )
--- Storage Commitment Status Codes ---
const DefaultApplicationContextUID = "1.2.840.10008.3.1.1.1"
DefaultApplicationContextUID is the DICOM Application Context Name.
const DefaultImplementationClassUID = "1.2.826.0.1.3680043.10.511"
DefaultImplementationClassUID is a placeholder implementation class UID.
const DefaultImplementationVersionName = "GO-DICOM-1.2.0"
DefaultImplementationVersionName identifies this implementation to peers in the A-ASSOCIATE User Information item. Limited to 16 characters by PS3.7 D.3.3.2.
const (
InstanceAvailabilityNotificationUID = "1.2.840.10008.5.1.4.33"
)
--- Instance Availability ---
const MaxPDULengthLimit uint32 = 128 << 20
MaxPDULengthLimit is the hard ceiling on the declared length of a single received PDU. The PDU length field is a peer-controlled 32-bit value, so without a limit a remote peer could declare ~4 GiB and force an allocation of that size before a single byte of payload is read. 128 MiB is far above any legitimate DICOM PDU (negotiated maximums are typically 16-128 KB) while keeping a malicious declaration cheap to reject.
const (
StorageCommitmentPushModelUID = "1.2.840.10008.1.20.1"
)
--- Storage Commitment ---
Variables ¶
var DefaultLogger = NewLogger(LogLevelSilent, os.Stderr)
DefaultLogger is the package-level logger (silent by default).
Functions ¶
func AllQueryRetrieveSOPClassUIDs ¶
func AllQueryRetrieveSOPClassUIDs() []string
AllQueryRetrieveSOPClassUIDs returns all Query/Retrieve SOP Class UIDs.
func AllStorageSOPClassUIDs ¶
func AllStorageSOPClassUIDs() []string
AllStorageSOPClassUIDs returns all supported Storage SOP Class UIDs. This is the equivalent of pynetdicom's StoragePresentationContexts.
func AllTransferSyntaxUIDs ¶
func AllTransferSyntaxUIDs() []string
AllTransferSyntaxUIDs returns all supported Transfer Syntax UIDs (45 total). Matches pynetdicom's ALL_TRANSFER_SYNTAXES.
func AllWorklistSOPClassUIDs ¶
func AllWorklistSOPClassUIDs() []string
AllWorklistSOPClassUIDs returns Worklist-related SOP Class UIDs.
func BuildAcceptedContextMap ¶
func BuildAcceptedContextMap( requested []PresentationContextItem, results []PresentationContextResultItem, ) map[byte]*PresentationContext
BuildAcceptedContextMap creates a map from presentation context ID to accepted context from the A-ASSOCIATE-AC response.
func BuildCCancelRQ ¶
BuildCCancelRQ builds a C-CANCEL-RQ command dataset to cancel an in-progress operation.
func BuildCEchoRQ ¶
BuildCEchoRQ builds a C-ECHO-RQ command dataset.
func BuildCEchoRSP ¶
BuildCEchoRSP builds a C-ECHO-RSP command dataset.
func BuildCFindRQ ¶
BuildCFindRQ builds a C-FIND-RQ command dataset.
func BuildCFindRSP ¶
func BuildCFindRSP(messageID uint16, sopClassUID string, status uint16, hasDataSet bool) *dataset.Dataset
BuildCFindRSP builds a C-FIND-RSP command dataset.
func BuildCGetRQ ¶
BuildCGetRQ builds a C-GET-RQ command dataset.
func BuildCGetRSP ¶
func BuildCGetRSP(messageID uint16, sopClassUID string, status uint16, remaining, completed, failed, warning uint16) *dataset.Dataset
BuildCGetRSP builds a C-GET-RSP command dataset.
func BuildCMoveRQ ¶
func BuildCMoveRQ(messageID uint16, sopClassUID, moveDestination string, priority uint16) *dataset.Dataset
BuildCMoveRQ builds a C-MOVE-RQ command dataset.
func BuildCMoveRSP ¶
func BuildCMoveRSP(messageID uint16, sopClassUID string, status uint16, remaining, completed, failed, warning uint16) *dataset.Dataset
BuildCMoveRSP builds a C-MOVE-RSP command dataset.
func BuildCStoreRQ ¶
func BuildCStoreRQ(messageID uint16, sopClassUID, sopInstanceUID string, priority uint16) *dataset.Dataset
BuildCStoreRQ builds a C-STORE-RQ command dataset.
func BuildCStoreRSP ¶
func BuildCStoreRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
BuildCStoreRSP builds a C-STORE-RSP command dataset.
func BuildNActionRQ ¶
func BuildNActionRQ(messageID uint16, sopClassUID, sopInstanceUID string, actionTypeID uint16, hasDataSet bool) *dataset.Dataset
BuildNActionRQ builds an N-ACTION-RQ command dataset.
func BuildNActionRSP ¶
func BuildNActionRSP(messageID uint16, sopClassUID, sopInstanceUID string, actionTypeID, status uint16) *dataset.Dataset
BuildNActionRSP builds an N-ACTION-RSP command dataset.
func BuildNCreateRQ ¶
func BuildNCreateRQ(messageID uint16, sopClassUID, sopInstanceUID string, hasDataSet bool) *dataset.Dataset
BuildNCreateRQ builds an N-CREATE-RQ command dataset.
func BuildNCreateRSP ¶
func BuildNCreateRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
BuildNCreateRSP builds an N-CREATE-RSP command dataset.
func BuildNDeleteRQ ¶
BuildNDeleteRQ builds an N-DELETE-RQ command dataset.
func BuildNDeleteRSP ¶
func BuildNDeleteRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
BuildNDeleteRSP builds an N-DELETE-RSP command dataset.
func BuildNEventReportRQ ¶
func BuildNEventReportRQ(messageID uint16, sopClassUID, sopInstanceUID string, eventTypeID uint16, hasDataSet bool) *dataset.Dataset
BuildNEventReportRQ builds an N-EVENT-REPORT-RQ command dataset.
func BuildNEventReportRSP ¶
func BuildNEventReportRSP(messageID uint16, sopClassUID, sopInstanceUID string, eventTypeID, status uint16) *dataset.Dataset
BuildNEventReportRSP builds an N-EVENT-REPORT-RSP command dataset.
func BuildNGetRQ ¶
BuildNGetRQ builds an N-GET-RQ command dataset.
func BuildNGetRSP ¶
func BuildNGetRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16, hasDataSet bool) *dataset.Dataset
BuildNGetRSP builds an N-GET-RSP command dataset.
func BuildNSetRQ ¶
BuildNSetRQ builds an N-SET-RQ command dataset.
func BuildNSetRSP ¶
func BuildNSetRSP(messageID uint16, sopClassUID, sopInstanceUID string, status uint16) *dataset.Dataset
BuildNSetRSP builds an N-SET-RSP command dataset.
func ContextWithAssociationInfo ¶ added in v1.1.1
func ContextWithAssociationInfo(ctx context.Context, info *AssociationInfo) context.Context
ContextWithAssociationInfo returns a new context with the given AssociationInfo attached.
func DebugLogger ¶
func DebugLogger()
DebugLogger enables debug-level logging to stderr. This is the equivalent of pynetdicom's debug_logger().
func DecodeCommandDataset ¶
DecodeCommandDataset decodes a DICOM command dataset from Implicit VR Little Endian bytes.
func DecodeDataset ¶ added in v1.2.0
DecodeDataset parses a data set encoded with the given transfer syntax.
func DefaultTransferSyntaxes ¶
func DefaultTransferSyntaxes() []string
DefaultTransferSyntaxes returns the default set of transfer syntaxes to propose.
func EncodeCommandDataset ¶
EncodeCommandDataset creates a DICOM command dataset as Implicit VR Little Endian bytes.
func EncodeDataset ¶ added in v1.2.0
EncodeDataset serializes a data set using the given transfer syntax.
The transfer syntax must be the one negotiated for the presentation context the data will be sent on; encoding with a different syntax than the peer agreed to produces a data set the peer cannot parse.
func EncodePDU ¶
EncodePDU encodes a PDU to bytes. This is a convenience function that calls the PDU's Encode method.
func EventTypeString ¶
EventTypeString returns a human-readable name for an event type.
func FindPresentationContextID ¶
func FindPresentationContextID(accepted map[byte]*PresentationContext, abstractSyntax string) (byte, bool)
FindPresentationContextID returns the presentation context ID for a given abstract syntax from the accepted contexts map. Returns 0, false if not found.
func FormatStatus ¶
FormatStatus returns a human-readable string for a DIMSE status code.
func GetAffectedSOPClassUID ¶
GetAffectedSOPClassUID extracts the Affected SOP Class UID from a command dataset.
func GetAffectedSOPInstanceUID ¶
GetAffectedSOPInstanceUID extracts the Affected SOP Instance UID from a command dataset.
func GetDataSetType ¶
GetDataSetType extracts the CommandDataSetType from a command dataset.
func HasDataSet ¶
HasDataSet returns whether the command indicates a data set follows.
func IsQueryRetrieveSOPClass ¶
IsQueryRetrieveSOPClass returns true if the given UID is a Query/Retrieve SOP Class.
func IsStorageSOPClass ¶
IsStorageSOPClass returns true if the given UID is a Storage SOP Class.
func LoggingEventHandlers ¶
func LoggingEventHandlers(logger *Logger) map[EventType]EventHandler
LoggingEventHandlers returns event handlers that log association lifecycle events. Attach these to an SCP's EventManager for operational visibility.
func PDUTypeString ¶
PDUTypeString returns a human-readable string for a PDU type.
func ParseCommandDataset ¶
func ParseCommandDataset(ds *dataset.Dataset) (commandField uint16, messageID uint16, status uint16, err error)
ParseCommandDataset extracts common DIMSE fields from a command dataset.
func SetDefaultLogLevel ¶
func SetDefaultLogLevel(level LogLevel)
SetDefaultLogLevel sets the log level on the package-level logger.
func UncompressedTransferSyntaxUIDs ¶
func UncompressedTransferSyntaxUIDs() []string
UncompressedTransferSyntaxUIDs returns only uncompressed transfer syntaxes.
Types ¶
type AssociateAC ¶
type AssociateAC struct {
ProtocolVersion uint16
CalledAE string
CallingAE string
ApplicationContextUID string
PresentationContexts []PresentationContextResultItem
UserInformation UserInformationItem
}
AssociateAC represents an A-ASSOCIATE-AC PDU.
func (*AssociateAC) Encode ¶
func (p *AssociateAC) Encode() ([]byte, error)
func (*AssociateAC) Type ¶
func (p *AssociateAC) Type() byte
type AssociateRJ ¶
AssociateRJ represents an A-ASSOCIATE-RJ PDU.
func (*AssociateRJ) Encode ¶
func (p *AssociateRJ) Encode() ([]byte, error)
func (*AssociateRJ) Type ¶
func (p *AssociateRJ) Type() byte
type AssociateRQ ¶
type AssociateRQ struct {
ProtocolVersion uint16
CalledAE string
CallingAE string
ApplicationContextUID string
PresentationContexts []PresentationContextItem
UserInformation UserInformationItem
}
AssociateRQ represents an A-ASSOCIATE-RQ PDU.
func (*AssociateRQ) Encode ¶
func (p *AssociateRQ) Encode() ([]byte, error)
func (*AssociateRQ) Type ¶
func (p *AssociateRQ) Type() byte
type Association ¶
type Association struct {
// contains filtered or unexported fields
}
Association represents a DICOM association between two AEs.
func NewAssociation ¶
func NewAssociation(transport *Transport) *Association
NewAssociation creates a new association in the Idle state.
func (*Association) Abort ¶
func (a *Association) Abort(ctx context.Context, source, reason byte) error
Abort sends an A-ABORT PDU.
func (*Association) AcceptAssociation ¶
func (a *Association) AcceptAssociation(ctx context.Context, rq *AssociateRQ, supportedAbstractSyntaxes map[string]bool, supportedTransferSyntaxes map[string]bool, maxPDUSize uint32) error
AcceptAssociation handles an incoming A-ASSOCIATE-RQ (SCP side).
func (*Association) AcceptedContexts ¶
func (a *Association) AcceptedContexts() map[byte]*PresentationContext
AcceptedContexts returns the map of accepted presentation contexts.
func (*Association) CalledAE ¶
func (a *Association) CalledAE() string
CalledAE returns the called AE title.
func (*Association) CallingAE ¶
func (a *Association) CallingAE() string
CallingAE returns the calling AE title.
func (*Association) MaxPDUSize ¶
func (a *Association) MaxPDUSize() uint32
MaxPDUSize returns the negotiated maximum PDU size.
func (*Association) PeerUserInformation ¶ added in v1.2.0
func (a *Association) PeerUserInformation() UserInformationItem
PeerUserInformation returns the User Information the peer sent during association negotiation, including any extended negotiation sub-items (async operations window, role selection, user identity response).
func (*Association) ReceivePData ¶
ReceivePData reads and reassembles P-DATA-TF PDUs until a complete message is received. Returns the context ID, the assembled data, whether it's a command, and any error.
func (*Association) RejectAssociation ¶
func (a *Association) RejectAssociation(ctx context.Context, result, source, reason byte) error
RejectAssociation sends an A-ASSOCIATE-RJ PDU (SCP side).
func (*Association) Release ¶
func (a *Association) Release(ctx context.Context) error
Release performs an orderly release of the association.
func (*Association) RequestAssociation ¶
func (a *Association) RequestAssociation(ctx context.Context, callingAE, calledAE string, contexts []PresentationContextItem, maxPDUSize uint32) error
RequestAssociation sends an A-ASSOCIATE-RQ and processes the response (SCU side).
func (*Association) RequestAssociationWithNegotiation ¶ added in v1.2.0
func (a *Association) RequestAssociationWithNegotiation(ctx context.Context, callingAE, calledAE string, contexts []PresentationContextItem, maxPDUSize uint32, ext *ExtendedNegotiation) error
RequestAssociationWithNegotiation sends an A-ASSOCIATE-RQ carrying optional extended negotiation items (async operations window, SCP/SCU role selection, user identity) and processes the response.
Role selection is required to act as an SCP for a SOP Class on an association this AE initiated — notably for C-GET, where the peer sends C-STORE sub-operations back over the same association.
func (*Association) RoleSelectionFor ¶ added in v1.2.0
func (a *Association) RoleSelectionFor(sopClassUID string) (SCPSCURoleSelection, bool)
RoleSelectionFor returns the negotiated SCP/SCU role selection for a SOP Class, and whether the peer supplied one.
func (*Association) SendPData ¶
func (a *Association) SendPData(ctx context.Context, contextID byte, data []byte, isCommand bool) error
SendPData sends data as P-DATA-TF PDUs, fragmenting if necessary.
func (*Association) State ¶
func (a *Association) State() AssociationState
State returns the current association state.
func (*Association) TransferSyntaxFor ¶ added in v1.2.0
func (a *Association) TransferSyntaxFor(contextID byte) string
TransferSyntaxFor returns the transfer syntax negotiated for a presentation context ID. It returns the empty string when the context was not accepted, which callers treat as DICOM's implicit VR little endian default.
type AssociationError ¶
type AssociationError struct {
Message string
Code string
Detail string
Result byte // A-ASSOCIATE-RJ result field
Source byte // A-ASSOCIATE-RJ source field
Reason byte // A-ASSOCIATE-RJ reason field
}
AssociationError represents errors during association negotiation.
func NewAssociationError ¶
func NewAssociationError(code, message string) *AssociationError
NewAssociationError creates a new association error.
func NewAssociationRejection ¶
func NewAssociationRejection(result, source, reason byte) *AssociationError
NewAssociationRejection creates an error from A-ASSOCIATE-RJ PDU fields.
func (*AssociationError) Details ¶
func (e *AssociationError) Details() string
func (*AssociationError) Error ¶
func (e *AssociationError) Error() string
func (*AssociationError) ErrorCode ¶
func (e *AssociationError) ErrorCode() string
type AssociationInfo ¶ added in v1.1.1
type AssociationInfo struct {
// CallingAE is the AE title of the remote peer (the SCU).
CallingAE string
// CalledAE is the AE title that was called (the SCP).
CalledAE string
// RemoteAddr is the network address of the remote peer.
RemoteAddr net.Addr
// LocalAddr is the local network address of this side of the connection.
LocalAddr net.Addr
// MaxPDUSize is the negotiated maximum PDU size for the association.
MaxPDUSize uint32
// AcceptedContexts contains the negotiated presentation contexts,
// keyed by presentation context ID.
AcceptedContexts map[byte]*PresentationContext
// PeerImplementationClassUID is the implementation class UID reported
// by the remote peer in the A-ASSOCIATE-RQ.
PeerImplementationClassUID string
// PeerImplementationVersion is the implementation version name reported
// by the remote peer in the A-ASSOCIATE-RQ.
PeerImplementationVersion string
}
AssociationInfo holds association-level information that is made available to Handler methods via the context. This allows handlers to access details about the current association (e.g., who is connecting) without changing the Handler interface.
func AssociationInfoFromContext ¶ added in v1.1.1
func AssociationInfoFromContext(ctx context.Context) *AssociationInfo
AssociationInfoFromContext extracts the AssociationInfo from the context. Returns nil if no association info is present.
type AssociationState ¶
type AssociationState int
AssociationState represents the state of a DICOM association.
const ( StateIdle AssociationState = iota // No association StateAwaitingAssocResponse // A-ASSOCIATE-RQ sent, waiting for response StateAssociated // Association established StateAwaitingRelease // A-RELEASE-RQ sent, waiting for response StateAwaitingReleaseRP // Received A-RELEASE-RQ, processing )
func (AssociationState) String ¶
func (s AssociationState) String() string
String returns a human-readable name for the association state.
type AsynchronousOperationsWindow ¶
type AsynchronousOperationsWindow struct {
MaxOperationsInvoked uint16
MaxOperationsPerformed uint16
}
AsynchronousOperationsWindow negotiates the number of asynchronous operations.
func DecodeAsyncOperationsWindow ¶
func DecodeAsyncOperationsWindow(data []byte) (*AsynchronousOperationsWindow, error)
DecodeAsyncOperationsWindow decodes an async operations window sub-item.
func (*AsynchronousOperationsWindow) Encode ¶
func (a *AsynchronousOperationsWindow) Encode() []byte
Encode serializes the async operations window sub-item.
type BaseHandler ¶
type BaseHandler struct{}
BaseHandler provides default implementations for all Handler methods. Embed this in your handler to only override the methods you need.
func (*BaseHandler) HandleCEcho ¶
func (h *BaseHandler) HandleCEcho(_ context.Context, req *CEchoRequest) (*CEchoResponse, error)
HandleCEcho returns success by default.
func (*BaseHandler) HandleCFind ¶
func (h *BaseHandler) HandleCFind(_ context.Context, _ *CFindRequest) ([]*CFindResponse, error)
HandleCFind returns an empty result set by default.
func (*BaseHandler) HandleCGet ¶
func (h *BaseHandler) HandleCGet(_ context.Context, _ *CGetRequest) (*CGetResponse, error)
HandleCGet returns an error by default.
func (*BaseHandler) HandleCMove ¶
func (h *BaseHandler) HandleCMove(_ context.Context, _ *CMoveRequest) (*CMoveResponse, error)
HandleCMove returns an error by default.
func (*BaseHandler) HandleCStore ¶
func (h *BaseHandler) HandleCStore(_ context.Context, req *CStoreRequest) (*CStoreResponse, error)
HandleCStore returns success by default.
func (*BaseHandler) HandleNAction ¶
func (h *BaseHandler) HandleNAction(_ context.Context, _ *NActionRequest) (*NActionResponse, error)
HandleNAction returns an error by default.
func (*BaseHandler) HandleNCreate ¶
func (h *BaseHandler) HandleNCreate(_ context.Context, _ *NCreateRequest) (*NCreateResponse, error)
HandleNCreate returns an error by default.
func (*BaseHandler) HandleNDelete ¶
func (h *BaseHandler) HandleNDelete(_ context.Context, _ *NDeleteRequest) (*NDeleteResponse, error)
HandleNDelete returns an error by default.
func (*BaseHandler) HandleNEventReport ¶
func (h *BaseHandler) HandleNEventReport(_ context.Context, _ *NEventReportRequest) (*NEventReportResponse, error)
HandleNEventReport returns an error by default.
func (*BaseHandler) HandleNGet ¶
func (h *BaseHandler) HandleNGet(_ context.Context, _ *NGetRequest) (*NGetResponse, error)
HandleNGet returns an error by default.
func (*BaseHandler) HandleNSet ¶
func (h *BaseHandler) HandleNSet(_ context.Context, _ *NSetRequest) (*NSetResponse, error)
HandleNSet returns an error by default.
type CEchoRequest ¶
CEchoRequest represents a C-ECHO-RQ message.
type CEchoResponse ¶
CEchoResponse represents a C-ECHO-RSP message.
type CFindRequest ¶
type CFindRequest struct {
MessageID uint16
AffectedSOPClass string
Priority uint16
DataSet *dataset.Dataset
}
CFindRequest represents a C-FIND-RQ message.
type CFindResponse ¶
type CFindResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
Status uint16
DataSet *dataset.Dataset
}
CFindResponse represents a C-FIND-RSP message.
type CFindResult ¶
CFindResult wraps a find result or error.
type CGetRequest ¶
type CGetRequest struct {
MessageID uint16
AffectedSOPClass string
Priority uint16
DataSet *dataset.Dataset
}
CGetRequest represents a C-GET-RQ message.
type CGetResponse ¶
type CGetResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
Status uint16
NumberOfRemaining uint16
NumberOfCompleted uint16
NumberOfFailed uint16
NumberOfWarning uint16
DataSet *dataset.Dataset
}
CGetResponse represents a C-GET-RSP message.
type CMoveRequest ¶
type CMoveRequest struct {
MessageID uint16
AffectedSOPClass string
Priority uint16
MoveDestination string
DataSet *dataset.Dataset
}
CMoveRequest represents a C-MOVE-RQ message.
type CMoveResponse ¶
type CMoveResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
Status uint16
NumberOfRemaining uint16
NumberOfCompleted uint16
NumberOfFailed uint16
NumberOfWarning uint16
DataSet *dataset.Dataset
}
CMoveResponse represents a C-MOVE-RSP message.
type CStoreRequest ¶
type CStoreRequest struct {
MessageID uint16
AffectedSOPClass string
AffectedSOPInstance string
Priority uint16
MoveOriginatorAE string
MoveOriginatorMsgID uint16
DataSet *dataset.Dataset
}
CStoreRequest represents a C-STORE-RQ message.
type CStoreResponse ¶
type CStoreResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
Status uint16
}
CStoreResponse represents a C-STORE-RSP message.
type CommunicationError ¶
CommunicationError represents a transport-level communication error.
func NewCommunicationError ¶
func NewCommunicationError(code, message string, cause error) *CommunicationError
NewCommunicationError creates a new communication error.
func (*CommunicationError) Details ¶
func (e *CommunicationError) Details() string
func (*CommunicationError) Error ¶
func (e *CommunicationError) Error() string
func (*CommunicationError) ErrorCode ¶
func (e *CommunicationError) ErrorCode() string
func (*CommunicationError) Unwrap ¶
func (e *CommunicationError) Unwrap() error
type CompositeHandler ¶
type CompositeHandler struct {
BaseHandler
// contains filtered or unexported fields
}
CompositeHandler allows registering separate handlers for different service types.
func NewCompositeHandler ¶
func NewCompositeHandler() *CompositeHandler
NewCompositeHandler creates a new CompositeHandler.
func (*CompositeHandler) HandleCEcho ¶
func (h *CompositeHandler) HandleCEcho(ctx context.Context, req *CEchoRequest) (*CEchoResponse, error)
HandleCEcho delegates to the echo handler.
func (*CompositeHandler) HandleCFind ¶
func (h *CompositeHandler) HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
HandleCFind delegates to the find handler.
func (*CompositeHandler) HandleCGet ¶
func (h *CompositeHandler) HandleCGet(ctx context.Context, req *CGetRequest) (*CGetResponse, error)
HandleCGet delegates to the get handler.
func (*CompositeHandler) HandleCMove ¶
func (h *CompositeHandler) HandleCMove(ctx context.Context, req *CMoveRequest) (*CMoveResponse, error)
HandleCMove delegates to the move handler.
func (*CompositeHandler) HandleCStore ¶
func (h *CompositeHandler) HandleCStore(ctx context.Context, req *CStoreRequest) (*CStoreResponse, error)
HandleCStore delegates to the store handler.
func (*CompositeHandler) SetEchoHandler ¶
func (h *CompositeHandler) SetEchoHandler(handler Handler)
SetEchoHandler sets the handler for C-ECHO requests.
func (*CompositeHandler) SetFindHandler ¶
func (h *CompositeHandler) SetFindHandler(handler Handler)
SetFindHandler sets the handler for C-FIND requests.
func (*CompositeHandler) SetGetHandler ¶
func (h *CompositeHandler) SetGetHandler(handler Handler)
SetGetHandler sets the handler for C-GET requests.
func (*CompositeHandler) SetMoveHandler ¶
func (h *CompositeHandler) SetMoveHandler(handler Handler)
SetMoveHandler sets the handler for C-MOVE requests.
func (*CompositeHandler) SetStoreHandler ¶
func (h *CompositeHandler) SetStoreHandler(handler Handler)
SetStoreHandler sets the handler for C-STORE requests.
type DIMSEError ¶
DIMSEError represents an error in DIMSE message processing.
func NewDIMSEError ¶
func NewDIMSEError(code, message string, status uint16) *DIMSEError
NewDIMSEError creates a new DIMSE error.
func (*DIMSEError) Details ¶
func (e *DIMSEError) Details() string
func (*DIMSEError) Error ¶
func (e *DIMSEError) Error() string
func (*DIMSEError) ErrorCode ¶
func (e *DIMSEError) ErrorCode() string
type EchoHandler ¶
type EchoHandler struct {
BaseHandler
}
EchoHandler is a simple handler that only supports C-ECHO (verification).
type Event ¶
type Event struct {
Type EventType
Timestamp time.Time
// Association context (may be nil for connection-level events)
CallingAE string
CalledAE string
RemoteAddr string
// PDU/DIMSE context (set for PDU/DIMSE events)
PDUType byte
CommandType uint16
// Additional context
Description string
Error error
}
Event carries information about a network event.
type EventHandler ¶
type EventHandler func(event *Event)
EventHandler is a function that handles network events.
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
EventManager manages event handlers. Thread-safe.
func NewEventManager ¶
func NewEventManager() *EventManager
NewEventManager creates a new EventManager.
func (*EventManager) Emit ¶
func (em *EventManager) Emit(event *Event)
Emit fires an event, calling all registered handlers.
func (*EventManager) HasHandlers ¶
func (em *EventManager) HasHandlers(eventType EventType) bool
HasHandlers returns true if any handlers are registered for the event type.
func (*EventManager) Off ¶
func (em *EventManager) Off(eventType EventType)
Off removes all handlers for an event type.
func (*EventManager) On ¶
func (em *EventManager) On(eventType EventType, handler EventHandler)
On registers a handler for an event type. Multiple handlers per event are supported.
type EventType ¶
type EventType int
EventType identifies a network event.
const ( // Connection lifecycle EVTConnOpen EventType = iota + 1 // Connection opened EVTConnClose // Connection closed // Association lifecycle EVTAssocRequested // Association requested (SCU sent A-ASSOCIATE-RQ) EVTAssocAccepted // Association accepted (SCP sent A-ASSOCIATE-AC) EVTAssocRejected // Association rejected (SCP sent A-ASSOCIATE-RJ) EVTAssocEstablished // Association established (both sides) EVTAssocReleased // Association released normally EVTAssocAborted // Association aborted abnormally // ACSE (Association Control Service Element) primitives EVTACSERecv // ACSE primitive received from DUL EVTACSESent // ACSE primitive sent to DUL // PDU (Protocol Data Unit) level EVTPDURecv // PDU received and decoded EVTPDUSent // PDU encoded and sent // Raw data level EVTDataRecv // Raw PDU data received from remote EVTDataSent // Raw PDU data sent to remote // DIMSE (DICOM Message Service Element) level EVTDIMSERecv // Complete DIMSE message received and decoded EVTDIMSESent // DIMSE message encoded and sent to DUL // State machine EVTFSMTransition // DUL state machine about to transition // C-DIMSE service events (intervention) EVTCEcho // C-ECHO request received EVTCStore // C-STORE request received EVTCFind // C-FIND request received EVTCMove // C-MOVE request received EVTCGet // C-GET request received // N-DIMSE service events (intervention) EVTNEventReport // N-EVENT-REPORT request received EVTNGet // N-GET request received EVTNSet // N-SET request received EVTNAction // N-ACTION request received EVTNCreate // N-CREATE request received EVTNDelete // N-DELETE request received // Negotiation events (intervention) EVTAsyncOps // Asynchronous operations negotiation requested EVTSOPExtended // SOP class extended negotiation requested EVTSOPCommon // SOP class common extended negotiation requested EVTUserID // User identity negotiation requested )
Notification events — informational, multiple handlers allowed. These match pynetdicom's EVT_* constants for full compatibility.
type ExtendedNegotiation ¶
type ExtendedNegotiation struct {
AsyncOperations *AsynchronousOperationsWindow
RoleSelections []SCPSCURoleSelection
UserIdentity *UserIdentityNegotiation
}
ExtendedNegotiation holds all extended negotiation items.
type Handler ¶
type Handler interface {
// C-DIMSE services
HandleCEcho(ctx context.Context, req *CEchoRequest) (*CEchoResponse, error)
HandleCStore(ctx context.Context, req *CStoreRequest) (*CStoreResponse, error)
HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
HandleCMove(ctx context.Context, req *CMoveRequest) (*CMoveResponse, error)
HandleCGet(ctx context.Context, req *CGetRequest) (*CGetResponse, error)
// N-DIMSE services
HandleNEventReport(ctx context.Context, req *NEventReportRequest) (*NEventReportResponse, error)
HandleNGet(ctx context.Context, req *NGetRequest) (*NGetResponse, error)
HandleNSet(ctx context.Context, req *NSetRequest) (*NSetResponse, error)
HandleNAction(ctx context.Context, req *NActionRequest) (*NActionResponse, error)
HandleNCreate(ctx context.Context, req *NCreateRequest) (*NCreateResponse, error)
HandleNDelete(ctx context.Context, req *NDeleteRequest) (*NDeleteResponse, error)
}
Handler defines the interface for handling DIMSE requests on the SCP side. Implement only the methods you need; use BaseHandler for defaults.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener wraps a TCP listener for accepting DICOM associations.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging for DICOM network operations.
type NActionRequest ¶
type NActionRequest struct {
MessageID uint16
RequestedSOPClass string
RequestedSOPInstance string
ActionTypeID uint16
DataSet *dataset.Dataset
}
NActionRequest represents an N-ACTION-RQ message.
type NActionResponse ¶
type NActionResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
ActionTypeID uint16
Status uint16
DataSet *dataset.Dataset
}
NActionResponse represents an N-ACTION-RSP message.
type NCreateRequest ¶
type NCreateRequest struct {
MessageID uint16
AffectedSOPClass string
AffectedSOPInstance string
DataSet *dataset.Dataset
}
NCreateRequest represents an N-CREATE-RQ message.
type NCreateResponse ¶
type NCreateResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
Status uint16
DataSet *dataset.Dataset
}
NCreateResponse represents an N-CREATE-RSP message.
type NDeleteRequest ¶
type NDeleteRequest struct {
MessageID uint16
RequestedSOPClass string
RequestedSOPInstance string
}
NDeleteRequest represents an N-DELETE-RQ message.
type NDeleteResponse ¶
type NDeleteResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
Status uint16
}
NDeleteResponse represents an N-DELETE-RSP message.
type NEventReportRequest ¶
type NEventReportRequest struct {
MessageID uint16
AffectedSOPClass string
AffectedSOPInstance string
EventTypeID uint16
DataSet *dataset.Dataset
}
NEventReportRequest represents an N-EVENT-REPORT-RQ message.
type NEventReportResponse ¶
type NEventReportResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
EventTypeID uint16
Status uint16
DataSet *dataset.Dataset
}
NEventReportResponse represents an N-EVENT-REPORT-RSP message.
type NGetRequest ¶
type NGetRequest struct {
MessageID uint16
RequestedSOPClass string
RequestedSOPInstance string
AttributeList []tag.Tag
}
NGetRequest represents an N-GET-RQ message.
type NGetResponse ¶
type NGetResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
Status uint16
DataSet *dataset.Dataset
}
NGetResponse represents an N-GET-RSP message.
type NSetRequest ¶
type NSetRequest struct {
MessageID uint16
RequestedSOPClass string
RequestedSOPInstance string
DataSet *dataset.Dataset
}
NSetRequest represents an N-SET-RQ message.
type NSetResponse ¶
type NSetResponse struct {
MessageIDRespondedTo uint16
AffectedSOPClass string
AffectedSOPInstance string
Status uint16
DataSet *dataset.Dataset
}
NSetResponse represents an N-SET-RSP message.
type NetworkConfig ¶
type NetworkConfig struct {
// MaxPDUSize is the maximum PDU size to propose during association negotiation.
MaxPDUSize uint32
// ARTIMTimeout is the timeout for the ARTIM timer.
ARTIMTimeout time.Duration
// DIMSETimeout is the timeout for DIMSE operations.
DIMSETimeout time.Duration
// NetworkTimeout is the timeout for establishing TCP connections.
NetworkTimeout time.Duration
}
NetworkConfig holds configuration for DICOM network operations.
func DefaultNetworkConfig ¶
func DefaultNetworkConfig() NetworkConfig
DefaultNetworkConfig returns a NetworkConfig with sensible defaults.
type NetworkError ¶
NetworkError is the base interface for all network-specific errors.
type PDUError ¶
PDUError represents errors in PDU encoding/decoding.
func NewPDUError ¶
NewPDUError creates a new PDU error.
func NewPDUErrorf ¶
NewPDUErrorf creates a new PDU error with formatted message.
type PDataTF ¶
type PDataTF struct {
PDVItems []PDVItem
}
PDataTF represents a P-DATA-TF PDU containing one or more PDV items.
type PresentationContext ¶
PresentationContext represents a negotiated presentation context pairing an abstract syntax (SOP Class) with a transfer syntax.
func (*PresentationContext) IsAccepted ¶
func (pc *PresentationContext) IsAccepted() bool
IsAccepted returns true if this presentation context was accepted.
type PresentationContextItem ¶
PresentationContextItem represents a presentation context in an A-ASSOCIATE-RQ.
func AllStoragePresentationContexts ¶
func AllStoragePresentationContexts() []PresentationContextItem
AllStoragePresentationContexts returns presentation contexts for all storage SOP classes.
func BasicWorklistPresentationContexts ¶
func BasicWorklistPresentationContexts() []PresentationContextItem
BasicWorklistPresentationContexts returns presentation contexts for Modality Worklist.
func DefaultQueryRetrieveContexts ¶
func DefaultQueryRetrieveContexts() []PresentationContextItem
DefaultQueryRetrieveContexts returns presentation contexts for query/retrieve operations.
func DefaultStorageContexts ¶
func DefaultStorageContexts() []PresentationContextItem
DefaultStorageContexts returns presentation contexts for common storage SOP classes.
func DefaultVerificationContexts ¶
func DefaultVerificationContexts() []PresentationContextItem
DefaultVerificationContexts returns presentation contexts for C-ECHO.
func InstanceAvailabilityPresentationContexts ¶
func InstanceAvailabilityPresentationContexts() []PresentationContextItem
InstanceAvailabilityPresentationContexts returns contexts for Instance Availability.
func ModalityPerformedProcedurePresentationContexts ¶
func ModalityPerformedProcedurePresentationContexts() []PresentationContextItem
ModalityPerformedProcedurePresentationContexts returns contexts for MPPS.
func NonPatientObjectPresentationContexts ¶
func NonPatientObjectPresentationContexts() []PresentationContextItem
NonPatientObjectPresentationContexts returns contexts for Non-Patient Object Storage.
func PrintManagementPresentationContexts ¶
func PrintManagementPresentationContexts() []PresentationContextItem
PrintManagementPresentationContexts returns contexts for Print Management.
func QueryRetrievePresentationContexts ¶
func QueryRetrievePresentationContexts() []PresentationContextItem
QueryRetrievePresentationContexts returns presentation contexts for Q/R services.
func StorageCommitmentPresentationContexts ¶
func StorageCommitmentPresentationContexts() []PresentationContextItem
StorageCommitmentPresentationContexts returns contexts for Storage Commitment.
func SubstanceAdministrationPresentationContexts ¶
func SubstanceAdministrationPresentationContexts() []PresentationContextItem
SubstanceAdministrationPresentationContexts returns contexts for Substance Administration.
func UnifiedProcedureStepPresentationContexts ¶
func UnifiedProcedureStepPresentationContexts() []PresentationContextItem
UnifiedProcedureStepPresentationContexts returns contexts for UPS.
func VerificationPresentationContexts ¶
func VerificationPresentationContexts() []PresentationContextItem
VerificationPresentationContexts returns presentation contexts for C-ECHO.
type PresentationContextResultItem ¶
PresentationContextResultItem represents a presentation context result in an A-ASSOCIATE-AC.
func NegotiatePresentationContexts ¶
func NegotiatePresentationContexts( requested []PresentationContextItem, supportedAbstractSyntaxes map[string]bool, supportedTransferSyntaxes map[string]bool, ) []PresentationContextResultItem
NegotiatePresentationContexts selects transfer syntaxes for requested presentation contexts based on what the SCP supports. Returns the result items for the A-ASSOCIATE-AC PDU.
type QueryRetrieveHandler ¶
type QueryRetrieveHandler struct {
BaseHandler
OnFind func(ctx context.Context, sopClassUID string, query *dataset.Dataset) ([]*dataset.Dataset, error)
OnMove func(ctx context.Context, sopClassUID, moveDestination string, query *dataset.Dataset) error
OnGet func(ctx context.Context, sopClassUID string, query *dataset.Dataset) ([]*dataset.Dataset, error)
}
QueryRetrieveHandler handles C-FIND, C-MOVE, and C-GET requests with callbacks.
func (*QueryRetrieveHandler) HandleCFind ¶
func (h *QueryRetrieveHandler) HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
HandleCFind delegates to the OnFind callback if set.
func (*QueryRetrieveHandler) HandleCGet ¶ added in v1.2.0
func (h *QueryRetrieveHandler) HandleCGet(ctx context.Context, req *CGetRequest) (*CGetResponse, error)
HandleCGet delegates to the OnGet callback if set.
The returned datasets are the instances matching the query. Sending them back as C-STORE sub-operations is not yet implemented, so the response reports the match count and a warning status rather than claiming success.
func (*QueryRetrieveHandler) HandleCMove ¶
func (h *QueryRetrieveHandler) HandleCMove(ctx context.Context, req *CMoveRequest) (*CMoveResponse, error)
HandleCMove delegates to the OnMove callback if set.
type SCP ¶
type SCP struct {
// contains filtered or unexported fields
}
SCP (Service Class Provider) is a DICOM network server.
func (*SCP) ListenAndServe ¶
ListenAndServe starts the SCP server, listening for incoming associations. It blocks until the context is canceled.
func (*SCP) SetHandler ¶
SetHandler sets the handler for incoming DIMSE requests.
func (*SCP) SetSupportedAbstractSyntaxes ¶
SetSupportedAbstractSyntaxes sets the abstract syntaxes this SCP supports.
func (*SCP) SetSupportedTransferSyntaxes ¶
SetSupportedTransferSyntaxes sets the transfer syntaxes this SCP supports.
type SCPConfig ¶
type SCPConfig struct {
// AETitle is the AE title of this SCP.
AETitle string
// Port is the TCP port to listen on.
Port int
// BindAddress is the address to bind to. Empty string means all interfaces.
BindAddress string
// Network holds low-level network settings.
Network NetworkConfig
// MaxAssociations is the maximum number of concurrent associations. 0 means unlimited.
MaxAssociations int
}
SCPConfig holds configuration for a Service Class Provider (server).
type SCPConfigTLS ¶
SCPConfigTLS extends SCPConfig with TLS settings.
type SCPSCURoleSelection ¶
SCPSCURoleSelection negotiates SCP/SCU roles for a SOP Class.
func DecodeSCPSCURoleSelection ¶
func DecodeSCPSCURoleSelection(data []byte) (*SCPSCURoleSelection, error)
DecodeSCPSCURoleSelection decodes a SCP/SCU role selection sub-item.
func (*SCPSCURoleSelection) Encode ¶
func (r *SCPSCURoleSelection) Encode() []byte
Encode serializes the SCP/SCU role selection sub-item.
type SCU ¶
type SCU struct {
// contains filtered or unexported fields
}
SCU (Service Class User) is a DICOM network client.
func (*SCU) Associate ¶
func (s *SCU) Associate(ctx context.Context, contexts []PresentationContextItem) error
Associate establishes an association with the SCP, proposing the given presentation contexts. If contexts is nil, default verification + storage + query/retrieve contexts are proposed.
func (*SCU) Association ¶ added in v1.2.0
func (s *SCU) Association() *Association
Association returns the SCU's current association, or nil when not associated. Use it to inspect what was negotiated — accepted presentation contexts, the agreed transfer syntax per context, and any extended negotiation the peer returned.
func (*SCU) IsAssociated ¶
IsAssociated returns whether the SCU has an active association.
func (*SCU) NAction ¶
func (s *SCU) NAction(ctx context.Context, sopClassUID, sopInstanceUID string, actionTypeID uint16, ds *dataset.Dataset) (*NActionResponse, error)
NAction sends an N-ACTION-RQ.
func (*SCU) NCreate ¶
func (s *SCU) NCreate(ctx context.Context, sopClassUID, sopInstanceUID string, ds *dataset.Dataset) (*NCreateResponse, error)
NCreate sends an N-CREATE-RQ.
func (*SCU) NDelete ¶
func (s *SCU) NDelete(ctx context.Context, sopClassUID, sopInstanceUID string) (*NDeleteResponse, error)
NDelete sends an N-DELETE-RQ.
func (*SCU) NEventReport ¶
func (s *SCU) NEventReport(ctx context.Context, sopClassUID, sopInstanceUID string, eventTypeID uint16, ds *dataset.Dataset) (*NEventReportResponse, error)
NEventReport sends an N-EVENT-REPORT-RQ.
func (*SCU) NSet ¶
func (s *SCU) NSet(ctx context.Context, sopClassUID, sopInstanceUID string, ds *dataset.Dataset) (*NSetResponse, error)
NSet sends an N-SET-RQ.
type SCUConfig ¶
type SCUConfig struct {
// CallingAE is the AE title of this SCU (the client).
CallingAE string
// CalledAE is the AE title of the target SCP (the server).
CalledAE string
// Address is the target address in "host:port" format.
Address string
// Network holds low-level network settings.
Network NetworkConfig
// ExtendedNegotiation carries optional A-ASSOCIATE-RQ extended negotiation
// items: asynchronous operations window, SCP/SCU role selection, and user
// identity (username/password, Kerberos, SAML, JWT). Nil proposes none.
ExtendedNegotiation *ExtendedNegotiation
}
SCUConfig holds configuration for a Service Class User (client).
type SCUConfigTLS ¶
SCUConfigTLS extends SCUConfig with TLS settings.
type SOPClassExtendedNegotiation ¶
SOPClassExtendedNegotiation carries service-specific negotiation data.
func DecodeSOPClassExtendedNegotiation ¶ added in v1.2.0
func DecodeSOPClassExtendedNegotiation(data []byte) (*SOPClassExtendedNegotiation, error)
DecodeSOPClassExtendedNegotiation decodes a SOP Class Extended Negotiation sub-item: a 2-byte UID length, the SOP Class UID, then service-class-specific application information filling the remainder.
func (*SOPClassExtendedNegotiation) Encode ¶
func (s *SOPClassExtendedNegotiation) Encode() []byte
Encode serializes the SOP Class Extended Negotiation sub-item.
type Server ¶
type Server struct {
// Events provides hooks into server lifecycle events.
Events *EventManager
// Logger for this server instance.
Logger *Logger
// contains filtered or unexported fields
}
Server represents a non-blocking DICOM SCP server. Unlike SCP.ListenAndServe (which blocks), Server can be started and stopped programmatically, allowing multiple servers to run simultaneously in the same process.
Example — run 3 servers simultaneously:
echoServer := network.StartServer(ctx, network.SCPConfig{AETitle: "ECHO", Port: 11112}, &network.EchoHandler{})
storeServer := network.StartServer(ctx, network.SCPConfig{AETitle: "STORE", Port: 11113}, storeHandler)
wlServer := network.StartServer(ctx, network.SCPConfig{AETitle: "WORKLIST", Port: 11114}, worklistHandler)
// All three are running concurrently
fmt.Println(echoServer.Addr()) // "0.0.0.0:11112"
fmt.Println(storeServer.Addr()) // "0.0.0.0:11113"
fmt.Println(wlServer.Addr()) // "0.0.0.0:11114"
// Stop one
echoServer.Stop()
// Wait for all to finish
storeServer.Wait()
wlServer.Wait()
func StartServer ¶
StartServer creates and starts a non-blocking DICOM SCP server. Returns immediately. The server runs in a background goroutine.
func StartServerTLS ¶
func StartServerTLS(ctx context.Context, config SCPConfig, handler Handler, tlsCfg *TLSConfig) (*Server, error)
StartServerTLS creates and starts a TLS-encrypted DICOM SCP server.
func (*Server) SetHandler ¶
SetHandler changes the server's DIMSE handler.
func (*Server) SetSupportedAbstractSyntaxes ¶
SetSupportedAbstractSyntaxes configures which SOP Classes this server accepts.
func (*Server) SetSupportedTransferSyntaxes ¶
SetSupportedTransferSyntaxes configures which Transfer Syntaxes this server accepts.
type ServerGroup ¶
type ServerGroup struct {
// contains filtered or unexported fields
}
ServerGroup manages multiple DICOM servers running simultaneously.
Example:
group := network.NewServerGroup()
group.Add(ctx, network.SCPConfig{AETitle: "ECHO", Port: 11112}, &network.EchoHandler{})
group.Add(ctx, network.SCPConfig{AETitle: "STORE", Port: 11113}, storeHandler)
group.Add(ctx, network.SCPConfig{AETitle: "QR", Port: 11114}, qrHandler)
// ... all 3 running ...
group.StopAll()
func (*ServerGroup) AddTLS ¶
func (g *ServerGroup) AddTLS(ctx context.Context, config SCPConfig, handler Handler, tlsCfg *TLSConfig) (*Server, error)
AddTLS creates and starts a new TLS server, adding it to the group.
func (*ServerGroup) Count ¶
func (g *ServerGroup) Count() int
Count returns the number of servers in the group.
func (*ServerGroup) Servers ¶
func (g *ServerGroup) Servers() []*Server
Servers returns all servers in the group.
func (*ServerGroup) StopAll ¶
func (g *ServerGroup) StopAll()
StopAll stops all servers in the group.
func (*ServerGroup) WaitAll ¶
func (g *ServerGroup) WaitAll()
WaitAll blocks until all servers have stopped.
type StatusCategory ¶
type StatusCategory int
StatusCategory represents the category of a DICOM status code.
const ( StatusCategorySuccess StatusCategory = iota StatusCategoryPending StatusCategoryCancel StatusCategoryWarning StatusCategoryFailure StatusCategoryUnknown )
func CategorizeStatus ¶
func CategorizeStatus(status uint16) StatusCategory
CategorizeStatus returns the category of a DICOM status code.
func (StatusCategory) String ¶
func (sc StatusCategory) String() string
String returns the name of the status category.
type StorageHandler ¶
type StorageHandler struct {
BaseHandler
OnStore func(ctx context.Context, sopClassUID, sopInstanceUID string, ds *dataset.Dataset) uint16
}
StorageHandler is a handler that accepts C-STORE requests and calls a callback.
func (*StorageHandler) HandleCStore ¶
func (h *StorageHandler) HandleCStore(ctx context.Context, req *CStoreRequest) (*CStoreResponse, error)
HandleCStore delegates to the OnStore callback if set.
type TLSConfig ¶
type TLSConfig struct {
// CertFile is the path to the TLS certificate file (PEM format).
CertFile string
// KeyFile is the path to the TLS private key file (PEM format).
KeyFile string
// CAFile is the path to the CA certificate file for client verification.
CAFile string
// InsecureSkipVerify disables certificate verification (for testing only).
InsecureSkipVerify bool
// ServerName is the expected server hostname for certificate verification.
ServerName string
// MinVersion is the minimum TLS version (default: TLS 1.2).
MinVersion uint16
// Config allows providing a custom *tls.Config directly.
// If set, CertFile/KeyFile/CAFile are ignored.
Config *tls.Config
}
TLSConfig holds TLS configuration for encrypted DICOM communication. DICOM Part 15 recommends TLS for HIPAA compliance and PHI protection.
type TimeoutError ¶
TimeoutError represents a network operation timeout.
func NewTimeoutError ¶
func NewTimeoutError(operation, message string) *TimeoutError
NewTimeoutError creates a new timeout error.
func (*TimeoutError) Details ¶
func (e *TimeoutError) Details() string
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
func (*TimeoutError) ErrorCode ¶
func (e *TimeoutError) ErrorCode() string
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport wraps a TCP connection with DICOM-specific read/write operations.
func DialTLS ¶
func DialTLS(ctx context.Context, address string, timeout time.Duration, tlsCfg *TLSConfig) (*Transport, error)
DialTLS establishes a TLS-encrypted TCP connection.
func NewTransport ¶
NewTransport creates a new Transport wrapping an existing connection.
func (*Transport) MaxPDUSize ¶
MaxPDUSize returns the current maximum PDU size.
func (*Transport) RemoteAddr ¶
RemoteAddr returns the remote network address.
func (*Transport) SetMaxPDUSize ¶
SetMaxPDUSize updates the maximum PDU size (typically after negotiation).
type UserIdentityNegotiation ¶
type UserIdentityNegotiation struct {
Type UserIdentityType
PositiveResponseRequested bool
PrimaryField []byte // Username, Kerberos ticket, SAML assertion, or JWT
SecondaryField []byte // Password (only for UserIdentityUsernamePassword)
}
UserIdentityNegotiation provides user identity in association requests.
func DecodeUserIdentityNegotiation ¶
func DecodeUserIdentityNegotiation(data []byte) (*UserIdentityNegotiation, error)
DecodeUserIdentityNegotiation decodes a user identity negotiation sub-item.
func (*UserIdentityNegotiation) Encode ¶
func (u *UserIdentityNegotiation) Encode() []byte
Encode serializes the user identity negotiation sub-item.
type UserIdentityResponse ¶
type UserIdentityResponse struct {
ServerResponse []byte
}
UserIdentityResponse represents the server response to user identity negotiation.
func (*UserIdentityResponse) Encode ¶
func (u *UserIdentityResponse) Encode() []byte
Encode serializes the user identity response sub-item.
type UserIdentityType ¶
type UserIdentityType byte
UserIdentityType defines the type of user identity negotiation.
const ( UserIdentityUsername UserIdentityType = 1 UserIdentityUsernamePassword UserIdentityType = 2 UserIdentityKerberos UserIdentityType = 3 UserIdentitySAML UserIdentityType = 4 UserIdentityJWT UserIdentityType = 5 )
type UserInformationItem ¶
type UserInformationItem struct {
MaxPDULength uint32
ImplementationClassUID string
ImplementationVersion string
// AsyncOperations carries the Asynchronous Operations Window sub-item
// (PS3.7 D.3.3.3) when the peer negotiates one. Nil when absent.
AsyncOperations *AsynchronousOperationsWindow
// RoleSelections carries SCP/SCU Role Selection sub-items (PS3.7 D.3.3.4),
// which let an SCU also act as an SCP for a SOP Class — required by C-GET.
RoleSelections []SCPSCURoleSelection
// UserIdentity carries the User Identity Negotiation sub-item
// (PS3.7 D.3.3.7) used for username/password, Kerberos, SAML, or JWT auth.
UserIdentity *UserIdentityNegotiation
// UserIdentityResponse carries the server's identity response in an
// A-ASSOCIATE-AC. Nil when absent.
UserIdentityResponse *UserIdentityResponse
// SOPClassExtended carries SOP Class Extended Negotiation sub-items
// (PS3.7 D.3.3.5) holding service-class-specific data.
SOPClassExtended []SOPClassExtendedNegotiation
}
UserInformationItem holds user information sub-items.
type WorklistHandler ¶
type WorklistHandler struct {
BaseHandler
OnWorklist func(ctx context.Context, query *dataset.Dataset) ([]*dataset.Dataset, error)
}
WorklistHandler handles Modality Worklist (MWL) queries.
func (*WorklistHandler) HandleCFind ¶
func (h *WorklistHandler) HandleCFind(ctx context.Context, req *CFindRequest) ([]*CFindResponse, error)
HandleCFind delegates worklist queries to the OnWorklist callback.