diff --git a/src/openflexure_microscope_server/things/autofocus.py b/src/openflexure_microscope_server/things/autofocus.py index f62416aa..9bb5bb54 100644 --- a/src/openflexure_microscope_server/things/autofocus.py +++ b/src/openflexure_microscope_server/things/autofocus.py @@ -20,7 +20,7 @@ from pydantic import BaseModel, computed_field, field_validator, model_validator import labthings_fastapi as lt from labthings_fastapi.types.numpy import NDArray -from .camera import BaseCamera +from .camera import BaseCamera, CaptureParams from .stage import BaseStage LOGGER = logging.getLogger(__name__) @@ -40,13 +40,6 @@ class AutofocusParams(BaseModel): sharpness_method: str = "jpeg" -class CaptureParams(BaseModel): - """A class for capturing at least a single image.""" - - images_dir: str - save_resolution: tuple[int, int] - - class StackParams(BaseModel): """A class for holding stack parameters, and returning computed ones.""" diff --git a/src/openflexure_microscope_server/things/camera/__init__.py b/src/openflexure_microscope_server/things/camera/__init__.py index cb599bdc..a9b28811 100644 --- a/src/openflexure_microscope_server/things/camera/__init__.py +++ b/src/openflexure_microscope_server/things/camera/__init__.py @@ -20,6 +20,7 @@ from typing import Any, Literal, Mapping, Optional, Self, Tuple import numpy as np import piexif from PIL import Image +from pydantic import BaseModel import labthings_fastapi as lt from labthings_fastapi.types.numpy import NDArray @@ -47,6 +48,13 @@ class CaptureError(RuntimeError): """An error trying to capture from a CameraThing.""" +class CaptureParams(BaseModel): + """A class for capturing at least a single image.""" + + images_dir: str + save_resolution: tuple[int, int] + + class NoImageInMemoryError(RuntimeError): """An error called if no image is in memory when accessed.""" diff --git a/src/openflexure_microscope_server/things/scan_workflows.py b/src/openflexure_microscope_server/things/scan_workflows.py index 42f11a18..4acbbe88 100644 --- a/src/openflexure_microscope_server/things/scan_workflows.py +++ b/src/openflexure_microscope_server/things/scan_workflows.py @@ -33,13 +33,12 @@ from openflexure_microscope_server.things.autofocus import ( MIN_TEST_IMAGE_COUNT, AutofocusParams, AutofocusThing, - CaptureParams, SmartStackParams, ) from openflexure_microscope_server.things.background_detect import ( ChannelDeviationLUV, ) -from openflexure_microscope_server.things.camera import BaseCamera +from openflexure_microscope_server.things.camera import BaseCamera, CaptureParams from openflexure_microscope_server.things.camera_stage_mapping import CameraStageMapper from openflexure_microscope_server.things.stage import BaseStage from openflexure_microscope_server.ui import PropertyControl, property_control_for