Commit 3a497a131e6282f34aaaf45275be0499eaf4649e
1 parent
f01fc134
Exists in
inv3.0.1
Setting image buffer
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -540,7 +540,6 @@ class Slice(object): |
540 | 540 | mask = None |
541 | 541 | |
542 | 542 | self.buffer_slices[orientation].index = slice_number |
543 | - self.buffer_slices[orientation].image = n_image | |
544 | 543 | self.buffer_slices[orientation].mask = n_mask |
545 | 544 | self.buffer_slices[orientation].vtk_image = image |
546 | 545 | self.buffer_slices[orientation].vtk_mask = mask |
... | ... | @@ -559,6 +558,7 @@ class Slice(object): |
559 | 558 | if self.buffer_slices[orientation].index == slice_number \ |
560 | 559 | and self.buffer_slices[orientation].image is not None: |
561 | 560 | n_image = self.buffer_slices[orientation].image |
561 | + # print "BUFFER IMAGE" | |
562 | 562 | else: |
563 | 563 | |
564 | 564 | if orientation == 'AXIAL': |
... | ... | @@ -699,6 +699,8 @@ class Slice(object): |
699 | 699 | self.window_level, 2, n_image) |
700 | 700 | else: |
701 | 701 | n_image = numpy.array(self.matrix[..., ..., slice_number]) |
702 | + | |
703 | + self.buffer_slices[orientation].image = n_image | |
702 | 704 | return n_image |
703 | 705 | |
704 | 706 | def get_mask_slice(self, orientation, slice_number): |
... | ... | @@ -816,6 +818,7 @@ class Slice(object): |
816 | 818 | self.current_mask.matrix[n+1, 1:, 1:] = m |
817 | 819 | else: |
818 | 820 | slice_ = self.buffer_slices[orientation].image |
821 | + print ">>>", slice_, index | |
819 | 822 | self.buffer_slices[orientation].mask = (255 * ((slice_ >= thresh_min) & (slice_ <= thresh_max))).astype('uint8') |
820 | 823 | |
821 | 824 | # Update viewer | ... | ... |