Commit b14ca6cf6669832c018d2bbe7bb5c61988d2eabf
1 parent
5ba543ca
Exists in
master
and in
67 other branches
Some tests with surface creation
Showing
2 changed files
with
5 additions
and
7 deletions
Show diff stats
invesalius/data/slice_.py
| ... | ... | @@ -583,7 +583,7 @@ class Slice(object): |
| 583 | 583 | |
| 584 | 584 | mask.matrix.flush() |
| 585 | 585 | |
| 586 | - ps.Publisher().sendMessage('Create surface', (mask, self.spacing)) | |
| 586 | + ps.Publisher().sendMessage('Create surface', (self.matrix, self.matrix_filename, mask, self.spacing)) | |
| 587 | 587 | |
| 588 | 588 | def GetOutput(self): |
| 589 | 589 | return self.blend_filter.GetOutput() | ... | ... |
invesalius/data/surface.py
| ... | ... | @@ -375,8 +375,7 @@ class SurfaceManager(): |
| 375 | 375 | """ |
| 376 | 376 | Create surface actor, save into project and send it to viewer. |
| 377 | 377 | """ |
| 378 | - surface_data = pubsub_evt.data | |
| 379 | - mask, spacing = pubsub_evt.data | |
| 378 | + matrix, filename_img, mask, spacing = pubsub_evt.data | |
| 380 | 379 | min_value, max_value = mask.threshold_range |
| 381 | 380 | fill_holes = True |
| 382 | 381 | |
| ... | ... | @@ -439,7 +438,6 @@ class SurfaceManager(): |
| 439 | 438 | |
| 440 | 439 | language = ses.Session().language |
| 441 | 440 | |
| 442 | - filename_img = mask.temp_file | |
| 443 | 441 | overwrite = 0 |
| 444 | 442 | |
| 445 | 443 | if (prj.Project().original_orientation == const.CORONAL): |
| ... | ... | @@ -453,8 +451,8 @@ class SurfaceManager(): |
| 453 | 451 | o_piece = 1 |
| 454 | 452 | piece_size = 40 |
| 455 | 453 | |
| 456 | - n_pieces = int(round(mask.matrix.shape[0] / piece_size + 0.5, 0)) | |
| 457 | - print "n_pieces", n_pieces, mask.matrix.shape | |
| 454 | + n_pieces = int(round(matrix.shape[0] / piece_size + 0.5, 0)) | |
| 455 | + print "n_pieces", n_pieces, matrix.shape | |
| 458 | 456 | |
| 459 | 457 | q_in = multiprocessing.Queue() |
| 460 | 458 | q_out = multiprocessing.Queue() |
| ... | ... | @@ -462,7 +460,7 @@ class SurfaceManager(): |
| 462 | 460 | p = [] |
| 463 | 461 | for i in xrange(n_processors): |
| 464 | 462 | sp = surface_process.SurfaceProcess(pipe_in, filename_img, |
| 465 | - mask.matrix.shape, mask.matrix.dtype, spacing, | |
| 463 | + matrix.shape, matrix.dtype, spacing, | |
| 466 | 464 | mode, min_value, max_value, |
| 467 | 465 | decimate_reduction, smooth_relaxation_factor, |
| 468 | 466 | smooth_iterations, language, fill_holes, keep_largest, | ... | ... |