Commit c800a6dbeeef9209806020c5dcde210c43d2761a
1 parent
535b0d25
Exists in
master
and in
68 other branches
FIX: saving background colour in the raycasting preset plist. Related to #110
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
invesalius/data/volume.py
| @@ -100,13 +100,13 @@ class Volume(): | @@ -100,13 +100,13 @@ class Volume(): | ||
| 100 | ps.Publisher().subscribe(self.OnEnableTool, | 100 | ps.Publisher().subscribe(self.OnEnableTool, |
| 101 | 'Enable raycasting tool') | 101 | 'Enable raycasting tool') |
| 102 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') | 102 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') |
| 103 | + ps.Publisher().subscribe(self.ChangeBackgroundColour, | ||
| 104 | + 'Change volume viewer background colour') | ||
| 103 | 105 | ||
| 104 | def OnCloseProject(self, pubsub_evt): | 106 | def OnCloseProject(self, pubsub_evt): |
| 105 | self.CloseProject() | 107 | self.CloseProject() |
| 106 | 108 | ||
| 107 | - | ||
| 108 | def CloseProject(self): | 109 | def CloseProject(self): |
| 109 | - | ||
| 110 | if self.plane: | 110 | if self.plane: |
| 111 | self.plane = None | 111 | self.plane = None |
| 112 | ps.Publisher().sendMessage('Remove surface actor from viewer', self.plane_actor) | 112 | ps.Publisher().sendMessage('Remove surface actor from viewer', self.plane_actor) |
| @@ -114,7 +114,6 @@ class Volume(): | @@ -114,7 +114,6 @@ class Volume(): | ||
| 114 | self.exist = None | 114 | self.exist = None |
| 115 | ps.Publisher().sendMessage('Remove surface actor from viewer', self.volume) | 115 | ps.Publisher().sendMessage('Remove surface actor from viewer', self.volume) |
| 116 | 116 | ||
| 117 | - | ||
| 118 | def OnLoadVolume(self, pubsub_evt): | 117 | def OnLoadVolume(self, pubsub_evt): |
| 119 | label = pubsub_evt.data | 118 | label = pubsub_evt.data |
| 120 | #self.LoadConfig(label) | 119 | #self.LoadConfig(label) |
| @@ -369,6 +368,11 @@ class Volume(): | @@ -369,6 +368,11 @@ class Volume(): | ||
| 369 | self.config['backgroundColorBlueComponent']) | 368 | self.config['backgroundColorBlueComponent']) |
| 370 | return colour | 369 | return colour |
| 371 | 370 | ||
| 371 | + def ChangeBackgroundColour(self, pubsub_evt): | ||
| 372 | + self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255 | ||
| 373 | + self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255 | ||
| 374 | + self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255 | ||
| 375 | + | ||
| 372 | def BuildTable(): | 376 | def BuildTable(): |
| 373 | curve_table = p['16bitClutCurves'] | 377 | curve_table = p['16bitClutCurves'] |
| 374 | color_background = (p['backgroundColorRedComponent'], | 378 | color_background = (p['backgroundColorRedComponent'], |