From 02043a6f54ee663a69076d6a89eb405ccc3c11f4 Mon Sep 17 00:00:00 2001 From: paulojamorim Date: Wed, 24 Feb 2010 12:05:13 +0000 Subject: [PATCH] FIX: temporary fix latin caracters --- invesalius/reader/dicom.py | 9 +++++---- invesalius/reader/dicom_reader.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/invesalius/reader/dicom.py b/invesalius/reader/dicom.py index 5fc18b2..b4d3d1e 100644 --- a/invesalius/reader/dicom.py +++ b/invesalius/reader/dicom.py @@ -184,15 +184,16 @@ class Parser(): """ import os.path as path + filename = path.abspath(filename) + if (sys.platform == 'win32'): + filename = filename.encode('latin-1') + var_file = open("c:\\arquivo.txt","w") var_file.write(filename) var_file.close() - #print type(filename) - #print filename - #print filename - #print "____________" + if path.isfile(filename): # Several information can be acquired from DICOM using # vtkgdcm.vtkGDCMImageReader.GetMedicalImageProperties() diff --git a/invesalius/reader/dicom_reader.py b/invesalius/reader/dicom_reader.py index 93eebea..be39e74 100644 --- a/invesalius/reader/dicom_reader.py +++ b/invesalius/reader/dicom_reader.py @@ -121,7 +121,7 @@ def yGetDicomGroups(directory, recursive=True, gui=True): if recursive: for dirpath, dirnames, filenames in os.walk(directory): for name in filenames: - filepath = os.path.join(dirpath, name).encode('latin-1') + filepath = os.path.join(dirpath, name) counter += 1 if gui: yield (counter,nfiles) -- libgit2 0.21.2