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_ROOT, "DICOMDIR")
20 printLevel = int(sys.argv[2])
24 ### Build the DicomDir element list
25 dicomdir = gdcm.DicomDir(fileName)
26 if not dicomdir.IsReadable():
28 raise RuntimeError,"The '%s' DicomDir is not readable with gdcm." % fileName
31 print "##############################################################"
32 print "## Display all the elements and their respective values"
33 print "## found in the ", fileName, " file."
34 print "##############################################################"
35 dicomdir.SetPrintLevel(-1)