pyTEM
Sends
- camera.command
- camera.settings
- montage.finished
- montage.start
- scope.command
- stage.aperture.command
- stage.motion.command
- stage.rotation.command
- tile.raw
Receives
pyTEM is the main hierarchical state machine orchestrating all the components. This service uses the Pigeon client for communication via the message broker. Furthermore, a library integrating Pigeon and the Python Transitions library to allow easy creation of the state machine. This library can also create a state transition diagrams of the state machine:
Simplified State Diagram
A simplified version of this schematic is:
Below, the functionality of each of “states” shown above is detailed. In reality, each of these “states” is a state machine in and of itself.
Preview
The Preview machine is used for previewing the image data, and checking that the microscope functions as expected.
Acquisition
The Acquisition machine is used to set up and capture a montage.
Montage
The Montage machine collects the required tiles.
UpdateImage
The UpdateImage machine requests an image from the camera, and sends it to the image processing pipeline.
Ultimately, this image will then be shown on the UI.
Darkfield
The Darkfield machine collects a darkfield image by lowering the screen on the microcope, collecting a series of images, averaging them, then raising the screen again.
Brightfield
The Brightfield machine collects a brightfield image by moving the stage while collecting a series of images, then averaging them.
AutoFocus
The AutoFocus machine optimizes the focus by maximizing the focus score produced by the image processing pipeline.
AutoExposure
The AutoExposure machine optimizes the exposure by finding the camera exposure which produces a mean value within the correct range as calculated by the image processing pipeline.
BeamCenter
The BeamCenter machine centers the electron beam in the microscope’s field of view.
BeamSpread
The BeamSpread machine spreads the beam to get an even density of electrons over the field of view.
ChangeAperture
The ChangeAperture machine changes the current aperture of the tape or stick that is being imaged.
LensCorrection
The LensCorrection machine collects a lens correction montage.
FindAperture
The FindAperture machine finds the bounds of the current aperture by moving the stage and processing images.
MoveStage
The MoveStage machine moves the stage to the location of the next tile.
CaptureTile
The CaptureTile machine captures a single tile using the camera.
Shutdown
In the Shutdown machine, the microscope is placed into a safe state.
Ideally, the beam is turned off, and the screen is lowered.
Note:
Historically, orchestration of all components was accomplished using pytemca documented here.
