SEM automation guidelines for small script development: evaluation

By Wouter Arts - July 26, 2018

Scripts are small automated software tools that can help a scanning electron microscope (SEM) user work more efficiently In my previous two blogs, I wrote about image acquisition and analysis with the Phenom Programming Interface (PPI). In this blog I will explain how we can use the physical properties we obtained in the last blog in the evaluation step.

SEM automation workflows 

Typically, SEM workflows always consist of the same steps, see Figure 1. The four steps that can be automated using PPI are:

  1. Image acquisition
  2. Analysis
  3. Evaluation
  4. Reporting

In the image acquisition step (1), images are automatically made using PPI and the Phenom SEM (read this blog on Guidelines for small script development: image acquisition for more information on this step). In the analysis step (2), the physical properties are extracted from the image (see this blog on SEM automation guidelines for small script development: image analysis).The images are evaluated based on these physical properties in the evaluation step (3). The final automated step (4) is reporting the results back to the user.

 phenom blog ppi guidelines-1

Figure 1: Scanning Electron Microscopy workflow

Image evaluation 

In the evaluation step, the physical quantities are evaluated and categorized. This can be done by:

  • Counting particles based on their morphology
  • Determining the coverage on a sample
  • Base actions on physical properties of the sample

In this blog we will base action on the physical properties in an image to determine where the center of the copper aluminum stub is.

To do this we will assume that the copper insert is perfectly round. The script will start at a location pstart within the copper part of the stub. From here it will move in both positive and negative x and y directions to find a set of four edges points of the copper insert. These points will be Schermafbeelding 2018-07-05 om 12.17.40. Because of the circular symmetry of the stub, the arithmetic average of the x positions of Schermafbeelding 2018-07-05 om 12.20.01 and the y-position of Schermafbeelding 2018-07-05 om 12.20.45 will yield the center Schermafbeelding 2018-07-05 om 12.21.08 of the stub. In Figure 2 all the points are shown.

 Schermafbeelding 2018-07-05 om 13.07.41
Figure 2: Definitions of the locations on the stub


To find the edges, the stage is moved. In every step the image is segmented using the techniques explained in the previous blog. When less than 50% of the image consists of the copper part, the edge is located. The exact position of the edge point is then defined as the center of mass of the area that is neither copper nor aluminum.

Schermafbeelding 2018-07-05 om 13.08.37

Figure 3: Definitions of the locations on the stub


Code snippet 1 shows an example of how this can be done. First the stage is brought to its original starting point with the Phenom.MoveTo method. This position is retrieved back from the Phenom Desktop SEM using the phenom.GetStageModeAndPosition command. After that, the step size is defined. A step of 250 µm is chosen, which is equal to half the image field width. Four vectors are defined in all directions to find the four edges. These vectors are combined into an iterable list, to be able to iterate over them in the for loop.

In the for loop, the stage is first moved to an initial guess of the location of the center. Then, a while loop is started where the stage moves to one direction with the step size. At every step the image is segmented and checked if the area of copper is smaller than 50%. If the copper area is less than 50%, the edge has been found and the center location of the edge is determined using ndimage.measurements.center_of_mass method.

The resulting center of mass is expressed in pixels and is converted to metric units using the metadata that is available in the Phenom acquisition objects. The centers of masses are stored in a list and from this list the Schermafbeelding 2018-07-05 om 13.09.38 and Schermafbeelding 2018-07-05 om 13.10.07 locations are determined. From the set of locations, the arithmetic averages are easily determined, and the stage is moved to its new improved center location.

Schermafbeelding 2018-07-05 om 13.11.26

Code snippet 1: Code to find and to move to the center of the stub

In Figure 4, the initial guess of the location of the center is shown on the left-hand side and the improved center location is shown on the right-hand side. Iterating this process a few times could improve the center location even further; this because the symmetry will improve towards the center of the stub.

Schermafbeelding 2018-07-05 om 13.12.28

Figure 4: Definitions of the locations on the stub

In code snippet 2, the complete code is shown, including the code from my two previous blogs.

Schermafbeelding 2018-07-05 om 13.18.56

Schermafbeelding 2018-07-05 om 13.19.39

Schermafbeelding 2018-07-05 om 13.20.23

Code snippet 2: Complete code

Learn more about SEM automation and the Phenom Programming Interface

If you want to learn more about PPI and how you could use it to automate your image acquisition routine, check out our spec sheet. In my next blog I’ll explain how the reporting tools work and how to generate PDF files in PPI.

Download your Phenom Programming Interface sheet


About the author

Wouter Arts is an application software engineer at for the Thermo Scientific Phenom Desktop SEM product range at Thermo Fisher Scientific. He is interested in finding new smart methods to convert images to physical properties using the Phenom Desktop SEM. In addition, he develops scripts to help companies in using the Phenom Desktop SEM for automated processes.

Press Room | Privacy Policy | Terms of Use | Sitemap |