Commit ad2c27e804f877156bfac60663e859d3f381eacc
1 parent
b94711ad
Exists in
master
and in
67 other branches
FIX: Fix problem unicode
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
invesalius/reader/dicom.py
| @@ -1926,7 +1926,7 @@ class Image(object): | @@ -1926,7 +1926,7 @@ class Image(object): | ||
| 1926 | self.number = parser.GetImageNumber() | 1926 | self.number = parser.GetImageNumber() |
| 1927 | self.spacing = spacing = parser.GetPixelSpacing() | 1927 | self.spacing = spacing = parser.GetPixelSpacing() |
| 1928 | self.orientation_label = parser.GetImageOrientationLabel() | 1928 | self.orientation_label = parser.GetImageOrientationLabel() |
| 1929 | - self.file = parser.filename.encode(utils.get_system_encoding()) | 1929 | + self.file = parser.filename |
| 1930 | self.time = parser.GetImageTime() | 1930 | self.time = parser.GetImageTime() |
| 1931 | self.type = parser.GetImageType() | 1931 | self.type = parser.GetImageType() |
| 1932 | self.size = (parser.GetDimensionX(), parser.GetDimensionY()) | 1932 | self.size = (parser.GetDimensionX(), parser.GetDimensionY()) |
invesalius/reader/dicom_reader.py
| @@ -104,8 +104,8 @@ class LoadDicom:#(threading.Thread): | @@ -104,8 +104,8 @@ class LoadDicom:#(threading.Thread): | ||
| 104 | # break | 104 | # break |
| 105 | 105 | ||
| 106 | reader = gdcm.Reader() | 106 | reader = gdcm.Reader() |
| 107 | - reader.SetFileName(self.filepath.encode(utils.get_system_encoding())) | ||
| 108 | - | 107 | + reader.SetFileName(self.filepath) |
| 108 | + | ||
| 109 | if (reader.Read()): | 109 | if (reader.Read()): |
| 110 | file = reader.GetFile() | 110 | file = reader.GetFile() |
| 111 | 111 | ||
| @@ -176,7 +176,7 @@ class LoadDicom:#(threading.Thread): | @@ -176,7 +176,7 @@ class LoadDicom:#(threading.Thread): | ||
| 176 | 176 | ||
| 177 | # -------------- To Create DICOM Thumbnail ----------- | 177 | # -------------- To Create DICOM Thumbnail ----------- |
| 178 | rvtk = vtkgdcm.vtkGDCMImageReader() | 178 | rvtk = vtkgdcm.vtkGDCMImageReader() |
| 179 | - rvtk.SetFileName(self.filepath.encode(utils.get_system_encoding())) | 179 | + rvtk.SetFileName(self.filepath) |
| 180 | rvtk.Update() | 180 | rvtk.Update() |
| 181 | 181 | ||
| 182 | try: | 182 | try: |
| @@ -210,7 +210,7 @@ class LoadDicom:#(threading.Thread): | @@ -210,7 +210,7 @@ class LoadDicom:#(threading.Thread): | ||
| 210 | write_png.Write() | 210 | write_png.Write() |
| 211 | 211 | ||
| 212 | # ---------- Refactory -------------------------------------- | 212 | # ---------- Refactory -------------------------------------- |
| 213 | - data_dict['invesalius'] = {'orientation_label' : GetImageOrientationLabel(self.filepath.encode(utils.get_system_encoding()))} | 213 | + data_dict['invesalius'] = {'orientation_label' : GetImageOrientationLabel(self.filepath)} |
| 214 | 214 | ||
| 215 | # ------------------------------------------------------------- | 215 | # ------------------------------------------------------------- |
| 216 | dict_file[self.filepath] = data_dict | 216 | dict_file[self.filepath] = data_dict |