X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2Fdemo%2FvtkGdcmWriter.py.in;h=999035e8d024a71f9ca882c6e2ea3122d93fce95;hb=25a0000db08f39e6702b07f9936686efebf5277f;hp=845243f75529996ae07e4a8995bd0dc5762cb762;hpb=d24a4150db8e1c04392eece82119098276713d46;p=gdcm.git diff --git a/gdcmPython/demo/vtkGdcmWriter.py.in b/gdcmPython/demo/vtkGdcmWriter.py.in index 845243f7..999035e8 100644 --- a/gdcmPython/demo/vtkGdcmWriter.py.in +++ b/gdcmPython/demo/vtkGdcmWriter.py.in @@ -1,25 +1,34 @@ import sys -import os - -sys.path.append('${GDCM_BINARY_DIR}') -if os.name == 'posix': - sys.path.append('${GDCM_BINARY_DIR}/bin') -else: - sys.path.append('${GDCM_BINARY_DIR}/bin/Release') - sys.path.append('${GDCM_BINARY_DIR}/bin/Debug') - +import os.path +from gdcmConfigDemo import * from gdcmPython.vtk import * from vtkpython import * +def PrintUse(): + print "" + print "Use :" + print "-----" + print "%s " % sys.argv[0] + print " fileName : path to the DICOM file to see" + print "" + print "" + # Get the file names try: fileName = sys.argv[1] except IndexError: - fileName = os.path.join(GDCM_DATA_PATH, "test.acr") + fileName = os.path.join(GDCM_DATA_ROOT, "test.acr") + if( not os.path.isfile(fileName) ): + fileName=os.path.join(os.path.split(sys.argv[0])[0],"test.acr") + +if( not os.path.isfile(fileName) ): + PrintUse() + sys.exit(1) # read the image reader = vtkGdcmReader() reader.SetFileName(fileName) +reader.Update() # write the image writer = vtkGdcmWriter()