]> Creatis software - gdcm.git/blob - gdcmPython/demo/explore.py
c11a9aebb94d87ca1e7b41d4972ae0ae28c7d6c5
[gdcm.git] / gdcmPython / demo / explore.py
1 from load import *
2
3 ########## Real usage of Pygdcm starts here
4 toRead = gdcm.gdcmHeader(FileName)
5 toRead.LoadElements()
6 ValDict = toRead.GetPubElVal()
7 ExploreElements = ["Patient Name", "Patient ID",
8                                                  "Study Date", "Study Time", "Study ID",
9                                                  "Study Instance UID",
10                                                  "Series Number",
11                                                  "Modality"]
12
13 for elem in ExploreElements:
14         print "[%s] = " % elem,
15         try:
16                 print "[%s]" % ValDict[elem]
17         except KeyError:
18                 print "NOT FOUND"