Skip to content
Snippets Groups Projects
Commit c67aaf5b authored by s224389's avatar s224389
Browse files

Bugfixed contrast slider

parent 0bf5cc3c
Branches
Tags
No related merge requests found
......@@ -53,7 +53,7 @@ class AdvancedSettingsWidget(QWidget):
controls_layout.addWidget(self._lab_contrast, 2, 0)
self.contrast_slider = QSlider(Qt.Horizontal)
self.contrast_slider.setRange(1, 40)
self.contrast_slider.setValue(1) # i.e. 0.01
self.contrast_slider.setValue(10) # i.e. 0.001
self.contrast_slider.setSingleStep(1)
self.contrast_slider.valueChanged.connect(self._on_contrast_slider)
controls_layout.addWidget(self.contrast_slider, 2, 1)
......@@ -138,8 +138,8 @@ class AdvancedSettingsWidget(QWidget):
"""
Called when the contrast slider is moved.
"""
clip_limit = value / 500.0
self._lab_contrast.setText(f"Contrast ({clip_limit:.2f})")
clip_limit = value / 1000
self._lab_contrast.setText(f"Contrast ({clip_limit:.3f})")
self._main_window.update_contrast(clip_limit)
def update_displays(self, contrasted_img_np: np.ndarray, cost_img_np: np.ndarray):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment