Commit 95859bf7fb9ff3bbd6c0ddd29f85b6d86decdccd
1 parent
64cb1ae1
Exists in
master
and in
68 other branches
FIX: The images inverteds related in ticket #74
Showing
1 changed file
with
1 additions
and
15 deletions
Show diff stats
invesalius/reader/dicom.py
... | ... | @@ -17,7 +17,6 @@ |
17 | 17 | # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais |
18 | 18 | # detalhes. |
19 | 19 | #--------------------------------------------------------------------- |
20 | -import tempfile | |
21 | 20 | import time |
22 | 21 | |
23 | 22 | import gdcm |
... | ... | @@ -1875,16 +1874,11 @@ class Image(object): |
1875 | 1874 | spacing[2] = round(spacing[2],2) |
1876 | 1875 | self.spacing = spacing |
1877 | 1876 | |
1878 | - def SetTempDir(self, directory): | |
1879 | - self.directory = directory | |
1880 | - | |
1881 | 1877 | @property |
1882 | 1878 | def jpeg_file(self): |
1883 | 1879 | if self._jpeg_file: |
1884 | 1880 | return self._jpeg_file |
1885 | 1881 | else: |
1886 | - self._jpeg_file = tempfile.mktemp(suffix='.jpeg', dir=self.directory) | |
1887 | - | |
1888 | 1882 | colorer = vtk.vtkImageMapToWindowLevelColors() |
1889 | 1883 | colorer.SetInput(self.imagedata) |
1890 | 1884 | colorer.SetWindow(float(self.window)) |
... | ... | @@ -1894,18 +1888,10 @@ class Image(object): |
1894 | 1888 | |
1895 | 1889 | width, height, z = colorer.GetOutput().GetDimensions() |
1896 | 1890 | |
1897 | - #jpeg_writer = vtk.vtkJPEGWriter() | |
1898 | - #jpeg_writer.SetInput(colorer.GetOutput()) | |
1899 | - ##jpeg_writer.SetFileName(self._jpeg_file) | |
1900 | - #jpeg_writer.WriteToMemoryOn() | |
1901 | - #jpeg_writer.Write() | |
1902 | - ##jpeg_writer.Write() | |
1903 | - | |
1904 | 1891 | r = colorer.GetOutput().GetPointData().GetScalars() |
1905 | 1892 | ni = numpy_support.vtk_to_numpy(r) |
1906 | 1893 | #ni = ni.reshape(width, height, 3) |
1907 | - print width, height, z,ni.shape | |
1908 | 1894 | img = wx.ImageFromBuffer(width, height, ni) |
1909 | - img.Rescale(70, 70) | |
1895 | + img = img.Rescale(70, 70).Mirror(False) | |
1910 | 1896 | self._jpeg_file = wx.BitmapFromImage(img) |
1911 | 1897 | return self._jpeg_file | ... | ... |