TEM Architecture

pyTEM

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:

State Diagram

Simplified State Diagram

A simplified version of this schematic is:

%3 cluster_Preview Preview cluster_Acquisition Acquisition cluster_Montage Montage e09200d504694791a7047d5b4a4da08c UpdateImage f77f09a19bea4d67bc93c965c93748b3 Brightfield e09200d504694791a7047d5b4a4da08c->f77f09a19bea4d67bc93c965c93748b3 04983e878264476f8ba0448ef22000b0 Darkfield e09200d504694791a7047d5b4a4da08c->04983e878264476f8ba0448ef22000b0 4267241bf45645caac56e200002f2144 AutoFocus e09200d504694791a7047d5b4a4da08c->4267241bf45645caac56e200002f2144 8824c5725a684388971d6abc41e09293 AutoExposure e09200d504694791a7047d5b4a4da08c->8824c5725a684388971d6abc41e09293 d50a982d151f490f96ea6fafbe9f757f BeamCenter e09200d504694791a7047d5b4a4da08c->d50a982d151f490f96ea6fafbe9f757f 0add483055dc4c139d15d5715f639d7f BeamSpread e09200d504694791a7047d5b4a4da08c->0add483055dc4c139d15d5715f639d7f ebd778916e8a48a49b2844434c6b3bef ChangeAperture e09200d504694791a7047d5b4a4da08c->ebd778916e8a48a49b2844434c6b3bef d59e9faba55243fbaf3ee2c039a5b620 LensCorrection e09200d504694791a7047d5b4a4da08c->d59e9faba55243fbaf3ee2c039a5b620 d62e9b1dd5c541d49f7aefcab35c13fa FindAperture e09200d504694791a7047d5b4a4da08c->d62e9b1dd5c541d49f7aefcab35c13fa 617a3ed87aa5436d9dd5f56149a3182b ChangeAperture e09200d504694791a7047d5b4a4da08c->617a3ed87aa5436d9dd5f56149a3182b dd9f68d88e11422b922b0b1074aa8de6 Shutdown e09200d504694791a7047d5b4a4da08c->dd9f68d88e11422b922b0b1074aa8de6 4cf035cc53b14b4b9657e5edf68c28ef FindAperture 617a3ed87aa5436d9dd5f56149a3182b->4cf035cc53b14b4b9657e5edf68c28ef ece911444adf4560a2d522e8f7beb889 AutoExposure 4cf035cc53b14b4b9657e5edf68c28ef->ece911444adf4560a2d522e8f7beb889 5aafd189f3ea4b47a19799634f048bc3 BeamCenter ece911444adf4560a2d522e8f7beb889->5aafd189f3ea4b47a19799634f048bc3 49585309955d45e88e888ec0ea908cd0 BeamSpread 5aafd189f3ea4b47a19799634f048bc3->49585309955d45e88e888ec0ea908cd0 2c1b1662307644b7a1a4395ef2aae844 Brightfield 49585309955d45e88e888ec0ea908cd0->2c1b1662307644b7a1a4395ef2aae844 aa9b44237f6b44d285184a08f84b31be Darkfield 2c1b1662307644b7a1a4395ef2aae844->aa9b44237f6b44d285184a08f84b31be 5634b595629548ab9d7d34b2be2453be AutoFocus aa9b44237f6b44d285184a08f84b31be->5634b595629548ab9d7d34b2be2453be ddec5d2eb0f74cda89ed50560cfdb0d0 LensCorrection 5634b595629548ab9d7d34b2be2453be->ddec5d2eb0f74cda89ed50560cfdb0d0 793af28c621b49eabd678da52045f8d0 MoveStage 5634b595629548ab9d7d34b2be2453be->793af28c621b49eabd678da52045f8d0 ddec5d2eb0f74cda89ed50560cfdb0d0->793af28c621b49eabd678da52045f8d0 29244471f78f43c6b97b1133dece63c2 CaptureTile 793af28c621b49eabd678da52045f8d0->29244471f78f43c6b97b1133dece63c2 29244471f78f43c6b97b1133dece63c2->617a3ed87aa5436d9dd5f56149a3182b 29244471f78f43c6b97b1133dece63c2->dd9f68d88e11422b922b0b1074aa8de6

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.