Skip to content

Protocol Commands

Protocol commands are used in the protocol.yaml files as building block for the acquisition blocks. Different protocols can be built with different combinations of commands.

All protocol commands have the same input arguments:

  • scope: The microscope interface instance
  • params: The data collection parameters specified during session setup.
  • instance: The instance of the database object that is being worked on. Atlas, Square, Hole, Highmag object

Available commands

SmartScope core commands

core.protocol_commands

alignToHoleRef(scope, params, instance, content, *args, **kwargs)

Aligns the medium mag to the template hole image stored in buffer T. Either load an image manually or use the loadHoleRef command prior to this one.

atlas(scope, params, instance, content, *args, **kwargs)

Collects and atlas of X by Y tiles from the collection parameters using the Montage command

autoFocus(scope, params, instance, content, *args, **kwargs)

Acquires the focus drift image using the Search preset.

autoFocusAfterDistance(scope, params, instance, content, *args, **kwargs)

Acquires the focus only after a specific distance in microns was traveled. Default: 15 um

call(scope, params, instance, content, *args, **kwargs)

Calls any script that is saved in the SerialEM scripts.

callFunction(scope, params, instance, content, *args, **kwargs)

Calls any function that is saved in the SerialEM scripts.

eucentricMediumMag(scope, params, instance, content, *args, **kwargs)

Calculates eucentricity using the View preset. Equivalent to Eucentric Rough.

eucentricSearch(scope, params, instance, content, *args, **kwargs)

Calculates eucentricity using the Search preset.

This is faster than using the built-in serialEM Eucentricity by not having to switch the optics back and forth between View and Search. Will speed up screening.

However, this is less precise than Eucentricty and should be avoided when using Falcon detectors or when setting up for data collection.

highMag(scope, params, instance, content, *args, **kwargs)

Acquires the highmag image.

Will set image shift and the specificed offset from the collection parameters.

Also automatically corrects defocus and image-shift based on the tilt angle.

loadHoleRef(scope, params, instance, content, *args, **kwargs)

Loads the references/holeref.mrc image into buffer T to be used as hole template for the alignToHoleRef command.

mediumMagHole(scope, params, instance, content, *args, **kwargs)

Acquires the hole at the View preset.

moveStage(scope, params, instance, content, *args, **kwargs)

Moves the stage to the instance position

moveStageWithAtlasToSearchOffset(scope, params, instance, content, *args, **kwargs)

Moves the stage to the instance position with an offset

realignToSquare(scope, params, instance, content, *args, **kwargs)

Realigns to the square using the Search magnification. Mainly useful when the alignement between the Atlas and the Square is off.

removeSlit(scope, params, instance, content, *args, **kwargs)

Removes the slit from the beam path.

resetStage(scope, params, instance, content, *args, **kwargs)

Resets the stage to the center of the image.

setAtlasOptics(scope, params, instance, content, *args, **kwargs)

Set the microscope mag, spot size and C2 current for the atlas based on the chosen detector.

setAtlasOpticsDelay(scope, params, instance, content, *args, **kwargs)

Same as setAtlasOptics with delays between each commands.

setAtlasOpticsImagingState(scope, params, instance, content, *args, **kwargs)

Sets the atlas optics from an Imaging State named "Atlas".

setFocusPosition(scope, params, instance, content, *args, **kwargs)

Caculates the rotation and shift of the focus position

Will calculates the rotation from the identified holes. The distance is calculared from the input grid type.

square(scope, params, instance, content, *args, **kwargs)

Acquires and save the square image using the Search preset.

waitDrift(scope, params, instance, content, *args, **kwargs)

Waits for the drift to settle.

Commands specific to plugins

Ptolemy

ptolemy-smartscope.smartscope_plugin.protocol_commands

alignToHolePtolemy(scope, params, instance, content, *args, **kwargs)

Aligns the hole using Ptolemy instead of a hole reference image. Slower but very precise

createHoleRefPtolemy(scope, params, instance, content, *args, **kwargs)

Uses Ptolemy on a view mag image, finds the holes, extracts and average them into a hole reference. The resulting reference will be copied in buffer T.