Commit 0713ec508ce37b1cfae9a929f4db66048a6e297b
1 parent
0de35379
Exists in
master
and in
68 other branches
ENH: Set button colour related to volume viewer background colour FIX #62
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
invesalius/data/volume.py
@@ -125,6 +125,7 @@ class Volume(): | @@ -125,6 +125,7 @@ class Volume(): | ||
125 | 125 | ||
126 | def OnUpdatePreset(self, pubsub_evt): | 126 | def OnUpdatePreset(self, pubsub_evt): |
127 | self.__load_preset_config() | 127 | self.__load_preset_config() |
128 | + | ||
128 | if self.config: | 129 | if self.config: |
129 | if self.exist: | 130 | if self.exist: |
130 | self.__load_preset() | 131 | self.__load_preset() |
@@ -134,7 +135,11 @@ class Volume(): | @@ -134,7 +135,11 @@ class Volume(): | ||
134 | self.LoadVolume() | 135 | self.LoadVolume() |
135 | self.CalculateHistogram() | 136 | self.CalculateHistogram() |
136 | self.exist = 1 | 137 | self.exist = 1 |
137 | - | 138 | + |
139 | + colour = self.GetBackgroundColour() | ||
140 | + ps.Publisher.sendMessage('Change volume viewer background colour', colour) | ||
141 | + ps.Publisher.sendMessage('Change volume viewer gui colour', colour) | ||
142 | + | ||
138 | def __load_preset_config(self): | 143 | def __load_preset_config(self): |
139 | self.config = prj.Project().raycasting_preset | 144 | self.config = prj.Project().raycasting_preset |
140 | 145 | ||
@@ -159,10 +164,8 @@ class Volume(): | @@ -159,10 +164,8 @@ class Volume(): | ||
159 | # Update other information | 164 | # Update other information |
160 | self.SetShading() | 165 | self.SetShading() |
161 | self.SetTypeRaycasting() | 166 | self.SetTypeRaycasting() |
162 | - colour = self.GetBackgroundColour() | ||
163 | - ps.Publisher.sendMessage('Change volume viewer background colour', colour) | ||
164 | - ps.Publisher.sendMessage('Change volume viewer gui colour', colour) | ||
165 | 167 | ||
168 | + | ||
166 | def OnSetCurve(self, pubsub_evt): | 169 | def OnSetCurve(self, pubsub_evt): |
167 | self.curve = pubsub_evt.data | 170 | self.curve = pubsub_evt.data |
168 | self.CalculateWWWL() | 171 | self.CalculateWWWL() |