class documentation

A workflow optimised for scanning Histopathology samples.

This workflow automatically plans its own path around a sample spiralling out from the centre position, scanning only where it detects sample.

Method acquisition_routine Perform acquisition routine. This is run at each scan location.
Method check_background Check if sample is background.
Method check_before_start Before starting a scan, check that background and camera-stage-mapping are set.
Method new_scan_planner Return a new scan planner object.
Method pre_scan_routine Autofocus before starting the scan.
Method set_background Set the background for this background detector.
Method settings_ui Return the UI for the workflow's settings in the scan tab.
Class Variable display_name Undocumented
Class Variable equal_distances Make the distances in x and y equal in motor steps, rather than in overlap.
Class Variable max_range The maximum distance in steps from the centre of the scan.
Class Variable skip_background Whether to detect and skip empty fields of view.
Class Variable ui_blurb Undocumented
Property ready Whether this scanworkflow is ready to start.
Method _build_scan_settings Construct the SettingModel for all_settings.
Class Variable _background_detector Undocumented

Inherited from RectGridWorkflow:

Method all_settings Return scan settings and the stitching settings.
Class Variable autofocus_dz The z distance to perform an autofocus in steps.
Class Variable overlap The fraction that adjacent images should overlap in x and y.
Method _calc_displacement_from_overlap Use camera stage mapping to calculate x and y displacement from given overlap.
Method _get_stitching_settings_model Return a stitching settings model based on current settings.
Class Variable _csm Undocumented

Inherited from ScanWorkflow (via RectGridWorkflow):

Class Variable save_resolution A tuple of the image resolution to capture.
Method _autofocus_and_capture Autofocus and then capture, this can be used as an acquisition routine.
Class Variable _autofocus Undocumented
Class Variable _cam Undocumented
Class Variable _planner_cls Undocumented
Class Variable _settings_model Undocumented
Class Variable _stage Undocumented

Inherited from SmartStackMixin (via RectGridWorkflow, ScanWorkflow):

Method create_smart_stack_params Set up the parameters used for all smart stacks in a scan.
Method smart_stack_property_controls Return smart stack property controls for the UI.
Class Variable stack_dz Distance in steps between images in a z-stack.
Instance Variable stack_images_to_save The number of images to save in a stack.
Instance Variable stack_min_images_to_test The minimum number of images to capture in a stack.
Property as_workflow Return self as a ScanWorkflow.
Method _perform_smart_stack Perform acquisition a smart stack.
def acquisition_routine(self, settings: HistoScanSettingsModel, xyz_pos: tuple[int, int, int]) -> tuple[bool, int | None]: (source)

Perform acquisition routine. This is run at each scan location.

Parameters
settings:HistoScanSettingsModelThe settings for this scan as a HistoScanSettingsModel
xyz_pos:tuple[int, int, int]The current position as a tuple or 3 ints.
Returns
tuple[bool, int | None]A tuple of whether an image was taken, and the z-position for focus. If failed to find focus, returns for the focus z-position.
@lt.action
def check_background(self) -> str: (source)

Check if sample is background.

This action is a pre-run check for feeding back to the user.

def check_before_start(self, scan_name: str): (source)

Before starting a scan, check that background and camera-stage-mapping are set.

Raise error if:
  • background is to be skipped but is not set
  • camera stage mapping is not set

Raise warning if not using background detect that scan will go on until max steps reached

def new_scan_planner(self, settings: HistoScanSettingsModel, position: Mapping[str, int]) -> ScanPlanner: (source)

Return a new scan planner object.

Parameters
settings:HistoScanSettingsModelThe settings for this scan as a HistoScanSettingsModel
position:Mapping[str, int]The starting position as a mapping of axes names to int.
Returns
ScanPlannerUndocumented
def pre_scan_routine(self, settings: HistoScanSettingsModel): (source)

Autofocus before starting the scan.

Parameters
settings:HistoScanSettingsModelThe settings for this scan as a HistoScanSettingsModel
@lt.action
def set_background(self): (source)

Set the background for this background detector.

This sets the background for this workflow's background detector as opposed to the active background detector for the camera.

@lt.endpoint('get', 'settings_ui', responses=UI_ELEMENT_RESPONSE)
def settings_ui(self) -> UIElementList: (source)

Return the UI for the workflow's settings in the scan tab.

equal_distances: bool = (source)

Make the distances in x and y equal in motor steps, rather than in overlap.

Uses the shorter distance (usually dy) as both dx and dy

max_range: int = (source)

The maximum distance in steps from the centre of the scan.

skip_background: bool = (source)

Whether to detect and skip empty fields of view.

This uses the settings from the BackgroundDetectThing.

@lt.property
ready: bool = (source)

Whether this scanworkflow is ready to start.

def _build_scan_settings(self, base_kwargs: dict) -> HistoScanSettingsModel: (source)

Construct the SettingModel for all_settings.

Adjust dx and dy to be equal if equal_distances is set.

_background_detector: ChannelDeviationLUV = (source)

Undocumented