diff --git a/picamera_coverage.zip b/picamera_coverage.zip index 4a6c1856..09438bb3 100644 Binary files a/picamera_coverage.zip and b/picamera_coverage.zip differ diff --git a/src/openflexure_microscope_server/things/background_detect.py b/src/openflexure_microscope_server/things/background_detect.py index 19ab6874..8039605f 100644 --- a/src/openflexure_microscope_server/things/background_detect.py +++ b/src/openflexure_microscope_server/things/background_detect.py @@ -99,14 +99,14 @@ class ColourChannelDetectLUV(BackgroundDetectAlgorithm): # provided there. min_stds = [0.5, 0.3, 0.5] - channel_tolerance: float = lt.setting(default=7.0) + channel_tolerance: float = lt.setting(default=7.0, ge=0) """Channel Tolerance The number of standard deviations a pixel value must be from the background mean to be considered sample. """ - min_sample_coverage: float = lt.setting(default=25) + min_sample_coverage: float = lt.setting(default=25, ge=0, le=100) """Sample Coverage Required (%) The minimum percentage of the image that needs to be identified as sample for the @@ -223,14 +223,14 @@ class ChannelDeviationLUV(BackgroundDetectAlgorithm): # LUV colour space not converting to the CIELUV numbers) min_stds = [0.5, 0.3, 0.5] - channel_tolerance: float = lt.setting(default=7.0) + channel_tolerance: float = lt.setting(default=7.0, ge=0) """Channel Tolerance The number of standard deviations a pixel value must be from the background mean to be considered sample. """ - min_sample_coverage: float = lt.setting(default=25) + min_sample_coverage: float = lt.setting(default=25, ge=0, le=100) """Sample Coverage Required (%) The minimum percentage of the image that needs to be identified as sample for the diff --git a/src/openflexure_microscope_server/things/camera/__init__.py b/src/openflexure_microscope_server/things/camera/__init__.py index dd4f6cdd..6b9bc323 100644 --- a/src/openflexure_microscope_server/things/camera/__init__.py +++ b/src/openflexure_microscope_server/things/camera/__init__.py @@ -274,7 +274,7 @@ class BaseCamera(lt.Thing): "CameraThings must define their own capture_array method" ) - downsampled_array_factor: int = lt.property(default=2) + downsampled_array_factor: int = lt.property(default=2, ge=1) """The downsampling factor when calling capture_downsampled_array.""" @lt.action @@ -565,7 +565,7 @@ class BaseCamera(lt.Thing): except Exception as e: raise IOError(f"An error occurred while saving {jpeg_path}") from e - settling_time: float = lt.setting(default=0.2) + settling_time: float = lt.setting(default=0.2, ge=0) """The settling time when calling the ``settle()`` method.""" @lt.action diff --git a/src/openflexure_microscope_server/things/camera/simulation.py b/src/openflexure_microscope_server/things/camera/simulation.py index 31e3979e..d75c36e5 100644 --- a/src/openflexure_microscope_server/things/camera/simulation.py +++ b/src/openflexure_microscope_server/things/camera/simulation.py @@ -172,6 +172,8 @@ class SimulatedCamera(BaseCamera): @blob_density.setter def _set_blob_density(self, value: int) -> None: + if value < 0: + raise ValueError("Sample density must be >= 0") self._blob_density = value if self._capture_enabled: self.generate_canvas() @@ -457,7 +459,7 @@ class SimulatedCamera(BaseCamera): return self._capture_thread.is_alive() return False - noise_level: float = lt.property(default=2.0) + noise_level: float = lt.property(default=2.0, ge=0, le=50) def _capture_frames(self) -> None: last_frame_t = time.time()