Commit 3a497a131e6282f34aaaf45275be0499eaf4649e

Authored by Thiago Franco de Moraes
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,7 +540,6 @@ class Slice(object):
540 mask = None 540 mask = None
541 541
542 self.buffer_slices[orientation].index = slice_number 542 self.buffer_slices[orientation].index = slice_number
543 - self.buffer_slices[orientation].image = n_image  
544 self.buffer_slices[orientation].mask = n_mask 543 self.buffer_slices[orientation].mask = n_mask
545 self.buffer_slices[orientation].vtk_image = image 544 self.buffer_slices[orientation].vtk_image = image
546 self.buffer_slices[orientation].vtk_mask = mask 545 self.buffer_slices[orientation].vtk_mask = mask
@@ -559,6 +558,7 @@ class Slice(object): @@ -559,6 +558,7 @@ class Slice(object):
559 if self.buffer_slices[orientation].index == slice_number \ 558 if self.buffer_slices[orientation].index == slice_number \
560 and self.buffer_slices[orientation].image is not None: 559 and self.buffer_slices[orientation].image is not None:
561 n_image = self.buffer_slices[orientation].image 560 n_image = self.buffer_slices[orientation].image
  561 + # print "BUFFER IMAGE"
562 else: 562 else:
563 563
564 if orientation == 'AXIAL': 564 if orientation == 'AXIAL':
@@ -699,6 +699,8 @@ class Slice(object): @@ -699,6 +699,8 @@ class Slice(object):
699 self.window_level, 2, n_image) 699 self.window_level, 2, n_image)
700 else: 700 else:
701 n_image = numpy.array(self.matrix[..., ..., slice_number]) 701 n_image = numpy.array(self.matrix[..., ..., slice_number])
  702 +
  703 + self.buffer_slices[orientation].image = n_image
702 return n_image 704 return n_image
703 705
704 def get_mask_slice(self, orientation, slice_number): 706 def get_mask_slice(self, orientation, slice_number):
@@ -816,6 +818,7 @@ class Slice(object): @@ -816,6 +818,7 @@ class Slice(object):
816 self.current_mask.matrix[n+1, 1:, 1:] = m 818 self.current_mask.matrix[n+1, 1:, 1:] = m
817 else: 819 else:
818 slice_ = self.buffer_slices[orientation].image 820 slice_ = self.buffer_slices[orientation].image
  821 + print ">>>", slice_, index
819 self.buffer_slices[orientation].mask = (255 * ((slice_ >= thresh_min) & (slice_ <= thresh_max))).astype('uint8') 822 self.buffer_slices[orientation].mask = (255 * ((slice_ >= thresh_min) & (slice_ <= thresh_max))).astype('uint8')
820 823
821 # Update viewer 824 # Update viewer