-from load import *
+from gdcmPython import *
-########## Real usage of Pygdcm starts here
-toRead = gdcm.gdcmHeader(FileName)
-toRead.LoadElements()
+### Get filename from command line or default it
+try:
+ FileName = sys.argv[1]
+except IndexError:
+ FileName = os.path.join(GDCM_DATA_PATH, "test.acr")
+
+if not os.path.isfile(FileName):
+ print "Cannot open file ", FileName
+ sys.exit()
+
+toRead = gdcmHeader(FileName)
ValDict = toRead.GetPubElVal()
ExploreElements = ["Patient Name", "Patient ID",
"Study Date", "Study Time", "Study ID",