Commit d8293fcf9ddf99aa14764542f70a846de33cb9f0

Authored by tfmoraes
1 parent 77d45186

FIX: Window width & level working in 8 bit raycasting preset

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
invesalius/data/volume.py
@@ -152,6 +152,7 @@ class Volume(): @@ -152,6 +152,7 @@ class Volume():
152 152
153 def OnSetRelativeWindowLevel(self, pubsub_evt): 153 def OnSetRelativeWindowLevel(self, pubsub_evt):
154 diff_ww, diff_wl = pubsub_evt.data 154 diff_ww, diff_wl = pubsub_evt.data
  155 + print diff_ww
155 ww = self.ww + diff_ww 156 ww = self.ww + diff_ww
156 wl = self.wl + diff_wl 157 wl = self.wl + diff_wl
157 ps.Publisher().sendMessage('Set volume window and level text', 158 ps.Publisher().sendMessage('Set volume window and level text',
@@ -294,6 +295,9 @@ class Volume(): @@ -294,6 +295,9 @@ class Volume():
294 l1 = wl - ww/2.0 295 l1 = wl - ww/2.0
295 l2 = wl + ww/2.0 296 l2 = wl + ww/2.0
296 297
  298 + self.ww = ww
  299 + self.wl = wl
  300 +
297 opacity_transfer_func.RemoveAllPoints() 301 opacity_transfer_func.RemoveAllPoints()
298 opacity_transfer_func.AddSegment(0, 0, 2**16-1, 0) 302 opacity_transfer_func.AddSegment(0, 0, 2**16-1, 0)
299 303
@@ -349,7 +353,9 @@ class Volume(): @@ -349,7 +353,9 @@ class Volume():
349 self.volume_properties.SetSpecularPower(shading['specularPower']) 353 self.volume_properties.SetSpecularPower(shading['specularPower'])
350 354
351 def ApplyConvolution(self, imagedata): 355 def ApplyConvolution(self, imagedata):
  356 + number_filters = len(self.config['convolutionFilters'])
352 for filter in self.config['convolutionFilters']: 357 for filter in self.config['convolutionFilters']:
  358 + print "convolving", filter
353 convolve = vtk.vtkImageConvolve() 359 convolve = vtk.vtkImageConvolve()
354 convolve.SetInput(imagedata) 360 convolve.SetInput(imagedata)
355 convolve.SetKernel5x5([i/60.0 for i in Kernels[filter]]) 361 convolve.SetKernel5x5([i/60.0 for i in Kernels[filter]])