4 sys.path.append('${GDCM_BINARY_DIR}')
6 sys.path.append('${GDCM_BINARY_DIR}/bin')
8 sys.path.append('${GDCM_BINARY_DIR}/bin/Release')
9 sys.path.append('${GDCM_BINARY_DIR}/bin/Debug')
11 from gdcmPython.core import *
13 ### Get filename from command line or default it
15 fileName = sys.argv[1]
17 fileName = os.path.join(GDCM_DATA_PATH, "test.acr")
20 printLevel = int(sys.argv[2])
24 #if not os.path.isfile(FileName):
25 # print "Cannot open file ", FileName
28 # On debugging purposes uncomment the next line
29 #s = raw_input("Hit any key in this window to exit")
31 ### Build the header element list
32 print fileName, type(fileName)
33 header = gdcm.Header(fileName)
34 if not header.IsReadable():
35 print "The ", fileName, " file is not readable with gdcm. Sorry."
38 print "##############################################################"
39 print "### Display all the elements and their respective values"
40 print "## found in the ", fileName, " file."
41 print "##############################################################"
44 val=header.GetNextEntry()
48 val=header.GetNextEntry()