Main Content


Get information about DICOM unique identifier



details = images.dicom.decodeUID(uid) returns information about the DICOM unique identifier contained in uid. details contains the name and type of the UID. If uid corresponds to a transfer syntax, then details also contains the endianness and the DICOM value representation (VR) necessary for reading the image pixels, and information about compression.

The images.dicom.decodeUID function can interpret IDs defined in the PS 3.6-1999 specification, with some additions from PS 3.6-2009.


collapse all

Read metadata from a DICOM file and extract a UID field.

info = dicominfo("CT-MONO2-16-ankle.dcm");
uid = info.SOPClassUID;

Decode the UID.

uid_info = images.dicom.decodeUID(uid)
uid_info = struct with fields:
    Value: '1.2.840.10008.'
     Name: 'Secondary Capture Image Storage'
     Type: 'SOP Class'

Input Arguments

collapse all

DICOM unique identifier, specified as a string or character vector.

Example: "1.2.840.10008."

Data Types: char | string

Output Arguments

collapse all

Information from UID, returned as a structure with these fields:


Value of the UID, returned as a character vector. If uid is not a valid UID, then the value of this field is an empty character vector, ''.


Name of the UID, returned as a character vector.


Type of the UID, returned as a character vector.

For transfer syntaxes, the structure contains these additional fields:

CompressedCompression, returned as a logical true or false.
EndianEndianness, returned as 'ieee-be' or 'ieee-le'.
PixelEndianPixel endianness, returned as 'ieee-be' or 'ieee-le'.
VRValue representation (VR), returned as 'Implicit' or 'Explicit'.
LossyCompressionCompression type is lossy, returned as a logical true or false.
CompressionTypeCompression type, returned as a character vector.

Version History

Introduced in R2017b