Commit 9d0c5a70c5a49023a72e9749603aad98c4a583d0
1 parent
40abd5b9
Exists in
master
and in
2 other branches
Strip whitespaces
Showing
1 changed file
with
13 additions
and
13 deletions
Show diff stats
invesalius/data/surface.py
@@ -84,7 +84,7 @@ class Surface(): | @@ -84,7 +84,7 @@ class Surface(): | ||
84 | #plist_filepath = os.path.join(dir_temp, filename + '.plist') | 84 | #plist_filepath = os.path.join(dir_temp, filename + '.plist') |
85 | temp_plist = tempfile.mktemp() | 85 | temp_plist = tempfile.mktemp() |
86 | plistlib.writePlist(surface, temp_plist) | 86 | plistlib.writePlist(surface, temp_plist) |
87 | - | 87 | + |
88 | filelist[temp_plist] = plist_filename | 88 | filelist[temp_plist] = plist_filename |
89 | 89 | ||
90 | return plist_filename | 90 | return plist_filename |
@@ -145,7 +145,7 @@ class SurfaceManager(): | @@ -145,7 +145,7 @@ class SurfaceManager(): | ||
145 | Publisher.subscribe(self.OnDuplicate, "Duplicate surfaces") | 145 | Publisher.subscribe(self.OnDuplicate, "Duplicate surfaces") |
146 | Publisher.subscribe(self.OnRemove,"Remove surfaces") | 146 | Publisher.subscribe(self.OnRemove,"Remove surfaces") |
147 | Publisher.subscribe(self.UpdateSurfaceInterpolation, 'Update Surface Interpolation') | 147 | Publisher.subscribe(self.UpdateSurfaceInterpolation, 'Update Surface Interpolation') |
148 | - | 148 | + |
149 | def OnDuplicate(self, pubsub_evt): | 149 | def OnDuplicate(self, pubsub_evt): |
150 | selected_items = pubsub_evt.data | 150 | selected_items = pubsub_evt.data |
151 | proj = prj.Project() | 151 | proj = prj.Project() |
@@ -155,7 +155,7 @@ class SurfaceManager(): | @@ -155,7 +155,7 @@ class SurfaceManager(): | ||
155 | # compute copy name | 155 | # compute copy name |
156 | name = original_surface.name | 156 | name = original_surface.name |
157 | names_list = [surface_dict[i].name for i in surface_dict.keys()] | 157 | names_list = [surface_dict[i].name for i in surface_dict.keys()] |
158 | - new_name = utl.next_copy_name(name, names_list) | 158 | + new_name = utl.next_copy_name(name, names_list) |
159 | # create new mask | 159 | # create new mask |
160 | self.CreateSurfaceFromPolydata(polydata = original_surface.polydata, | 160 | self.CreateSurfaceFromPolydata(polydata = original_surface.polydata, |
161 | overwrite = False, | 161 | overwrite = False, |
@@ -221,7 +221,7 @@ class SurfaceManager(): | @@ -221,7 +221,7 @@ class SurfaceManager(): | ||
221 | index_list.append(index) | 221 | index_list.append(index) |
222 | #self.ShowActor(index, True) | 222 | #self.ShowActor(index, True) |
223 | 223 | ||
224 | - Publisher.sendMessage('Show multiple surfaces', (index_list, True)) | 224 | + Publisher.sendMessage('Show multiple surfaces', (index_list, True)) |
225 | 225 | ||
226 | def OnLargestSurface(self, pubsub_evt): | 226 | def OnLargestSurface(self, pubsub_evt): |
227 | """ | 227 | """ |
@@ -388,10 +388,10 @@ class SurfaceManager(): | @@ -388,10 +388,10 @@ class SurfaceManager(): | ||
388 | matrix = slice_.matrix | 388 | matrix = slice_.matrix |
389 | filename_img = slice_.matrix_filename | 389 | filename_img = slice_.matrix_filename |
390 | spacing = slice_.spacing | 390 | spacing = slice_.spacing |
391 | - | 391 | + |
392 | algorithm = surface_parameters['method']['algorithm'] | 392 | algorithm = surface_parameters['method']['algorithm'] |
393 | options = surface_parameters['method']['options'] | 393 | options = surface_parameters['method']['options'] |
394 | - | 394 | + |
395 | surface_name = surface_parameters['options']['name'] | 395 | surface_name = surface_parameters['options']['name'] |
396 | quality = surface_parameters['options']['quality'] | 396 | quality = surface_parameters['options']['quality'] |
397 | fill_holes = surface_parameters['options']['fill'] | 397 | fill_holes = surface_parameters['options']['fill'] |
@@ -425,7 +425,7 @@ class SurfaceManager(): | @@ -425,7 +425,7 @@ class SurfaceManager(): | ||
425 | pipeline_size += 1 | 425 | pipeline_size += 1 |
426 | if keep_largest: | 426 | if keep_largest: |
427 | pipeline_size += 1 | 427 | pipeline_size += 1 |
428 | - | 428 | + |
429 | ## Update progress value in GUI | 429 | ## Update progress value in GUI |
430 | UpdateProgress = vu.ShowProgress(pipeline_size) | 430 | UpdateProgress = vu.ShowProgress(pipeline_size) |
431 | UpdateProgress(0, _("Creating 3D surface...")) | 431 | UpdateProgress(0, _("Creating 3D surface...")) |
@@ -438,7 +438,7 @@ class SurfaceManager(): | @@ -438,7 +438,7 @@ class SurfaceManager(): | ||
438 | flip_image = True | 438 | flip_image = True |
439 | 439 | ||
440 | n_processors = multiprocessing.cpu_count() | 440 | n_processors = multiprocessing.cpu_count() |
441 | - | 441 | + |
442 | pipe_in, pipe_out = multiprocessing.Pipe() | 442 | pipe_in, pipe_out = multiprocessing.Pipe() |
443 | o_piece = 1 | 443 | o_piece = 1 |
444 | piece_size = 2000 | 444 | piece_size = 2000 |
@@ -455,7 +455,7 @@ class SurfaceManager(): | @@ -455,7 +455,7 @@ class SurfaceManager(): | ||
455 | mask.temp_file, | 455 | mask.temp_file, |
456 | mask.matrix.shape, | 456 | mask.matrix.shape, |
457 | mask.matrix.dtype, | 457 | mask.matrix.dtype, |
458 | - spacing, | 458 | + spacing, |
459 | mode, min_value, max_value, | 459 | mode, min_value, max_value, |
460 | decimate_reduction, | 460 | decimate_reduction, |
461 | smooth_relaxation_factor, | 461 | smooth_relaxation_factor, |
@@ -642,7 +642,7 @@ class SurfaceManager(): | @@ -642,7 +642,7 @@ class SurfaceManager(): | ||
642 | polydata.SetSource(None) | 642 | polydata.SetSource(None) |
643 | polydata.DebugOn() | 643 | polydata.DebugOn() |
644 | del filled_polydata | 644 | del filled_polydata |
645 | - | 645 | + |
646 | normals = vtk.vtkPolyDataNormals() | 646 | normals = vtk.vtkPolyDataNormals() |
647 | normals.ReleaseDataFlagOn() | 647 | normals.ReleaseDataFlagOn() |
648 | normals_ref = weakref.ref(normals) | 648 | normals_ref = weakref.ref(normals) |
@@ -741,19 +741,19 @@ class SurfaceManager(): | @@ -741,19 +741,19 @@ class SurfaceManager(): | ||
741 | (surface.index, surface.name, | 741 | (surface.index, surface.name, |
742 | surface.colour, surface.volume, | 742 | surface.colour, surface.volume, |
743 | surface.transparency)) | 743 | surface.transparency)) |
744 | - | 744 | + |
745 | #When you finalize the progress. The bar is cleaned. | 745 | #When you finalize the progress. The bar is cleaned. |
746 | UpdateProgress = vu.ShowProgress(1) | 746 | UpdateProgress = vu.ShowProgress(1) |
747 | UpdateProgress(0, _("Ready")) | 747 | UpdateProgress(0, _("Ready")) |
748 | Publisher.sendMessage('Update status text in GUI', _("Ready")) | 748 | Publisher.sendMessage('Update status text in GUI', _("Ready")) |
749 | - | 749 | + |
750 | Publisher.sendMessage('End busy cursor') | 750 | Publisher.sendMessage('End busy cursor') |
751 | del actor | 751 | del actor |
752 | 752 | ||
753 | def UpdateSurfaceInterpolation(self, pub_evt): | 753 | def UpdateSurfaceInterpolation(self, pub_evt): |
754 | interpolation = int(ses.Session().surface_interpolation) | 754 | interpolation = int(ses.Session().surface_interpolation) |
755 | key_actors = self.actors_dict.keys() | 755 | key_actors = self.actors_dict.keys() |
756 | - | 756 | + |
757 | for key in self.actors_dict: | 757 | for key in self.actors_dict: |
758 | self.actors_dict[key].GetProperty().SetInterpolation(interpolation) | 758 | self.actors_dict[key].GetProperty().SetInterpolation(interpolation) |
759 | Publisher.sendMessage('Render volume viewer') | 759 | Publisher.sendMessage('Render volume viewer') |