Commit 828f2a219e0bc1af8207cea0b131d22342f5f6db

Authored by Thiago Franco de Moraes
1 parent ef638c1f

Coronal stacking was incorrect

invesalius/data/imagedata_utils.py
@@ -574,7 +574,7 @@ def dcm2memmap(files, slice_size, orientation, resolution_percentage): @@ -574,7 +574,7 @@ def dcm2memmap(files, slice_size, orientation, resolution_percentage):
574 array = numpy_support.vtk_to_numpy(image.GetPointData().GetScalars()) 574 array = numpy_support.vtk_to_numpy(image.GetPointData().GetScalars())
575 if orientation == 'CORONAL': 575 if orientation == 'CORONAL':
576 array.shape = matrix.shape[0], matrix.shape[2] 576 array.shape = matrix.shape[0], matrix.shape[2]
577 - matrix[:, n, :] = array 577 + matrix[:, shape[1] - n - 1, :] = array
578 elif orientation == 'SAGITTAL': 578 elif orientation == 'SAGITTAL':
579 array.shape = matrix.shape[0], matrix.shape[1] 579 array.shape = matrix.shape[0], matrix.shape[1]
580 # TODO: Verify if it's necessary to add the slices swapped only in 580 # TODO: Verify if it's necessary to add the slices swapped only in
@@ -643,4 +643,4 @@ def imgnormalize(data, srange=(0, 255)): @@ -643,4 +643,4 @@ def imgnormalize(data, srange=(0, 255)):
643 datan = numpy.reshape(datan, dataf.shape) 643 datan = numpy.reshape(datan, dataf.shape)
644 datan = datan.astype(numpy.int16) 644 datan = datan.astype(numpy.int16)
645 645
646 - return datan  
647 \ No newline at end of file 646 \ No newline at end of file
  647 + return datan
invesalius/data/viewer_slice.py
@@ -1534,8 +1534,8 @@ class Viewer(wx.Panel): @@ -1534,8 +1534,8 @@ class Viewer(wx.Panel):
1534 orig_orien = proj.original_orientation 1534 orig_orien = proj.original_orientation
1535 1535
1536 self.cam.SetFocalPoint(0, 0, 0) 1536 self.cam.SetFocalPoint(0, 0, 0)
1537 - self.cam.SetViewUp(const.SLICE_POSITION[orig_orien][0][self.orientation])  
1538 - self.cam.SetPosition(const.SLICE_POSITION[orig_orien][1][self.orientation]) 1537 + self.cam.SetViewUp(const.SLICE_POSITION[const.AXIAL][0][self.orientation])
  1538 + self.cam.SetPosition(const.SLICE_POSITION[const.AXIAL][1][self.orientation])
1539 #self.cam.ComputeViewPlaneNormal() 1539 #self.cam.ComputeViewPlaneNormal()
1540 #self.cam.OrthogonalizeViewUp() 1540 #self.cam.OrthogonalizeViewUp()
1541 self.cam.ParallelProjectionOn() 1541 self.cam.ParallelProjectionOn()