Capturing an Image¶
This tutorial will show you how to capture an image from a scanning electron microscope.
Install and Run the Pix2Net Server¶
In order for Pix2Net to control the SEM, the Pix2Net Server application must be running on your SEM’s support computer.
The Pix2Net server files are located in C:\Program Files\Pix2Net\server. Copy these files to a directory on the SEM’s
support machine, and then double-click RunPix2NetServer.bat. The Pix2Net Server application should start up.

The Pix2Net Server is now waiting for Pix2Net to connect to it on port 20038. You should also note the IP address of the SEM’s
support computer. You can obtain the IP address by typing ipconfig in a dos prompt.
Connect to the Pix2Net Server¶
Start Pix2Net and go to the
Capturetab. Press theSetup Serverbutton.
The Setup Server dialog should appear:

Make sure the
IP Addressfield matches the IP address of the machine the Pix2Net Server is running on.Click the
Add Profilebutton to add a new profile. Enter the name of your SEM (e.g. FIB).If Pix2Net was able to connect to the server, then the
Edit Profilewindow will appear, with a snapshot of the SEM support computer’s desktop:
Preparing the SEM¶
You need to begin by putting the SEM in a state where you can capture a test image. For example, you may want to turn the beam on.
You can do this from the Edit Profile window if you switch to interactive mode by pressing the Interactive button.

In interactive mode, whenever you click somewhere on the image of the support computer, that mouse click will be sent to the support computer, and the screen will be refreshed. It is similar to a Remote Desktop session, except the screen will only be refreshed once after each mouse press.
Once you are ready to capture an image, you can start entering the necessary steps into Pix2Net.
Entering Steps¶
Your SEM is most likely different from ours, so you will need to come up with your own set of steps. However, for the purposes of the following example, assume that you can capture an image with your SEM by pressing a Resume button.
You must tell Pix2Net what the Resume button looks like, and where it is. You can accomplish this by adding a resource.
Switch to the resource mode by pressing the
Resourcebutton.
Draw a box around the Resume button by clicking and dragging. The box does not have to be perfect.

Enter a name, such as
Resume Button, set the type toFixed Image, and clickAdd.
By specifying Fixed Image, we are telling Pix2Net that it can assume that resume button will always be at exactly the same place on
the screen. If it is not safe for Pix2Net to make that assumption, then we could have specified Floating Image. In that case, Pix2Net
would scan the screen for the first set of pixels that match the image of the resume button.
Another resource we will add at this time is a region that represents the Preview area. This is the area of the SEM’s GUI that shows
a preview of the area that will be captured.
Click and drag to draw a bounding box around the area of the GUI that shows a preview of the image to be captured.

Enter a name, such as
Preview, set the type toRegion, and clickAdd.
By specifying Region, we are telling Pix2Net that this resource is purely a bounding box and not an image.
Now, let’s start creating the protocol:
Click on the Protocols tab and then click the
Addbutton.
Choose a name for the protocol, such as
Standard, and click Ok. In general, you will only need one protocol.You will now see a list of commands that can be defined. Select
Capture Image.
Click the
New Stepbutton, choosePress Mouse Button, and clickOk.In the settings for
Press Mouse Button, set the target area to the resource you defined for the resume button.
Click the
New Stepbutton, chooseDelay, and choose some amount of time for Pix2Net to wait for the image to be captured.Click the
New Stepbutton, chooseRead Image, and enter the directory the image will be saved to. Pix2Net will grab the latest .bmp file from this directory. The image will be deleted after reading by default, so that Pix2Net does not accidentally read the same image again in a future image capture.Select the
Capture Previewcommand.Click the
New Stepbutton, chooseGrab screenshot, and set the region to the resource you created for the preview area. Ignore the Remove horizontal line checkbox, because that is a very specialized feature.Click
Okto close the Edit Protocol window.Click
Okto close the Edit Profile windowClick
Okto close the Setup Server window
Testing the Capture¶
In the
Capturetab, click theControl Microscopebutton.
Click the
Capture Imagebutton.
The image should be successfully captured. If you receive an error message, you may need to go back and edit the steps in the Edit Profile window.
Setting up Auto-Focus¶
Here are the steps for setting Pix2Net up to automatically adjust the focus during a run:
- In the
Edit Profilescreen, inResourcemode, draw a box around the button that turns on reduced area.
Give it a name such as “Turn on Reduced Area”, and add it as a
Fixed Imageresource.
- Switch to
Interactivemode and click on the reduced area button. Once the SEM is in reduced area mode, switch back toResourcemode, draw a box around the button that turns reduced area mode off, give it a name such as “Turn off Reduced Area”, and add it as aFixed Imageresource. - Click the
Protocolstab, select the main protocol, and click theEdit Protocolbutton. - Select the
Auto-Focuscommand and add the following steps:
| Step | Fields | Description |
|---|---|---|
| Press keys | Key sequence: F5+Shift | This step will turn the crosshair off. |
| Mouse press | Left button, Target area: SafeArea. | This step will go to the safe area (i.e. a place on the screen that can be safely clicked without doing anything). |
| Mouse press | Left button, Target area: Turn on reduced area. | This step will put the SEM into reduced area mode. |
| Mouse press | Left button, Target area: SafeArea. | This step will go to the safe area. |
| Wait for image to match | Fixed image: Turn off reduced area, Time to wait: 5,000 ms. | This step will wait up to 5 seconds for the SEM to enter reduced area mode. |
| Mouse press | Left button, Target area: Unpause button. | This step will put the SEM into live mode. |
| Mouse press | Left button, Target area: SafeArea. | This step will go to the safe area. |
| Wait for image to match | Fixed image: Pause button, Time to wait: 5,000 ms. | This step will wait up to 5 seconds for the SEM to enter live mode. |
| Adjust focus in reduced area | Color of rectangle: Green, Full area: Preview. | The Preview resource should be a bounding box around the place in the SEM’s GUI where the SEM image is drawn.
During this step, Pix2Net will identify the reduced area bounding box by its color, which should match the color
specified for Color of Rectangle. Pix2Net will move the reduced area box to a suitable location on the screen, and then
it will perform the Increment Focus and Decrement Focus commands until the reduced image is a sharp as possible. In order
for this to work, it is important that the SEM’s crosshair is hidden, the SEM is in reduced area mode, and the SEM is in live mode. |
| Mouse press | Left button, Target area: Pause button. | This step will pause the SEM. |
| Mouse press | Left button, Target area: SafeArea. | This step will go to the safe area. |
| Wait for image to match | Fixed image: Unpause button, Time to wait: 5,000 ms . | This step will wait up to 5 seconds for the SEM to pause. |
| Mouse press | Left button, Target area: Turn off reduced area. | This step will cause the SEM to leave reduced area mode. |
| Mouse press | Left button, Target area: SafeArea. | This step will go to the safe area. |
| Wait for image to match | Fixed image: Turn on reduced area, time to wait: 5,000 ms. | This step will wait up to 5 seconds for the SEM to leave reduced area mode. |
| Press keys | F5+Shift. | This step will turn the crosshair back on. |
You can test this command by returning to the Capture tab, clicking Control Microscope, and then clicking the Auto-Focus button.
