Commit abf558dfa1bc7b6d8085506d2349701f9ce1b6c5
Exists in
master
and in
3 other branches
Merge remote-tracking branch 'invesalius_master/master'
Showing
1 changed file
with
14 additions
and
9 deletions
Show diff stats
invesalius/gui/widgets/clut_imagedata.py
@@ -53,7 +53,7 @@ class CLUTImageDataWidget(wx.Panel): | @@ -53,7 +53,7 @@ class CLUTImageDataWidget(wx.Panel): | ||
53 | super(CLUTImageDataWidget, self).__init__(parent, id) | 53 | super(CLUTImageDataWidget, self).__init__(parent, id) |
54 | 54 | ||
55 | self.SetFocusIgnoringChildren() | 55 | self.SetFocusIgnoringChildren() |
56 | - self.SetMinSize((300, 200)) | 56 | + self.SetMinSize((400, 200)) |
57 | 57 | ||
58 | self.histogram = histogram | 58 | self.histogram = histogram |
59 | 59 | ||
@@ -82,14 +82,6 @@ class CLUTImageDataWidget(wx.Panel): | @@ -82,14 +82,6 @@ class CLUTImageDataWidget(wx.Panel): | ||
82 | self.ww = nn.value - n0.value | 82 | self.ww = nn.value - n0.value |
83 | self.wl = (nn.value + n0.value) / 2.0 | 83 | self.wl = (nn.value + n0.value) / 2.0 |
84 | 84 | ||
85 | - | ||
86 | - w, h = self.GetVirtualSize() | ||
87 | - init = self.pixel_to_hounsfield(-1) | ||
88 | - end = self.pixel_to_hounsfield(w + 1) | ||
89 | - self._init = init | ||
90 | - self._end = end | ||
91 | - self._range = 0.05 * (end - init) | ||
92 | - | ||
93 | self._s_init = init | 85 | self._s_init = init |
94 | self._s_end = end | 86 | self._s_end = end |
95 | 87 | ||
@@ -179,6 +171,19 @@ class CLUTImageDataWidget(wx.Panel): | @@ -179,6 +171,19 @@ class CLUTImageDataWidget(wx.Panel): | ||
179 | pass | 171 | pass |
180 | 172 | ||
181 | def OnSize(self, evt): | 173 | def OnSize(self, evt): |
174 | + if self.first_show: | ||
175 | + w, h = self.GetVirtualSize() | ||
176 | + init = self.pixel_to_hounsfield(-RADIUS) | ||
177 | + end = self.pixel_to_hounsfield(w + RADIUS) | ||
178 | + self._init = init | ||
179 | + self._end = end | ||
180 | + self._range = 0.05 * (end - init) | ||
181 | + | ||
182 | + self._s_init = init | ||
183 | + self._s_end = end | ||
184 | + | ||
185 | + self.first_show = False | ||
186 | + | ||
182 | self._build_drawn_hist() | 187 | self._build_drawn_hist() |
183 | self.Refresh() | 188 | self.Refresh() |
184 | evt.Skip() | 189 | evt.Skip() |