X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2Fdemo%2Fexplore.py;h=af124bb64dcf9cf3465ebb2a6cd157e551a9282b;hb=703c62aef53764870f39532e74e76bb976b99aa2;hp=6ca9200be32d111c1b2dde158260de110064994a;hpb=b7f909f6f6c37085bb05debd27c375c826c1ce74;p=gdcm.git diff --git a/gdcmPython/demo/explore.py b/gdcmPython/demo/explore.py index 6ca9200b..af124bb6 100644 --- a/gdcmPython/demo/explore.py +++ b/gdcmPython/demo/explore.py @@ -1,7 +1,16 @@ from gdcmPython import * +### 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) -toRead.LoadElements() ValDict = toRead.GetPubElVal() ExploreElements = ["Patient Name", "Patient ID", "Study Date", "Study Time", "Study ID",