Commit 0035de9b45ce6357c662043fd3d4d64c74962d4a
1 parent
5199899e
Exists in
master
and in
5 other branches
STYLE: Some style changes in code
Showing
1 changed file
with
9 additions
and
7 deletions
Show diff stats
invesalius/gui/widgets/clut_raycasting.py
@@ -42,6 +42,7 @@ RADIUS = 5 | @@ -42,6 +42,7 @@ RADIUS = 5 | ||
42 | SELECTION_SIZE = 10 | 42 | SELECTION_SIZE = 10 |
43 | TOOLBAR_SIZE = 30 | 43 | TOOLBAR_SIZE = 30 |
44 | TOOLBAR_COLOUR = (25 , 25, 25) | 44 | TOOLBAR_COLOUR = (25 , 25, 25) |
45 | +RANGE = 10 | ||
45 | PADDING = 2 | 46 | PADDING = 2 |
46 | 47 | ||
47 | class Node(object): | 48 | class Node(object): |
@@ -277,8 +278,8 @@ class CLUTRaycastingWidget(wx.Panel): | @@ -277,8 +278,8 @@ class CLUTRaycastingWidget(wx.Panel): | ||
277 | doesn't change values in preset, only to visualization. | 278 | doesn't change values in preset, only to visualization. |
278 | """ | 279 | """ |
279 | direction = evt.GetWheelRotation() / evt.GetWheelDelta() | 280 | direction = evt.GetWheelRotation() / evt.GetWheelDelta() |
280 | - init = self.init - 10 * direction | ||
281 | - end = self.end + 10 * direction | 281 | + init = self.init - RANGE * direction |
282 | + end = self.end + RANGE * direction | ||
282 | print direction, init, end | 283 | print direction, init, end |
283 | self.SetRange((init, end)) | 284 | self.SetRange((init, end)) |
284 | self.Refresh() | 285 | self.Refresh() |
@@ -434,14 +435,15 @@ class CLUTRaycastingWidget(wx.Panel): | @@ -434,14 +435,15 @@ class CLUTRaycastingWidget(wx.Panel): | ||
434 | node.x += (x - self.previous_wl) | 435 | node.x += (x - self.previous_wl) |
435 | node.graylevel = self.PixelToHounsfield(node.x) | 436 | node.graylevel = self.PixelToHounsfield(node.x) |
436 | 437 | ||
438 | + self.previous_wl = x | ||
439 | + self.to_draw_points = True | ||
440 | + self.Refresh() | ||
441 | + | ||
437 | # The window level has been changed, raising a event! | 442 | # The window level has been changed, raising a event! |
438 | evt = CLUTEvent(myEVT_CLUT_CURVE_WL_CHANGE, self.GetId(), | 443 | evt = CLUTEvent(myEVT_CLUT_CURVE_WL_CHANGE, self.GetId(), |
439 | self.curve_dragged) | 444 | self.curve_dragged) |
440 | self.GetEventHandler().ProcessEvent(evt) | 445 | self.GetEventHandler().ProcessEvent(evt) |
441 | 446 | ||
442 | - self.previous_wl = x | ||
443 | - self.Refresh() | ||
444 | - | ||
445 | def RemovePoint(self, i, j): | 447 | def RemovePoint(self, i, j): |
446 | """ | 448 | """ |
447 | The point the point in the given i,j index | 449 | The point the point in the given i,j index |
@@ -530,8 +532,8 @@ class CLUTRaycastingWidget(wx.Panel): | @@ -530,8 +532,8 @@ class CLUTRaycastingWidget(wx.Panel): | ||
530 | font = ctx.CreateFont(font, TEXT_COLOUR) | 532 | font = ctx.CreateFont(font, TEXT_COLOUR) |
531 | ctx.SetFont(font) | 533 | ctx.SetFont(font) |
532 | 534 | ||
533 | - text1 = "Value: %6d" % value | ||
534 | - text2 = "Alpha: %.3f" % alpha | 535 | + text1 = _("Value: %-6d" % value) |
536 | + text2 = _("Alpha: %-.3f" % alpha) | ||
535 | 537 | ||
536 | if ctx.GetTextExtent(text1)[0] > ctx.GetTextExtent(text2)[0]: | 538 | if ctx.GetTextExtent(text1)[0] > ctx.GetTextExtent(text2)[0]: |
537 | wt, ht = ctx.GetTextExtent(text1) | 539 | wt, ht = ctx.GetTextExtent(text1) |