Read Image Meta-Data Dictionary and Print
Overview
This example illustrates how to read only an image’s information and meta-data dictionary without loading the pixel content via the ImageFileReader.
Reading an entire image potentially is memory and time intensive operation when the image is large or many files must be read. The image information and meta-data dictionary can be read without the bulk data by using the ImageFilerReader’s object oriented interface, with use of the ImageFileReader::ReadImageInformation method.
While all file formats support loading image information such as size, pixel type, origin, and spacing many image types do not have a meta-data dictionary. The most common case for images with a dictionary is DICOM, but also the fields from TIFF, NIFTI, MetaIO and other file formats maybe loaded into the meta-data dictionary.
For efficiency, the default DICOM reader settings will only load public tags (even group numbers). In the example we explicitly set the reader to also load private tags (odd group numbers). For further information on DICOM data elements see the standard part 5, Data Structures and Encoding.
See also Dicom Series Read Modify Write, Dicom Series Reader.
Sample Output
Running the above Python script with the image “docs/images/Image0075.dcm” produces the following output:
DICOM Output (click triangle to collapse)
(0008|0000) = = "406"
(0008|0005) = = "ISO_IR 100"
(0008|0008) = = "ORIGINAL\PRIMARY\OTHER"
(0008|0016) = = "1.2.840.10008.5.1.4.1.1.4"
(0008|0018) = = "1.2.840.113619.2.133.1762890640.1886.1055165016.74"
(0008|0020) = = "20030625"
(0008|0021) = = "20030625"
(0008|0022) = = "20030625"
(0008|0023) = = "20030625"
(0008|0030) = = "152734"
(0008|0031) = = "153128"
(0008|0032) = = "153128"
(0008|0033) = = "153128"
(0008|0050) = = ""
(0008|0060) = = "MR"
(0008|0070) = = "GE MEDICAL SYSTEMS"
(0008|0080) = = "crd "
(0008|0090) = = ""
(0008|1010) = = "sig3ow0 "
(0008|1030) = = "Tech_1"
(0008|103e) = = "head scan "
(0008|1070) = = "RPM "
(0008|1090) = = "GENESIS_SIGNA "
(0009|0000) = = "184"
(0009|0010) = = "GEMS_IDEN_01"
(0009|1001) = = "GE_GENESIS_FF "
(0009|1002) = = "sig3"
(0009|1004) = = "SIGNA "
(0009|1027) = = "1056555088"
(0009|1030) = = "18387rdmr3"
(0009|1031) = = "999 "
(0009|10e3) = = "1.2.840.113619.1.1.4.1762890640"
(0009|10e6) = = "09"
(0009|10e7) = = "3238884814"
(0009|10e9) = = "1056555088"
(0010|0000) = = "82"
(0010|0010) = = "Wes Turner"
(0010|0020) = = "1111"
(0010|0030) = = ""
(0010|0040) = = "O "
(0010|1010) = = "000Y"
(0010|1030) = = "68.039"
(0010|21b0) = = ""
(0011|0000) = = "30"
(0011|0010) = = "GEMS_PATI_01"
(0011|1010) = = "0"
(0018|0000) = = "428"
(0018|0020) = = "GR"
(0018|0021) = = "SS\SP "
(0018|0022) = = "FC\VB_GEMS\VASCTOF_GEMS\PFF "
(0018|0023) = = "3D"
(0018|0025) = = "N "
(0018|0050) = = " 1.6"
(0018|0080) = = "23"
(0018|0081) = = "10"
(0018|0083) = = " 1"
(0018|0084) = = " 6.38883e+08"
(0018|0085) = = "H1"
(0018|0086) = = " 1"
(0018|0087) = = "15000 "
(0018|0088) = = "1.6 "
(0018|0091) = = "0 "
(0018|0093) = = " 100"
(0018|0094) = = "75"
(0018|0095) = = " 97.6562"
(0018|1000) = = "0000018387rdmr3 "
(0018|1020) = = "09"
(0018|1050) = = " 1.14585"
(0018|1088) = = "0 "
(0018|1090) = = "0 "
(0018|1094) = = "0 "
(0018|1100) = = " 220"
(0018|1250) = = "HEAD"
(0018|1251) = = "HEAD"
(0018|1310) = = "0\256\192\0"
(0018|1312) = = "ROW "
(0018|1314) = = "25"
(0018|1315) = = "N "
(0018|1316) = = "0.004169"
(0018|5100) = = "HFS "
(0019|0000) = = "1004"
(0019|0010) = = "GEMS_ACQU_01"
(0019|100f) = = "418.4 "
(0019|1011) = = "0"
(0019|1012) = = "10"
(0019|1017) = = "16"
(0019|1018) = = "A "
(0019|1019) = = "75.073532 "
(0019|101a) = = "P "
(0019|101b) = = "-93.324310"
(0019|101e) = = "165 "
(0019|105a) = = "4.14274e+08"
(0019|107d) = = "0 "
(0019|107e) = = "1"
(0019|107f) = = "0 "
(0019|1081) = = "0"
(0019|1084) = = "0.218518"
(0019|1085) = = "1"
(0019|1087) = = "0 "
(0019|1088) = = "0"
(0019|108a) = = "12"
(0019|108b) = = "14"
(0019|108d) = = "0 "
(0019|108f) = = "0"
(0019|1090) = = "0"
(0019|1091) = = "0 "
(0019|1092) = = "0"
(0019|1093) = = "638883410 "
(0019|1094) = = "97"
(0019|1095) = = "12"
(0019|1096) = = "14"
(0019|1097) = = "0"
(0019|1098) = = "2"
(0019|109b) = = "1"
(0019|109c) = = "3dtof "
(0019|109d) = = "20021226173544"
(0019|109e) = = "3dtof "
(0019|109f) = = "1"
(0019|10a0) = = "0"
(0019|10a1) = = "0"
(0019|10a2) = = "5196"
(0019|10a3) = = "0"
(0019|10a4) = = "0"
(0019|10a7) = = "0 "
(0019|10a8) = = "0 "
(0019|10a9) = = "0 "
(0019|10aa) = = "0 "
(0019|10ab) = = "0 "
(0019|10ac) = = "0 "
(0019|10ad) = = "0 "
(0019|10ae) = = "0 "
(0019|10af) = = "0 "
(0019|10b0) = = "0 "
(0019|10b1) = = "0 "
(0019|10b2) = = "0 "
(0019|10b3) = = "0 "
(0019|10b4) = = "0 "
(0019|10b5) = = "0 "
(0019|10b6) = = "0 "
(0019|10b7) = = "0 "
(0019|10b8) = = "0 "
(0019|10b9) = = "0 "
(0019|10ba) = = "0 "
(0019|10bb) = = "0 "
(0019|10bc) = = "0 "
(0019|10bd) = = "0 "
(0019|10be) = = "0 "
(0019|10c0) = = "0"
(0019|10c1) = = "0"
(0019|10c2) = = "9990"
(0019|10c3) = = "9990"
(0019|10c4) = = "9990"
(0019|10c5) = = "9990"
(0019|10c6) = = "9990"
(0019|10c7) = = "9990"
(0019|10c8) = = "0"
(0019|10c9) = = "0"
(0019|10ca) = = "0"
(0019|10cb) = = "0"
(0019|10cc) = = "0"
(0019|10cd) = = "0"
(0019|10ce) = = "2"
(0019|10cf) = = "0"
(0019|10d2) = = "0"
(0019|10d3) = = ""
(0019|10d5) = = "1"
(0019|10d7) = = "0"
(0019|10d8) = = "0"
(0019|10d9) = = "0 "
(0019|10df) = = "0 "
(0019|10e0) = = "0 "
(0019|10e2) = = "0 "
(0019|10f2) = = "0"
(0019|10f9) = = "97"
(0020|0000) = = "340"
(0020|000d) = = "1.2.840.113619.2.133.1762890640.1886.1055165015.961"
(0020|000e) = = "1.2.840.113619.2.133.1762890640.1886.1055165015.999"
(0020|0010) = = "361 "
(0020|0011) = = " 3"
(0020|0012) = = " 0"
(0020|0013) = = "75"
(0020|0032) = = "-112\ -21.688\ 126.894"
(0020|0037) = = " 1\ 0\ 0\ 0\0.466651\ -0.884442"
(0020|0052) = = "1.2.840.113619.2.133.1762890640.1910.1055164903.673"
(0020|0060) = = ""
(0020|0110) = = " 0"
(0020|1040) = = ""
(0020|1041) = = "-29.6444568634"
(0021|0000) = = "328"
(0021|0010) = = "GEMS_RELA_01"
(0021|1003) = = "0"
(0021|1005) = = "09"
(0021|1007) = = "2539681714"
(0021|1018) = = "09"
(0021|1019) = = "3223022508"
(0021|1035) = = "2"
(0021|1036) = = "9"
(0021|1037) = = "16"
(0021|104f) = = "120"
(0021|1050) = = "0"
(0021|1051) = = "0.000000"
(0021|1052) = = "0.000000"
(0021|1053) = = "0.000000"
(0021|1056) = = "1"
(0021|1057) = = "124"
(0021|1058) = = "0"
(0021|1059) = = "0"
(0021|105a) = = "0"
(0021|105b) = = "180 "
(0021|105c) = = "45"
(0021|105d) = = "50000 "
(0021|105e) = = "0 "
(0021|105f) = = "0 "
(0021|1081) = = "0 "
(0021|1082) = = "0 "
(0021|1083) = = "0 "
(0021|1084) = = "0 "
(0023|0000) = = "58"
(0023|0010) = = "GEMS_STDY_01"
(0023|1070) = = "0"
(0023|1074) = = "0"
(0023|107d) = = "0"
(0025|0000) = = "128"
(0025|0010) = = "GEMS_SERS_01"
(0025|1006) = = "10"
(0025|1007) = = "120"
(0025|1010) = = "0"
(0025|1011) = = "1"
(0025|1014) = = "0"
(0025|1017) = = "0"
(0025|1018) = = "0"
(0025|1019) = = "120"
(0025|101a) = = "sig3ow0 "
(0027|0000) = = "306"
(0027|0010) = = "GEMS_IMAG_01"
(0027|1006) = = "0"
(0027|1010) = = "0"
(0027|1030) = = ""
(0027|1031) = = "9"
(0027|1032) = = "10"
(0027|1033) = = "1032"
(0027|1035) = = "16"
(0027|1036) = = "24"
(0027|1040) = = "P "
(0027|1041) = = "-29.6445"
(0027|1042) = = "2"
(0027|1043) = = "-29.6445"
(0027|1044) = = "29.6041"
(0027|1045) = = "-0"
(0027|1046) = = "0.884443"
(0027|1047) = = "-0.466649"
(0027|1048) = = "-108"
(0027|1049) = = "21.688"
(0027|104a) = = "126.894"
(0027|104b) = = "-108"
(0027|104c) = = "-80.9769"
(0027|104d) = = "-67.6862"
(0027|1060) = = "256"
(0027|1061) = = "192"
(0027|1062) = = "1"
(0028|0000) = = "148"
(0028|0002) = = "1"
(0028|0004) = = "MONOCHROME2 "
(0028|0010) = = "256"
(0028|0011) = = "256"
(0028|0030) = = " 0.85939\0.859375"
(0028|0100) = = "16"
(0028|0101) = = "16"
(0028|0102) = = "15"
(0028|0103) = = "1"
(0028|0120) = = "0"
(0028|1050) = = "96"
(0028|1051) = = " 192"
(0029|0000) = = "102"
(0029|0010) = = "GEMS_IMPS_01"
(0029|1015) = = "0"
(0029|1016) = = "0"
(0029|1017) = = "0"
(0029|1018) = = "0"
(0029|1026) = = "2"
(0029|1034) = = "16384"
(0029|1035) = = "0"
(0043|0000) = = "5162"
(0043|0010) = = "GEMS_PARM_01"
(0043|1001) = = "1"
(0043|1002) = = "0"
(0043|1003) = = "0"
(0043|1004) = = "0"
(0043|1006) = = "0"
(0043|1007) = = "0"
(0043|1008) = = "0"
(0043|1009) = = "0"
(0043|100a) = = "1"
(0043|100b) = = "0 "
(0043|100c) = = "66"
(0043|100d) = = "0 "
(0043|100e) = = "0 "
(0043|100f) = = "0.0874073 "
(0043|1010) = = "0"
(0043|101c) = = "0"
(0043|101d) = = "0"
(0043|1028) = = "TVIgUmVjb24gPDA+AC8zNjEvMy8xAAAAAAAAACkAAED/////As64qALOuNgB1WTkAKp5KALNAAAAkmMIAdewqAAAAAAAAAAAAAAAAACTWfg="
(0043|1029) = = "AAAAAUImFTMAJgAAAMAAAAAAA/5B+AGWAbQB+wIEAikCEgIxAkwCLQIqAiUCFwH8AeABzAG9AZoBlwGpAYYBSgFQAUgBHQEqAQoBCgDnAOoA/gDcANIAuwC/AKwAoACtAKQAkQCCAHEAbwBpAGQAVwBgAGEAVgBRAEcATgA7ADYAUwBDAD4AMAA0ADQAMQA5ADQAMAAqACkAMQAwACIAHwAlABYANwAsACYAHgAYACcAHgAqACUAIQAYABoAHwAmABsAIAAgAB4AIQAiACEAHQAgACwAIQArACEAHwAVACMAIAAdABMAHQAUAB4AGAAYACUAFwAZABUAHgATABsAFAAdAB8AHQASABYAEwAZABcAHgAVABcAGAAfABYAEQAbAA0AHgAfABEAHQAXABkAFQAYAB0AGgAbABkAFAAbACQAHQAcABcAGQAZABkAGgAeABEAGgAVABsAHwAcABoAGQAYABYAGQAeAB8AGwAiACEAGQAXABwAGQAYABsAHQAhACUAIQAjAB4AGwAXACQAIAAhACIAHAAmABwAHwAbACAAJgApACYAIwApAB0AKAAhAB0AHQAkAB8AEgAjACMAFQAhACQAJAAnAB0AKAAdACQAJQAfACEAIAAjACgAHgAlAB0AKwAdABoAIQAlACQAIgASACAAKQAmAB0AIwAhACQAJQAvACwALAAdACUALQAeACcAMQAlACgAKAAtAC4AJwAjACYAMgAhABwAKQAoACUAKwArACgALQArADcALwAzACoALQAyACkALAAzADQALgAqACoAIAA5ACYAHwAsADIAJgAnACsAJwAtAB4ANQA6AC0AKgAlADMAKgAyAD8AKgApAC8ANQAuADoAMAA+ACkAMAA1ACoAMwAyADQAMwA3ACwALwA7ADIALQA2AC4ANAA2AC8APQA8ADsAMwA4ADMAMgA/ADIARAA7AD0AOwA2AEcANQBHADMAQwAzADUANABEAEYAOgA/AD8ATABDAEYARABDADwAUgBBAEsAQwBHAEYAWgBNAEgAMwBDADEAXABCAFIAVQA/AEcARgBdAFEARgBZAFYASgBTAF4AV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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAA="
(0043|102c) = = "0"
(0043|102d) = = ""
(0043|102e) = = ""
(0043|102f) = = "0"
(0043|1030) = = "0"
(0043|1032) = = "2"
(0043|1033) = = "0"
(0043|1034) = = "1200"
(0043|1035) = = "0"
(0043|1036) = = "0"
(0043|1037) = = "0"
(0043|1038) = = "0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
(0043|1039) = = " 0\ 0\ 0\ 7"
(0043|1060) = = " 0\ 0\ 0\10\ 0\ 0\ 0\ 0"
(0043|1061) = = "1.2.840.113619.2.133.1762890640.1886.1055165015.961"
(0043|1062) = = "361 "
(0043|106f) = = " 0\ 0\ 0"
(7fe0|0000) = = "131084"
Image Size: (256, 256, 1)
Image PixelType: 16-bit signed integer
Code
import sys
import SimpleITK as sitk
def main(args):
""" A SimpleITK script that prints a DICOM image's tags. """
if len(args) < 2:
print("Usage: DicomImagePrintTags <input_file>")
sys.exit(1)
reader = sitk.ImageFileReader()
reader.SetFileName(args[1])
reader.LoadPrivateTagsOn()
reader.ReadImageInformation()
for k in reader.GetMetaDataKeys():
v = reader.GetMetaData(k)
print(f'({k}) = = "{v}"')
print(f"Image Size: {reader.GetSize()}")
print(f"Image PixelType: {sitk.GetPixelIDValueAsString(reader.GetPixelID())}")
# Run with:
#
# Rscript --vanilla DicomImagePrintTags.R input_file
#
library(SimpleITK)
args <- commandArgs( TRUE )
if (length(args) < 1) {
write("Usage arguments: <input_file>", stderr())
quit(1)
}
reader <- ImageFileReader()
reader$SetFileName(args[[1]])
reader$LoadPrivateTagsOn()
reader$ReadImageInformation()
keys <- reader$GetMetaDataKeys()
for ( k in keys)
{
print(sprintf("(%s) = \"%s\"", k, reader$GetMetaData(k)))
}
cat("Image Size: ", reader$GetSize(), '\n')
pixelType = GetPixelIDValueAsString(reader$GetPixelID())
cat("Image PixelType: ", pixelType, '\n')