Skip to content
David Gobbi edited this page Apr 24, 2017 · 5 revisions

Dump the metadata from a DICOM series as text.

Usage

dicomdump file1.dcm [file2.dcm ...]

Options

-k tag          Provide a key to be printed.
-q <query.txt>  Provide a file that lists which elements to print.
--charset <cs>  Charset to use if SpecificCharacterSet is missing.
--help          Print a brief help message.
--version       Print the software version.

Description

Given a set of input files, dicomdump will divide them into series, and dump the metadata for each series.

Details

The following fields are printed for each attribute:

  • the tag, as (GGGG,EEEE) where GGGG and EEEE are in hexadecimal
  • the type, as a VR code
  • the name of the attribute, according to the DICOM dictionary
  • the value of the attribute (see below for more information)
  • the length of the value, in bytes

For example,

(0008,0070) LO "Manufacturer" : [Acme Products] (14 bytes)

The "name" field is always printed without spaces. This format of the name is sometimes called the "key", and is given in Part 6 of the DICOM standard.

The "value" is printed in square brackets. To support international files, text values are converted to utf-8 before they are printed. Typical example are as follows:

[Saskatoon]               typical text value
[ORIGINAL\PRIMARY]        multiple values, separated by backslash
[This value is long ...]  long value
[...]                     unprintable value, such as OB, OW, etc.

For UI values, if the UID is part of the DICOM standard (Part 6), then the meaning is provided in curly braces:

[1.2.840.10008.5.1.4.1.1.12.1] {X-Ray Angiographic Image Storage}

For sequences, the contents of the sequence are indented and printed immediately below. The DICOM standard allows sequences to be "fixed length" or "delimited". The text "(1 item)" in the following sample indicates that the sequence is fixed length, while "(delimited)" would indicate that the sequence is delimited. Special delimiter data elements such as (FFFE,E0DD) are never printed. For each item, the text "at offset 2750" indicates where the item appears in the file.

(0040,0275) SQ "RequestAttributesSequence" : (1 item)
  ---- SQ Item 0001 at offset 2750 ----
  (0040,0007) LO "ScheduledProcedureStepDescription" : [MR BRAIN-HEAD] (14 bytes)
  (0040,0009) SH "ScheduledProcedureStepID" : [MR-14-0003451] (14 bytes)
  (0040,1001) SH "RequestedProcedureID" : [MR-14-0003451] (14 bytes)

When given multiple input files, dicomdump will collate the attributes series-by-series. If the attribute values are the same for all files within a series, the attribute is printed just once. If the value varies from file to file, then the value will be printed for each file:

(0020,0032) DS "ImagePositionPatient" : (multiple values)
  0001 [-133.23172333482\-163.04536053893\-80.336194515228] (50 bytes)
  0002 [-133.23172333482\-163.04536053893\-79.336194515228] (50 bytes)
  0003 [-133.23172333482\-163.04536053893\-78.336194515228] (50 bytes)
  0004 [-133.23172333482\-163.04536053893\-77.336194515228] (50 bytes)

The files are sorted by instance number, so the numbering sequence "0001, 0002, etc" will match the instance number unless the series is missing instances or has duplicated InstanceNumbers.

It is important to note that "PixelData" will always be the final attribute that is printed, even if other attributes exist in the file. This is because the DICOM parser used by dicomdump is designed to quickly skim the file, so it terminates when the PixelData element is encountered (unless encountered within a sequence).

If only a few attributes are to be dumped, then their tags can be given with "-k" (the "-k" option can be repeated as many times as needed). Tags can given in hexadecimal GGGG,EEEE format, or in text format as specified in the DICOM dictionary. Alternately, the tags can be listed in a query file given with the "-q" option (one tag per line). Attributes nested within sequences can be specified by giving a tag path e.g. "-k Tag1/Tag2/Tag3". Either a forward slash or a backslash can be used to separate the components of the path.

dicomdump -k SeriesInstanceUID -k Modality

==== /Volumes/Work/Data/Anonymized/IM-0001-46448928-0001.dcm ====
(0020,000E) UI "SeriesInstanceUID" : [1.3.12.2.1107.5.2.30.25490.2014011612063575738142168.0.0.0] (58 bytes)
(0008,0060) CS "Modality" : [MR] (2 bytes)

For more information on the -k and -q options, see Command Line Tools.

Sample output

The following is a dump of the localizer series from a DICOM study:

==== PCIR/98890234/20030505/CT/CT1/22458 .. 22519 (3 files) ====
(0002,0000) UL "FileMetaInformationGroupLength" : [194] (4 bytes)
(0002,0001) OB "FileMetaInformationVersion" : [...] (2 bytes)
(0002,0002) UI "MediaStorageSOPClassUID" : [1.2.840.10008.5.1.4.1.1.2] {CT Image Storage} (26 bytes)
(0002,0003) UI "MediaStorageSOPInstanceUID" : (multiple values)
  0001 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.685] (50 bytes)
  0002 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.687] (50 bytes)
  0003 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.688] (50 bytes)
(0002,0010) UI "TransferSyntaxUID" : [1.2.840.10008.1.2.1] {Explicit VR Little Endian} (20 bytes)
(0002,0012) UI "ImplementationClassUID" : [1.3.6.1.4.1.5962.2] (18 bytes)
(0002,0013) SH "ImplementationVersionName" : [DCTOOL100] (10 bytes)
(0002,0016) AE "SourceApplicationEntityTitle" : [CLUNIE1] (8 bytes)
(0008,0008) CS "ImageType" : (multiple values)
  0001 [ORIGINAL\PRIMARY\LOCALIZER] (26 bytes)
  0002 [ORIGINAL\PRIMARY\LOCALIZER\ES] (30 bytes)
  0003 [ORIGINAL\PRIMARY\LOCALIZER\PS] (30 bytes)
(0008,0012) DA "InstanceCreationDate" : [20030505] (8 bytes)
(0008,0013) TM "InstanceCreationTime" : [014919] (6 bytes)
(0008,0014) UI "InstanceCreatorUID" : [1.3.6.1.4.1.5962.3] (18 bytes)
(0008,0016) UI "SOPClassUID" : [1.2.840.10008.5.1.4.1.1.2] {CT Image Storage} (26 bytes)
(0008,0018) UI "SOPInstanceUID" : (multiple values)
  0001 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.685] (50 bytes)
  0002 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.687] (50 bytes)
  0003 [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.688] (50 bytes)
(0008,0020) DA "StudyDate" : [20030505] (8 bytes)
(0008,0022) DA "AcquisitionDate" : [20030505] (8 bytes)
(0008,0023) DA "ContentDate" : [20030505] (8 bytes)
(0008,0030) TM "StudyTime" : [014852] (6 bytes)
(0008,0032) TM "AcquisitionTime" : [014916] (6 bytes)
(0008,0033) TM "ContentTime" : [014916] (6 bytes)
(0008,0050) SH "AccessionNumber" : [684] (4 bytes)
(0008,0060) CS "Modality" : [CT] (2 bytes)
(0008,0070) LO "Manufacturer" : [Philips] (8 bytes)
(0008,0090) PN "ReferringPhysicianName" : [] (0 bytes)
(0008,0201) SH "TimezoneOffsetFromUTC" : [+0000] (6 bytes)
(0008,1030) LO "StudyDescription" : [CT HEAD] (8 bytes)
(0008,103E) LO "SeriesDescription" : [SURVIEW] (8 bytes)
(0008,1090) LO "ManufacturerModelName" : [Brilliance 64] (14 bytes)
(0010,0010) PN "PatientName" : [Doe^Peter] (10 bytes)
(0010,0020) LO "PatientID" : [98890234] (8 bytes)
(0010,0030) DA "PatientBirthDate" : [] (0 bytes)
(0010,0040) CS "PatientSex" : [M] (2 bytes)
(0010,1010) AS "PatientAge" : [045Y] (4 bytes)
(0010,21B0) LT "AdditionalPatientHistory" : [A9] (2 bytes)
(0012,0062) CS "PatientIdentityRemoved" : [YES] (4 bytes)
(0012,0063) LO "DeidentificationMethod" : [dcanon\no identifiers\keep descriptions\keep manufacturer\keep retired\keep private\no uids\keep pet demographics\...] (146 bytes)
(0018,0022) CS "ScanOptions" : [SURVIEW] (8 bytes)
(0018,0050) DS "SliceThickness" : [0.625] (6 bytes)
(0018,0060) DS "KVP" : [120] (4 bytes)
(0018,0090) DS "DataCollectionDiameter" : [500] (4 bytes)
(0018,1020) LO "SoftwareVersions" : [2.0.0] (6 bytes)
(0018,1030) LO "ProtocolName" : [ROUTINE BRAIN/Head] (18 bytes)
(0018,1100) DS "ReconstructionDiameter" : [500] (4 bytes)
(0018,1120) DS "GantryDetectorTilt" : [0] (2 bytes)
(0018,1130) DS "TableHeight" : [121] (4 bytes)
(0018,1140) CS "RotationDirection" : [CW] (2 bytes)
(0018,1141) DS "AngularPosition" : [90] (2 bytes)
(0018,1143) DS "ScanArc" : [90] (2 bytes)
(0018,1150) IS "ExposureTime" : [3000] (4 bytes)
(0018,1151) IS "XRayTubeCurrent" : [30] (2 bytes)
(0018,1160) SH "FilterType" : [D] (2 bytes)
(0018,5100) CS "PatientPosition" : [HFS] (4 bytes)
(0020,000D) UI "StudyInstanceUID" : [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.683] (50 bytes)
(0020,000E) UI "SeriesInstanceUID" : [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.684] (50 bytes)
(0020,0010) SH "StudyID" : [684] (4 bytes)
(0020,0011) IS "SeriesNumber" : [1] (2 bytes)
(0020,0012) IS "AcquisitionNumber" : [] (0 bytes)
(0020,0013) IS "InstanceNumber" : [1] (2 bytes)
(0020,0032) DS "ImagePositionPatient" : [0\-116\259.604614] (18 bytes)
(0020,0037) DS "ImageOrientationPatient" : [0\1\0\0\0\-1] (12 bytes)
(0020,0052) UI "FrameOfReferenceUID" : [1.3.6.1.4.1.5962.1.1.0.0.0.1196533885.18148.0.686] (50 bytes)
(0020,0060) CS "Laterality" : [] (0 bytes)
(0020,1040) LO "PositionReferenceIndicator" : [] (0 bytes)
(0020,1041) DS "SliceLocation" : [-40.20] (6 bytes)
(0020,4000) LT "ImageComments" : [SURVIEW] (8 bytes)
(0028,0002) US "SamplesPerPixel" : [1] (2 bytes)
(0028,0004) CS "PhotometricInterpretation" : [MONOCHROME2] (12 bytes)
(0028,0010) US "Rows" : [307] (2 bytes)
(0028,0011) US "Columns" : [512] (2 bytes)
(0028,0030) DS "PixelSpacing" : [0.9765625\0.9765625] (20 bytes)
(0028,0100) US "BitsAllocated" : [16] (2 bytes)
(0028,0101) US "BitsStored" : [12] (2 bytes)
(0028,0102) US "HighBit" : [11] (2 bytes)
(0028,0103) US "PixelRepresentation" : [0] (2 bytes)
(0028,1050) DS "WindowCenter" : [00020\00020] (12 bytes)
(0028,1051) DS "WindowWidth" : [01500\01500] (12 bytes)
(0028,1052) DS "RescaleIntercept" : [-1024] (6 bytes)
(0028,1053) DS "RescaleSlope" : [1] (2 bytes)
(0032,1060) LO "RequestedProcedureDescription" : [CT Head] (8 bytes)
(7FE0,0010) OW "PixelData" : [...] (314368 bytes)

See also

  • dicomtocsv if you want the output formatted for use in a spreadsheet