navigate.model.devices.stages.asi_MSTwoThousand.ASIStage
- class navigate.model.devices.stages.asi_MSTwoThousand.ASIStage(microscope_name: str, device_connection: Any, configuration: Dict[str, Any], device_id: int = 0)
Bases:
StageBase
Applied Scientific Instrumentation (ASI) Stage Class
ASI Documentation: https://asiimaging.com/docs/products/serial_commands
ASI Quick Start Guide: https://asiimaging.com/docs/command_quick_start
Note
ASI firmware requires all distances to be in a 10th of a micron.
- __init__(microscope_name: str, device_connection: Any, configuration: Dict[str, Any], device_id: int = 0)
Initialize the ASI Stage connection.
- Parameters:
microscope_name (str) – Name of microscope in configuration
device_connection (Any) – Hardware device to connect to
configuration (Dict[str, Any]) – Global configuration of the microscope
device_id (int) – Device ID for the stage, by default 0
Methods
__init__
(microscope_name, device_connection, ...)Initialize the ASI Stage connection.
close
()Close the stage.
get_abs_position
(axis, axis_abs)Ensure the requested position is within axis bounds and return it.
get_axis_position
(axis)Get position of specific axis
Return a dictionary with the saved stage positions.
get_speed
(axis)Get scan velocity of the axis.
move_absolute
(move_dictionary[, wait_until_done])Move Absolute Method.
move_axis_absolute
(axis, abs_pos[, ...])Move stage along a single axis.
move_axis_relative
(axis, distance[, ...])Move the stage relative to the current position along the specified axis.
Reports the position for all axes in microns, and create position dictionary.
scan_axis_triggered_move
(start_position, ...)Move the stage along the specified axis from start position to end position, with optional TTL triggering.
scanr
(start_position_mm, end_position_mm, ...)Set scan range
scanv
(start_position_mm, end_position_mm, ...)Set scan range
set_speed
([velocity_dict, percent])Set scan velocity.
start_scan
(axis)Start scan state machine
stop
()Stop all stage movement abruptly.
Stop scan
verify_abs_position
(move_dictionary[, is_strict])Ensure the requested moving positions are within axes bounds
verify_move
(move_dictionary)Don't submit a move command for axes that aren't moving.
wait_until_complete
(axis)Attributes
Mapping of software axes to ASI hardware axes
Dictionary of ASI axes to software axes
ASI MS2000 Controller
- close()
Close the stage.
- get_abs_position(axis, axis_abs)
Ensure the requested position is within axis bounds and return it.
- Parameters:
axis (str) – An axis: x, y, z, f, theta
axis_abs (float) – Absolute position value
- Returns:
Position to move the stage to for this axis.
- Return type:
float
- get_axis_position(axis)
Get position of specific axis
- Parameters:
axis (str) – Axis to get position of
- Returns:
position
- Return type:
float
- get_position_dict()
Return a dictionary with the saved stage positions.
- Returns:
Dictionary of stage positions.
- Return type:
dict
- get_speed(axis)
Get scan velocity of the axis.
- Parameters:
axis (str) – axis name, such as ‘x’, ‘y’, ‘z’
- Returns:
velocity – Velocity
- Return type:
float
- move_absolute(move_dictionary, wait_until_done=False)
Move Absolute Method.
XYZ Values should remain in microns for the ASI API Theta Values are not accepted.
- Parameters:
move_dictionary (dict) – A dictionary of values required for movement. Includes ‘x_abs’, etc. for one or more axes. Expect values in micrometers, except for theta, which is in degrees.
wait_until_done (bool) – Block until stage has moved to its new spot.
- Returns:
success – Was the move successful?
- Return type:
bool
- move_axis_absolute(axis, abs_pos, wait_until_done=False)
Move stage along a single axis.
Move absolute command for ASI is MOVE [Axis]=[units 1/10 microns]
- Parameters:
axis (str) – An axis prefix in move_dictionary. For example, axis=’x’ corresponds to ‘x_abs’, ‘x_min’, etc.
abs_pos (float) – Absolute position value
wait_until_done (bool) – Block until stage has moved to its new spot.
- Returns:
Was the move successful?
- Return type:
bool
- move_axis_relative(axis, distance, wait_until_done=False)
Move the stage relative to the current position along the specified axis. XYZ Values should remain in microns for the ASI API Theta Values are not accepted.
- Parameters:
axis (str) – The axis along which to move the stage (e.g., ‘x’, ‘y’, ‘z’).
distance (float) – The distance to move relative to the current position, in micrometers for XYZ axes.
wait_until_done (bool) – Whether to wait until the stage has moved to its new position, by default False.
- Returns:
success – Indicates whether the move was successful.
- Return type:
bool
- report_position()
Reports the position for all axes in microns, and create position dictionary.
- Returns:
Dictionary of positions for each axis in microns.
- Return type:
dict
- scan_axis_triggered_move(start_position, end_position, axis, ttl_triggered=False)
Move the stage along the specified axis from start position to end position, with optional TTL triggering.
- Parameters:
start_position (float) – The starting position of the stage along the specified axis.
end_position (float) – The desired end position of the stage along the specified axis.
axis (str) – The axis along which the stage will be moved (e.g., ‘x’, ‘y’, ‘z’).
ttl_triggered (bool) – Whether to trigger the move using TTL signal, by default False.
- Returns:
success – Indicates whether the move was successful.
- Return type:
bool
- scanr(start_position_mm, end_position_mm, enc_divide, axis='z')
Set scan range
- Parameters:
start_position_mm (float) – scan start position
end_position_mm (float) – scan end position
enc_divide (float) – Step size desired.
axis (str) – fast axis name
- Returns:
success – Was the setting successful?
- Return type:
bool
- scanv(start_position_mm, end_position_mm, number_of_lines, overshoot, axis='z')
Set scan range
- Parameters:
start_position_mm (float) – scan start position
end_position_mm (float) – scan end position
number_of_lines (int) – number of steps.
overshoot (float) – overshoot_time ms
axis (str) – fast axis name
- Returns:
success – Was the setting successful?
- Return type:
bool
- set_speed(velocity_dict=None, percent=None)
Set scan velocity.
- Parameters:
velocity_dict (dict) – velocity for specific axis {‘x’: float, ‘y’: float, ‘z’: float}
percent (float) – Percent of maximum speed
- Returns:
success – Was the setting successful?
- Return type:
bool
- start_scan(axis)
Start scan state machine
- Parameters:
axis (str) – fast axis name, such as ‘x’, ‘y’, and ‘z’
- Returns:
success – Was it successful?
- Return type:
bool
- stop()
Stop all stage movement abruptly.
- stop_scan()
Stop scan
- verify_abs_position(move_dictionary, is_strict=False)
Ensure the requested moving positions are within axes bounds
- Parameters:
move_dictionary (dict) – A dictionary of values required for movement. Includes ‘x_abs’, ‘y_abs’, etc. for one or more axes. Expect values in micrometers, except for theta, which is in degrees.
is_strict (bool, optional) – If True, return an empty dict if any axis is out of bounds.
- Returns:
a verified moving dict {axis: abs_position}
- Return type:
dict
- verify_move(move_dictionary)
Don’t submit a move command for axes that aren’t moving. The MS2000 controller wait time for each axis is additive.
- Parameters:
move_dictionary (dict) – A dictionary of values required for movement. Includes ‘x_abs’, etc. for one or more axes. Expect values in micrometers, except for theta, which is in degrees.
- Returns:
res_dict – A dictionary of values required for movement. Includes ‘x_abs’, etc. for one or more axes. Expect values in micrometers, except for theta, which is in degrees.
- Return type:
dict
- asi_axes
Dictionary of ASI axes to software axes
- Type:
dict
- axes
List of stage axes available.
- Type:
list
- axes_mapping
Mapping of software axes to ASI hardware axes
- Type:
dict
- device_connection
Device connection object.
- Type:
Any
- ms2000_controller
ASI MS2000 Controller
- Type:
object
- stage_feedback
Feedback alignment value for the stage. Default is None.
- Type:
int
- stage_limits
Whether the stage has limits enabled or not. Default is True.
- Type:
bool