microscope.simulators.stage_aware_camera module

Simulation of a full setup based on a given image file.

class microscope.simulators.stage_aware_camera.StageAwareCamera(image: numpy.ndarray, stage: microscope.abc.Stage, filterwheel: microscope.abc.FilterWheel, **kwargs)[source]

Bases: microscope.simulators.SimulatedCamera

Simulated camera that returns subregions of image based on stage position.

Instead of using this class directly, consider using the simulated_setup_from_image() function which will generate all the required simulated devices for a given image file.

Parameters
  • image – the image from which regions will be cropped based on the stage and filter wheel positions.

  • stage – stage to read coordinates from. Must have an “x”, “y”, and “z” axis.

  • filterwheel – filter wheel to read position.

microscope.simulators.stage_aware_camera.simulated_setup_from_image(filepath: str, **kwargs) → Dict[str, microscope.abc.Device][source]

Create simulated devices given an image file.

To use with the device-server:

DEVICES = [
    device(simulated_setup_from_image, 'localhost', 8000,
           conf={'filepath': path_to_image_file}),
]