Created
May 11, 2017 17:13
-
-
Save tfmoraes/020f5dd3ee65e71215f2c1f2e067e653 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py | |
index 8845085..79ba515 100644 | |
--- a/invesalius/data/surface.py | |
+++ b/invesalius/data/surface.py | |
@@ -774,16 +774,16 @@ class SurfaceManager(): | |
session = ses.Session() | |
session.ChangeProject() | |
- # The following lines have to be here, otherwise all volumes disappear | |
- measured_polydata = vtk.vtkMassProperties() | |
- # measured_polydata.ReleaseDataFlagOn() | |
- measured_polydata.SetInputData(to_measure) | |
- volume = float(measured_polydata.GetVolume()) | |
- area = float(measured_polydata.GetSurfaceArea()) | |
- surface.volume = volume | |
- surface.area = area | |
- self.last_surface_index = surface.index | |
- del measured_polydata | |
+ if wx.GetApp() is not None: | |
+ measured_polydata = vtk.vtkMassProperties() | |
+ # measured_polydata.ReleaseDataFlagOn() | |
+ measured_polydata.SetInputData(to_measure) | |
+ volume = float(measured_polydata.GetVolume()) | |
+ area = float(measured_polydata.GetSurfaceArea()) | |
+ surface.volume = volume | |
+ surface.area = area | |
+ self.last_surface_index = surface.index | |
+ del measured_polydata | |
del to_measure | |
Publisher.sendMessage('Load surface actor into viewer', actor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment