Autocentering
Understand and run auto-centering
1 What is auto-centering ?
Auto-centering is an automated procedure to center the sample on the beam using computer vision assistance powered by a program called C3D.
Auto-centering always starts with loop pre-centering followend by auto-zooming. There are different kind of procedures:
- Loop auto-centering when loading a sample with the sample changer
- Crystal auto-centering using crystal recognition
- Centering Playback: restoration of a previous centering using snapshots store in the ISPyB database (a pattern matching algorithm)
2 Run auto-centering
2.1 Enable/disable loop auto-centering
In the instrumentation menu, "Automatic centring on sample transfer" toggles the association between Sample Changer loading and starting of auto loop centering.
Test:
If the menu item is enabled, you can test loop centering by typing the following command in the SPEC session:
minidiff_prepare_centring
2.2 Enable/disable crystal auto-centering
Select “Computer automatic” in the 'Hutch' tab of MxCuBE, instead of “Manual 3-clicks”.

- When doing a pipelined experiment using DNA, the computer assisted centering will start automatically, each time after loading a sample with the sample changer.
- If the sample was already centered, and if centering snapshots were saved in IspyB (upon click on "Accept" button), the centering server will reproduce the previous manual centering: centering Playback is activated.
Test it:
Click on the “Center” button, like starting a manual centering. This button is a way to test auto-centering when the "Computer automatic" option is selected. The loop should turn and go to the beam mark.
2.3 Follow the results
Information about the ongoing process is displayed in mxCubE log and at the bottom of the sample display.
Once the auto-centering is done, the behavior depends on the “User confirm” option, as explained in next paragraph.
2.4 User interaction
Check the “User confirm” option to give you the opportunity to control and manually improve each centering before saving snapshots, even during a pipelined experiment using DNA.
If the “User confirm” option is not set, data collection is started automatically at the end of the auto-centering.
If the auto-centering fails, you can read the next paragraphs.
3 Quick Troubleshoot auto-centering:
3.1 If the centering doesn’t start
The server state can be checked using the Interface of MxStartup program or using a command line.
- Interface

Click the check box of the Mxautocentring server, and use Stop/Run buttons to restart it.
- Command line:
- check: bliss_dserver status
- restart: bliss_dserver start Mxautocentering.py
If Mxautocentering.py is “None” in the bliss_dserver status, the program has to (re)started. In case of restart failure, first check the server's owner; the server might also be freezed: in this case you must kill it manually.
3.2 If loop pre-centering is bad
- Most of the time it is because the background around the sample changed. The reason could be lighting changes, or presence of objects (e.g. cryo nozzle) creating a shadow.
Before you take background images please make sure your cryostream is well aligned and that there is no sample on the goniometer head.
Take up-to-date background snapshots using a spec macro:
minidiff_take_backgrounds
MxCuBE goes through all zoom levels to take snapshots.
Before taking the snapshots, the goniometer should move to the right state: backlight on, front light off, beamstop off. The state is equivalent to the position prepared by the macro "minidiff_prepare_centering".
- Sometimes errors come from loop shape detection (e.g. strongly bended or iced). Try with another loop.
4 Some requirements and limitations
- About light: the lighting default settings should avoid
saturation at each zoom level. A good criterion is to have a
homogeneous background above zoom 2. Front lighting must be switched
off because it generates strong light reflections not supported by the
program. If the lighting settings are not correct, it is very important to get up to date background snapshots.
- About loops: crystal detection is not supported in MicroMounts.
- About playback: centering Playback works only if the
previous centering where made on the same machine under the same
session. At the end of a manual centering (intended to be used for the Playback), you must select a zoom level where the loop
is entirely visible (e. g. half the display in size) before pressing the "Accept button"
- About crystals: fishing is difficult but one should avoid these conditions: multiple crystals in the loop, crystal out of the loop, icing and bad flash freezing of mother liquid (should be transparent as much as possible) and tiny crystals in big drops (leading to dramatic lens effects).