Commit 12b38b74ebb1b0708cf5eb352dc13714a419311f

Authored by r0xen
Committed by Thiago Franco de Moraes
1 parent 3e4ed11d
Exists in master

Fix xyspacing in invesalius/control.py (#150)

Running Invesalius via CLI to export DICOM/Bitmap to 3D (STL, OBJ et all) generated stretched 3Ds while in GUI everything was fine. The bug was present in OpenBitmapFiles() and OpenDicomGroup(), I'll refer to the latter method: after calculating resolution_percentage (line 800) when in GUI xyspacing was adjusted accordingly (line 814) but, since via CLI the if condition (line 802) it's not met, this caused discrepancies in the 3d dimensions. 

This subtle bug was probably caused due to an error in indentation, moving line 814 outside of line 802 if, fixed the issue in my scenarios and should be sufficient.
Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
invesalius/control.py
... ... @@ -712,7 +712,7 @@ class Controller():
712 712 else:
713 713 return
714 714  
715   - xyspacing = xyspacing[0] / resolution_percentage, xyspacing[1] / resolution_percentage
  715 + xyspacing = xyspacing[0] / resolution_percentage, xyspacing[1] / resolution_percentage
716 716  
717 717  
718 718  
... ... @@ -811,7 +811,7 @@ class Controller():
811 811 else:
812 812 return
813 813  
814   - xyspacing = xyspacing[0] / resolution_percentage, xyspacing[1] / resolution_percentage
  814 + xyspacing = xyspacing[0] / resolution_percentage, xyspacing[1] / resolution_percentage
815 815  
816 816 self.matrix, scalar_range, self.filename = image_utils.dcm2memmap(filelist, size,
817 817 orientation, resolution_percentage)
... ...