class documentation

A mixin for scan workflows that use smart stacking.

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 create_smart_stack_params(self, save_on_failure: bool) -> SmartStackParams: (source)

Set up the parameters used for all smart stacks in a scan.

Returns
SmartStackParamsA StackSmartParams object with the required parameters.
def smart_stack_property_controls(self) -> list[PropertyControl]: (source)

Return smart stack property controls for the UI.

stack_dz: int = (source)

Distance in steps between images in a z-stack.

Suggested values:

  • 50 for 60-100x
  • 100 for 40x
  • 200 for 20x
stack_images_to_save: int = (source)

The number of images to save in a stack.

Defaults to 1 unless you need to see either side of focus

stack_min_images_to_test: int = (source)

The minimum number of images to capture in a stack.

This many images are captured and tested for focus, if the focus is not central enough more images may be captured. After new images are captured, this value sets the number of images used for checking if focus is achieved.

Defaults to 9 which balances reliability and speed.

@property
as_workflow: ScanWorkflow = (source)

Return self as a ScanWorkflow.

Ensures this mixin is only used with ScanWorkflow instances, raising TypeError otherwise.

def _perform_smart_stack(self, settings: SmartStackCompatibleSettings, xyz_pos: tuple[int, int, int]) -> tuple[bool, int | None]: (source)

Perform acquisition a smart stack.

Parameters
settings:SmartStackCompatibleSettingsThe 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.