User Manual

Katana Microtome

Part I · System & Hardware

1.System Overview

The Katana Microtome is a Serial Block-Face Scanning Electron Microscopy (SBF-SEM) system that can be installed inside the vacuum chamber of any SEM. It is controlled from a host PC by the Samurai 3 software, which orchestrates the SEM and the microtome to perform fully automated image-cut-image cycles.

Katana microtome
MicrotomeIn-chamber cutting unit
Electronic controller
Electronic ControllerExternal control and power unit
Digital Viewer optical camera
Digital ViewerDetachable optical camera

Figure 1.1: The three hardware components of the system.

1.1 Hardware Components

  • Microtome — a serial block-face imaging system that fits inside the SEM chamber.
    • Slices the sample with a diamond knife.
    • Includes a precision stage and electronic controllers (the control unit) that move the microtome and communicate with the computer.
    • Has a digital viewer used during the approach to bring the sample to the cutting plane.

1.2 Software

The Samurai 3 software is the central control hub. It talks to the microtome controller over USB and to the SEM over the network (or by local API, depending on the SEM vendor), and orchestrates the two to run automated acquisitions. See Chapter 7: Introduction to Samurai 3 for an overview of the software's role in SBF-SEM experiments.

2.Microtome Components

The microtome is the in-chamber component of the system. It physically slices the sample and performs the serial cutting that produces each new block face.

Top view
Top view
Side view
Side view
Bottom view
Bottom view
Figure 2.1: The microtome viewed from three angles. Numbered balloons correspond to the legend below.

2.1 Parts Reference

#PartDescription
1Diamond knifeThe cutting edge. Must be kept clean and protected when idle.
2In-chamber power/signal cableConnects the microtome to the electronic controller through the SEM chamber flange.
3Sample navigation arrowsVisual markers for orienting the sample relative to the cutting direction.
4Driving oscillatorOscillates the knife at a configurable frequency for improved cutting.
5Sensing oscillatorProvides closed-loop feedback on oscillation amplitude.
6Sample pinHolds the mounted sample. Seated in the stage.
7Diamond knife holderThe assembly that clamps and electrically connects the knife.
8Microtome main connectorThe in-chamber connector for the cable at (2).
9Access hole for sample pin clampingThe opening the screwdriver is inserted into when clamping or releasing the pin.
10Thumb screw for stage clampingSecures the microtome in place on the SEM stage.

3.Electronics Controller

The electronic controller sits outside the SEM. It drives the microtome's motors and oscillator, supplies power, and handles communication with the SEM computer running Samurai 3 — and, when needed, with other instruments over USB.

Figure 3.1: The electronic controller. Ports and switch are labelled.

3.1 Ports and Controls

  1. USB ports — for connecting the SEM computer running Samurai 3 and, if needed, other instruments.
  2. Main connector — plugs into the SEM chamber feedthrough flange. From the inside of the chamber, the in-chamber cable runs from the flange to the microtome's main connector.
  3. 48 V input power connector — accepts the supplied 48 V power brick.
  4. Main switch — on/off power switch for the controller.

4.Installation

4.1 Prior to Installation

The microtome is designed to sit inside the vacuum chamber of an SEM. To maintain optimal SEM performance, the microtome and all associated vacuum components — the flange, stage adapter and in-chamber signal/power cables — must be free from contamination.

If you identify any contaminants on the surfaces of the microtome or vacuum components, gently wipe the affected areas with a lint-free tissue soaked in isopropanol. Ensure all surfaces are completely dry and free from residue before proceeding with installation.

4.2 Clearing the Chamber

The microtome is a substantial component. To prevent accidental collisions with detectors or other movable equipment, remove any detectors that are not in use. Detectors that remain in the chamber should be fully retracted and secured — either by engaging mechanical locks, or by disabling insertion in the SEM's software.

Verify there is sufficient clearance between the Backscattered Electron Detector (BSED) and the SEM stage. Measure the distance from the top face of the supplied stage adapter to the lowest part of the BSED — this distance must be greater than 56 mm, which is the height of the microtome.

4.3 Mounting the Microtome

Place the microtome on the supplied stage adapter and secure it using the thumb screw at the rear (see Figure 2.1, item 10). Route the in-chamber cable through the chamber feedthrough and connect the external end to the electronic controller's main connector. Power the controller from the supplied 48 V brick. Connect the controller to the host PC by USB.

5.Sample Preparation

5.1 Mounting a Sample

Figure 5.1: The aluminium sample pin. The dark region at the top is the mounted sample; its height (the gap between the two red lines) must be below 1.3 mm.
  • Attach the sample securely to an aluminium sample pin using superglue or conductive epoxy. This keeps the sample stable during cutting.
  • Ensure a good conductive path between the sample and the pin, for example by sputter-coating the sample with a conductive material. This allows accumulating charge to drain from the sample during imaging.
  • The combined height of the sample and the top section of the sample pin should be between 2.1 mm and 3.3 mm. The top section of the pin is 2 mm high, so the sample height should ideally be between 100 µm and 1200 µm.
  • For samples taller than 1200 µm, a pin with a shorter top section is available. Note that taller samples are less stable and may produce cutting artefacts.
  • For samples shorter than 100 µm, use a thin (0.5 mm) spacer to raise the sample if you intend to cut its last 100 µm.
  • Exercise caution that the diamond knife does not contact the sample pin — particularly when the sample is nearly exhausted.

5.2 Inserting the Sample Pin

Insert sample pin
1. Insert
Secure sample pin
2. Secure
Remove sample pin
3. Remove
Figure 5.2: Three-step sequence for inserting (1), securing (2) and removing (3) a sample pin.
  1. Insert the sample pin into the designated hole on the sample stage.
  2. Firmly press the pin down onto the stage to make good contact.
  3. To secure the pin, use the supplied flat-head screwdriver to turn the securing screw clockwise with your fingers (do not overtighten).
  4. To remove the pin, turn the screw anti-clockwise until you feel resistance. Then turn it clockwise for half a turn to release the pin.

6.Maintenance

6.1 Replacing the Knife

Figure 6.1: Removing the diamond knife holder. Hold it securely in the direction shown while removing the two hex screws.
  1. Ensure the microtome is unplugged from the electronics via the in-chamber cable.
  2. Hold the knife securely in the same direction as the arrows while removing the two hex screws. This prevents any force being applied to the cut mechanism.
  3. The knife must not be lifted straight up — this can damage the electrical connector. Use a flat-head screwdriver (or similar) to gently lever the knife holder from below, as shown, to unplug the connector. Avoid touching or shorting the electrical connections.
Part II · Getting Started with Samurai 3

7.Introduction to Samurai 3

Figure 1.1: The Samurai 3 application — the central hub for SBF-SEM experiment control

1.1 What is Samurai?

Samurai 3 is a software application designed to control the katana microtome and the Scanning Electron Microscope (SEM) to achieve very high-resolution imaging in Serial Block-Face Scanning Electron Microscopy (SBF-SEM) experiments. It provides a unified interface allowing you to:

  • Define regions of interest on your sample
  • Configure imaging parameters for each region of interest
  • Set up automated acquisition sequences spanning hundreds or thousands of cycles
  • Monitor and control the imaging process in real-time
  • Review acquired data using the time travel feature
  • Keep images sharp over long runs with autofocus and auto stigmation adjustment
  • Use debris detection to identify contamination on the block face
  • Automate complex workflows through scripting

Samurai acts as the central control hub that orchestrates your SEM and microtome to work together seamlessly.

1.2 What is SBF-SEM?

Serial Block-Face Scanning Electron Microscopy (SBF-SEM) is a powerful 3D imaging technique used primarily in biological research:

  1. Imaging: The SEM captures an image of the block face (the exposed surface of your sample)
  2. Cutting: An ultramicrotome removes a thin slice from the sample surface (typically 20–200 nanometers)
  3. Repeat: Steps 1 and 2 are repeated hundreds or thousands of times

This produces a stack of aligned images that can be reconstructed into a 3D volume.

Figure 1.2: The SBF-SEM imaging cycle — image the block face, cut a thin slice, repeat. Image courtesy of volumeem.org.

1.3 System Components

Hardware Components

  • Scanning Electron Microscope (SEM): The imaging device. Samurai supports certain models from TESCAN, Zeiss, Hitachi, CIQTEK, and FEI. Setting Generic SEM mode allows Samurai to be used with any SEM model.
  • katana microtome: The precision cutting device that performs sectioning

Software Components

  • Samurai Frontend: The graphical user interface
  • Samurai Backend: The service that communicates with hardware
  • Database: Stores all experiment data and settings

1.4 Key Terminology

TermDefinition
ROIRegion of Interest — an area of your sample to image
TileA single image position within an ROI
CycleOne complete imaging + cutting sequence
Time TravelFeature to view/edit cycle-specific settings
AutofocusAutomatic focus adjustment performed during acquisition to keep the block face sharp
ScriptingAdvanced scripting capabilities for automating complex workflows

8.Launching Samurai

2.1 System Requirements

RequirementSpecification
Operating SystemWindows 10 or later (64-bit)
RAM8 GB minimum, 16 GB recommended
StorageSSD recommended for database and acquired images
Display1920 × 1080 resolution minimum

2.2 First Launch

When you launch Samurai, the application opens on the Approach tab. Hardware is initially shown as disconnected in the bottom bar.

If auto-connect is enabled in Settings, Samurai will automatically connect to the katana microtome and the SEM on startup. Otherwise, you can connect them manually from the Connections panel.

Figure 2.1: Samurai 3 launches to the Approach tab.

9.The User Interface

3.1 The Main Tabs

Samurai has two primary tabs that define the main operating modes — and they are used in sequence.

Approach Tab

The tab Samurai opens on. It provides the optical camera feed and the stage/knife controls used to bring the sample to the cutting plane. See Chapter 12: The Approach Procedure for the full workflow.

Figure 3.1: The Approach Tab showing the optical camera feed and knife positioning controls.

Imaging Tab

After completing the approach and closing the SEM chamber, switch to the Imaging tab to define ROIs, configure acquisition cycles, run automated imaging, and use Time Travel to review progress. Debris detection, autofocus, autostigmation, and scripting are all configured from this tab.

Figure 3.2: The Imaging Tab showing ROIs on the viewport with acquisition controls.

3.2 Application Layout

The Samurai 3 window is divided into five zones. The contents of the left and right sidebars change depending on which tab is active.

Figure 3.3: The Samurai 3 application window with labeled layout zones.

Top Bar

Contains the Samurai 3 logo and the main tab switcher: Approach and Imaging.

Left Sidebar

Primary controls for the active tab.

  • Approach tab — Position controls for the knife and sample, cutting window setup, and step-size selection.
  • Imaging tab — Experiment Manager, microtome imaging controls (cycle count, thickness, cut speed, retract clearance, oscillator, imaging addition, debris detection), and the Z-position display with quick-approach / sweep controls.

Main Viewport

The central work area.

  • Approach tab — Live feed from the approach camera.
  • Imaging tab — SEM image with ROI and tile overlays; supports pan, zoom, selection, and ROI/tile editing.

Right Sidebar

Secondary panels for the active tab.

  • Approach tab — Process panel (cycle counts, thickness, cut speed, oscillator frequency/amplitude, retract clearance, approach run controls) and the Configuration Manager for saving and loading configurations.
  • Imaging tab — Time Travel, ROI panel, SEM panel, Autofocus, Kensho BSED, Data Overlays, Monitoring (Generic SEM only), and Scripting.

Bottom Bar

  • Left — Application version, Settings icon, and User Manual icon.
  • Right — Console panel button (with error and warning counts), SEM selector / connection status, and microtome (katana USB) connection status.

3.3 Main Viewport

The central area displays your sample and ROIs.

Navigation

  • Pan: Click and drag (or Space + drag)
  • Zoom: Mouse scroll wheel
  • Fit to View: Button to show all ROIs

Keyboard Shortcuts

Cursor must be over the viewport. See Section 19 for the full shortcuts reference.

KeyAction
VSelect tool
HHand/Pan tool
DRectangle/ROI drawing tool
IInvert tile selection
Numpad 0Cycle through ROIs
Numpad .Jump to current SEM stage position
1 2 3 4Zoom to 1:1, 2:1, 3:1, 4:1 pixel ratio
Space (hold)Temporary hand tool for panning
EscapeCancel operation / cycle tools
Ctrl/Cmd+ZUndo
Ctrl/Cmd+Shift+ZRedo
' (apostrophe)Open the Selection Scope picker — pick an ROI to scope subsequent selections to

Right-click Context Menu

Right-clicking inside the viewport opens a context menu whose contents depend on what you click on:

  • Right-click a tile — quick actions for that tile (capture, mark for autofocus, enable/disable, etc.).
  • Right-click an ROI label or a preview image — actions on that ROI / preview.
  • Right-click empty viewport — viewport-level actions (paste, fit to view, etc.).

Selection Scope (Apostrophe)

Press the ' apostrophe key while the cursor is over the viewport (Select or Hand tool) to bring up the Selection Scope picker. Pick an ROI to scope subsequent selections to that ROI — only tiles inside it can be selected, which is useful when ROIs overlap or sit close together. Press Esc or ' again to clear the scope.

Mouse Shortcuts

ActionInput
ZoomScroll wheel (15% per step)
Fine zoomShift + Scroll (3% per step)
Add to selectionCtrl/Cmd + Click
Remove from selectionAlt + Click
Lasso selectionShift + Drag
Select parent ROIDouble-click a tile
Context menuRight-click

Interactions

  • Click ROI name → Expands ROI in panel to show settings
  • Click tile → Selects the tile
  • Click and drag on empty space → Create new ROI

3.4 Bottom Status Bar

The bottom status bar contains critical connection controls and status indicators.

Figure 3.4: The bottom status bar with connection controls and status indicators

Left Section

  • Acquisition status (IDLE, RUNNING, STOPPED, COMPLETED)
  • Current cycle number
  • Progress indication

Center/Right Section — Connection Controls

  • SEM Dropdown: Click to select SEM type and connect/disconnect
  • Microtome/USB Indicator: Shows connection status; click to connect/disconnect
  • Console Panel Button (far right) — shows error/warning counts

3.5 Console Panel

Opens by clicking the button in the bottom-right corner.

Five Tabs

  1. Logs: The full chronological stream of system messages emitted by the frontend and backend — connection events, command dispatches, acquisition milestones, database writes, and anything else the application reports. Use this tab to trace what Samurai is doing at any given moment.
  2. Z Movement: A dedicated view of the microtome Z-axis position over time, useful for verifying cut and retract moves, checking step thickness, and diagnosing Z-drift during long runs.
  3. Warnings: A filtered view showing only warning-level entries pulled from the Logs tab — issues that did not stop the run but are worth reviewing (e.g., autofocus drift beyond threshold, skipped tiles, debris detections, recovered errors).
  4. Errors: A filtered view showing only error-level entries — failures such as lost hardware connections, command timeouts, or database write errors. Items here usually require operator attention.
  5. Terminal: Direct communication with the katana microtome using serial commands, intended for debugging purposes. Type a command, press Enter, and the response is printed below.
Figure 3.5: The Console Panel showing logs with color-coded severity levels

10.Connecting Equipment

4.1 SEM Connection

Supported SEMs

SEMConnectionNotes
TESCAN (Clara, Mira, etc.)TCP via SharkSEM APIFull integration: imaging, stage, focus, stigmation
Zeiss SmartSEMWindows COM APILocal API — SmartSEM must run on the same PC (no IP needed)
Hitachi SU7000TCPImaging and stage control
Hitachi SU3800TCPImaging and stage control
Hitachi SU3900TCPImaging and stage control
CIQTEK SEM5000TCPImaging and stage control (resolution: 10–8448)
FEI QuantaCOM/DCOM over TCPVia FEI xTLib; requires hostname/IP of the FEI microscope PC
FEI NovaCOM/DCOM over TCPVia FEI xTLib; requires hostname/IP of the FEI microscope PC
Generic SEMN/AFor SEMs controlled by their own software; Samurai handles microtome + image monitoring
Mock SEMLocalSimulated SEM for testing without hardware

Connecting

  1. Find the SEM dropdown in the bottom status bar
  2. Click to select your SEM type
  3. Click Connect
  4. Status turns yellow (connecting) then green (connected)
Figure 4.1: The SEM dropdown menu showing available SEM types

SEM Settings

Next to the SEM dropdown is a Settings (gear) button that opens the SEM configuration dialog. Use it to set the connection details and behaviour for the selected SEM:

  • IP address and port for TCP-based SEMs (TESCAN, Hitachi, CIQTEK, FEI)
  • Detector selection from the SEM's available detectors
  • Reverse X, shared-drive path for image transfer, and capture-screen choice (where applicable)

Some settings — IP address, port, and shared-drive path — must be configured before connecting. Others, such as detector selection, can only be set after a successful connection because they depend on what the SEM reports as available.

If Connection Fails

  • Make sure the SEM's own software (e.g., TESCAN Essence, Zeiss SmartSEM, Hitachi SEM software, FEI xT UI) is running
  • Verify SEM is powered on and not in power-save mode
  • Check the IP address and port in SEM Settings match the SEM PC
  • Check network connectivity (most SEMs use TCP connections)
  • Ensure no other software is controlling the SEM
  • Check Console Panel for error messages

4.2 Microtome Connection

  1. Ensure the katana microtome USB cable is connected to your computer
  2. Find the Microtome indicator in the bottom status bar
  3. Click to Connect
  4. Once connected, the Z position displays

Cable Connection Status

The microtome indicator shows the live state of the USB cable to the katana:

IndicatorMeaning
Connected — the katana is reachable and reporting state
×Disconnected — the cable was lost. Reconnect before continuing; if Z drifted, lower the stage by >2 µm and re-approach
?Status unknown — Samurai has not yet received a cable status update (typically immediately after launch or before the first connection attempt)

4.3 Connection Status Indicators

ColorMeaning
GreenConnected and ready
YellowConnecting
RedDisconnected or error

4.4 Generic SEM Mode

If your SEM is not directly supported, you can use Generic SEM mode. In this mode:

  • Samurai does not control the SEM through a native API. Instead, all interaction with the SEM — triggering acquisition, changing parameters, etc. — is done via scripting, configured in the Scripting panel
  • Samurai controls the katana microtome (cutting) and monitors a folder for new images
  • The Monitoring Panel watches a designated folder for new image files and loads them into the viewport automatically
  • You can set filename filters to match only specific images
  • Mipmaps are generated automatically for large images to keep the viewport responsive
  • Time Travel and cycle tracking still work, organized by detected images
Part III · Your First Experiment

11.Managing Experiments

5.1 Creating a New Experiment

  1. Click New Experiment
  2. Enter experiment name
  3. Choose save location
  4. Click Create

This creates a database file and image storage folder.

Figure 5.1: The New Experiment dialog where you name and save your experiment

5.2 Loading an Existing Experiment

  1. Click Load Experiment
  2. Navigate to experiment database (.db file)
  3. Select and click Open

All ROIs, cycles, settings, and progress are restored.

5.3 Experiment Files and Storage

experiment_folder/
├── experiment.db      (database)
├── ROI_0/
│   ├── cycle_001/
│   │   ├── A1.tif
│   │   ├── A2.tif
│   │   └── ...
│   └── cycle_002/
└── ROI_1/

Changes are saved automatically — there is no manual save needed.

5.4 Understanding the Experiment Workflow

Samurai experiments have three distinct phases:

Phase 1: Setup

  • Perform focus and alignment on the SEM using the SEM's own software (e.g., TESCAN Essence)
  • Use the Preview button (camera icon ) in the SEM panel to grab a preview image. Previews usually have a large field of view, which makes them helpful for locating your area — typically grab one that covers the whole block
  • Create and position ROIs on the preview image
  • Adjust ROI sizes and tile grids
  • Set imaging parameters (dwell time, pixel size, image dimensions)
  • Disable any tiles you don't want to image
  • Set up autofocus: either mark tiles as autofocus tiles, or choose a different autofocus method in the Autofocus panel
  • Decide whether to enable debris detection and any related per-cycle quality settings

Phase 2: Generation (Click "Generate Cycles")

Enter the number of cycles you want to perform, then click the Generate Cycles button (the purple list-plus icon next to the Total Cycles field):

Samurai will:

  • Create cycle entries in the database (one per slice)
  • Calculate expected Z positions for each cycle
  • Create cycle-specific copies of your ROI and tile settings
  • Make the Time Travel system available — you can jump to any future cycle and pre-set parameters that should differ from the current cycle (predicted parameter changes apply from that cycle onwards)
  • Automatically lock all ROIs so they cannot be moved or resized accidentally

Phase 3: Active Experiment (After Generation)

Once cycles are generated:

  • Time Travel navigation — use Time Travel to jump between cycles and review the images acquired in each one
  • ROI resizing — ROIs are locked, so you cannot resize or move them by default. To change one, you must manually unlock it first (see the warning above about data misalignment)
  • Summary table and cycle generation — once cycles are generated, all per-cycle actions are available, but the summary table is locked. Unlock it before making changes that affect the overall plan
  • Change propagation — any change you make propagates forward only. When you use Time Travel, edits affect the current cycle and all cycles after it; you cannot retroactively change cycles that have already happened

Summary

ActionBefore GenerationAfter Generation
Create ROIFull flexibilityApplies to current cycle onward
Delete ROINo consequencesRemoves from all cycles
Resize ROITiles regenerateTiles regenerate, images preserved
Move ROIFull flexibilityPosition updates
Disable tilesSets default stateApplies current cycle onward
Change pixel sizeTiles resizeAffects future cycles
Change dwell timeSets defaultPropagates forward

12.The Approach Procedure

12.1 Why Approach is Required

The sample block must be brought to the knife at the correct cutting plane. The diamond knife cannot take cuts thicker than ~200 nm without damaging the sample or itself, so you must carefully position the sample so that the block face is at the correct height and the knife will cut a thin, even slice across the entire surface.

12.2 The Optical Camera (Digital Viewer)

The approach uses the Digital Viewer — the optical camera mounted on the microtome during approach. Through the camera, you observe:

  • The knife edge as it passes over the sample
  • The reflection or shadow cast by the knife on the block face
  • How close the knife is to actually cutting
Before contact
Before contactReflection of the blade visible on the sample surface
At the cutting plane
At the cutting planeThe blade is now cutting material across the full block face
Figure 12.1: The Digital Viewer camera view during approach. As the stage rises, the reflection of the blade narrows until the knife contacts the sample and cuts cleanly across the entire block face.

12.3 The Approach Procedure Step-by-Step

The approach proceeds slowly to avoid damage to the diamond knife. For a well-stained, resin-embedded biological sample the knife must be positioned approximately 200 mm from the sample for a fully retracted position before approach begins.

Phase 1 — Manual approach (coarse positioning)

  1. Position the digital viewer over the microtome.
  2. Use the Find Zero arrow in Samurai to drive the stage to its lowest position.
  3. Turn on the Digital Viewer in Samurai and adjust brightness and contrast.
  4. Move the knife so that the diamond is directly above the sample.
  5. Using the Up arrow, raise the sample in small steps while the knife moves across the sample.
  6. Watch the camera — a shadow or reflection of the blade appears on the top surface of the sample.
  7. Repeat: raise the stage slightly, sweep the knife across, observe.
  8. Continue until the reflection is just a fast setting (5 µm/s or higher) above the sample, using slow and fine-tuned manual steps. At this point the diamond should be in focus.

Phase 2 — Automated approach (fine positioning)

  1. In the AUTO tab, set the cut thickness to 200 nm and the cut speed to a fast setting (6 mm/s or higher).
  2. Click the Start button to begin the approach and monitor the blade for the appearance of debris.
  3. The knife will likely start by cutting a corner of the sample — wait until the entire surface is being sectioned before pressing Stop.

Phase 3 — Completing the approach

  1. Remove the optical camera from the microtome.
  2. Blow debris away from the block face with a mild, dry air or nitrogen source.
  3. Close the SEM chamber door and initiate chamber pump-down.
  4. Lower the katana stage by 2 µm to account for any sample volume changes in the vacuum.
  5. Once the desired vacuum level is reached, perform a few approach cycles, cutting at least 2 µm so that the knife contacts the sample surface again.
  6. Proceed with a few slow sectioning cuts at a speed of 0.1 mm/s to create a smooth surface ready for imaging.
  7. Switch to the Imaging tab and begin your experiment setup.

12.4 Approach Cutting Parameters

Figure 12.2: The cutting-parameters controls used during the approach procedure.

12.5 Z Position and the Relative Encoder

The microtome uses a relative position encoder. Position is maintained as long as the controller remains powered on. When the controller is first powered on, execute the Find Zero command — the stage drives down to a mechanical hard stop and defines that as zero. From that reference, all subsequent moves are tracked.

Z values are in micrometres (µm). Higher values = stage is higher (toward the cutting plane); lower values = stage is lower (away from the cutting plane).

13.Imaging Parameters

6.1 SEM Panel Controls

All imaging parameters are in the SEM Panel, located in the right sidebar of the Imaging tab.

Figure 6.1: The SEM Panel with all imaging parameter controls

6.2 Beam Voltage (kV)

Beam voltage controls how energetically electrons strike the sample, which in turn affects how deep the beam interaction extends, how much damage it leaves behind, and how much signal you collect. For SBF-SEM on biological samples, the typical operating range is 2–4 kV.

Higher kV

  • Stronger signal and better signal-to-noise ratio
  • Greater penetration depth — electrons interact further into the block
  • More beam damage per cycle, especially for delicate biological resins

Lower kV

  • More surface-sensitive — the interaction volume is shallower, so the image reflects features closer to the block face
  • Less beam damage per cycle
  • Weaker signal — may need longer dwell time or larger pixels to compensate

Why kV matters when cutting thinner

The interaction volume of the beam scales roughly with kV. If you cut sections that are thinner than the penetration depth, the beam will sample material from below the current block face — so the image you record on cycle N already contains signal from what would normally be cycle N+1 or N+2. This blurs Z-resolution and undermines the point of cutting thin in the first place.

As a rule of thumb, lower the kV when you reduce slice thickness. For typical SBF-SEM:

  • Sections of ~50–100 nm work well around 3–4 kV
  • Thinner sections (≲30 nm) usually need to drop toward 1.5–2 kV to keep the interaction volume within one slice

Trade-offs

  • Penetration depth vs Z-resolution: higher kV penetrates deeper and degrades effective Z-resolution; lower kV preserves it but gives less signal
  • Signal vs damage: a stronger signal at higher kV comes with more cumulative beam damage to the resin and to features near the surface
  • Dwell time vs throughput: when you drop kV to cut thinner, you often need to compensate with a longer dwell time, which slows acquisition
  • Practical settling point: most biological SBF-SEM workflows settle at 2–4 kV as the best compromise between signal, damage, and Z-resolution

6.3 Field of View

Physical area captured in one image (in µm).

  • Larger FoV: More area, lower resolution per feature
  • Smaller FoV: Higher magnification, more detail

6.4 Image Dimensions

Width and height in pixels. Available resolutions depend on your SEM type:

  • TESCAN: Presets from 512 to 16384
  • Hitachi: Fixed set (640, 1280, 2560, 5120)
  • CIQTEK: Range 10–8448
  • Other SEMs: Varies by model

Default for most configurations: 2048 × 2048. More pixels = more detail but slower acquisition.

6.5 Dwell Time

How long the beam stays at each pixel.

  • Longer: Better signal, slower
  • Shorter: Faster, noisier

6.6 Taking Preview Images

  1. Set imaging parameters
  2. Click Grab Image
  3. Preview appears in the viewport
  4. The preview is mainly used to capture a large field of view of the block face — use it as a reference image to mark out your regions of interest before placing tile grids
Figure 6.2: A preview image captured in the viewport using the Grab Image button

14.Optimising Conditions

Getting consistent, high-quality SBF-SEM data is a balance between three competing factors: how thin you want to cut, how much signal you want per image, and how little beam damage you can tolerate. This chapter outlines the trade-offs and a typical “sweet spot” for well-stained resin-embedded biological samples.

14.1 Section Thickness

Typical SBF-SEM experiments acquire data with sections between 30–50 nm thick, with the possibility of achieving 15 nm sections under highly optimised conditions. For a more typical scenario with a well-stained resin-embedded biological sample, you can expect to hit a lower limit of approximately 25 nm. Some other materials (such as soft metals like aluminium) can be expected to cut cleanly at lower thicknesses.

14.2 Dose and SNR Trade-offs

There is a complex trade-off between electron dose on the sample (and hence image quality) and cutting performance. Some extreme examples illustrate the range:

  • If you use a very low electron dose (<1 e/nm²) then you can cut cleanly at low thicknesses such as 15 nm. However, this approach has diminishing returns since resolution will then be limited by image noise.
  • If you are taking multiple images per cut, or a very high signal-to-noise ratio (SNR) image, or using a very small pixel size, then you may need to cut thicker (e.g. 100 nm) to maintain clean and uniform cutting.
  • If you use a more sensitive BSE detector, you can get the same SNR from a lower electron dose, so you can cut thinner.

14.3 The SBF-SEM Sweet Spot

The SBF-SEM technique usually has a “sweet spot” where it is easy to operate and get good results:

14.4 Knife Oscillation Frequency

Knife oscillation frequency has been demonstrated to have an effect on minimum achievable cutting thickness for a given sample, as well as on cut quality. 5, 12, and 37 kHz are known to produce good in-plane oscillations. However, this is sample dependent — if cutting performance is not ideal, please experiment with other frequencies.

Oscillator frequency and amplitude are set in the Imaging tab's cutting parameters. See Chapter 18: Running an Acquisition for details.

15.Regions of Interest

7.1 What is an ROI?

A Region of Interest (ROI) defines a rectangular area of your sample to image. ROIs are the fundamental building blocks of your experiment.

An ROI is made up of tiles. The ROI itself is just the boundary you drew; the actual image data lives in the tiles. Because each tile has a fixed pixel count, the tile grid may not exactly match the ROI rectangle — the ROI can be slightly larger than the combined tiles, but only the tiles contain image data.

Each ROI has:

  • Position (X, Y): Location on the sample stage in millimetres
  • Size (Width × Height): Physical dimensions of the drawn boundary
  • Tile Grid: Automatically generated array of tiles that covers as much of the ROI as possible at the current pixel size and tile dimensions
  • Imaging Settings: Pixel size and dwell time applied to the tiles

ROIs are numbered automatically (ROI_1, ROI_2, …) as you create them. When you draw an ROI, Samurai generates the tile grid in place to cover as much of the drawn area as it can at the chosen settings.

7.2 Creating ROIs

Video 7.1: Creating an ROI using click-and-drag on the viewport

Click and Drag

  1. Navigate the viewport to see the area you want to image
  2. Ensure you're in the Imaging Tab
  3. Press D to activate the draw tool (or select it from the toolbar)
  4. Click and hold at one corner of the desired area
  5. Drag to the opposite corner — you'll see the ROI rectangle preview
  6. Release to create the ROI

When you release, a new ROI panel appears in the right sidebar for the ROI you just drew. Use it to set that ROI's parameters — tile width and height, pixel size, dwell time, image-every cycles, and overlap — see Section 7.3 for the full list.

7.3 ROI Settings

Click the ROI name in the ROI Panel list (or click the ROI label in the viewport) to access settings.

Figure 7.1: ROI Settings panel showing editable properties for a selected ROI

Editable Properties

  • Width × Height (px): The pixel dimensions of each tile. Combined with the pixel size, this sets the physical tile footprint
  • Pixel Size (nm/pixel): Determines image resolution. Changing this regenerates the tile grid
  • Dwell Time (µs): How long the beam stays at each pixel
  • Image Every (cycles): Acquire this ROI once every N cycles instead of every cycle
  • Overlap (%): Percentage overlap between adjacent tiles, useful for stitching

The panel also reports the ROI's physical size in pixels, the resulting tile grid (e.g. 9 cells (3 × 3)), and the estimated imaging time for the ROI, so you can see the effect of any setting change immediately.

Lock Toggles

Three lock icons in the ROI panel constrain how the tile grid responds when you change a setting:

  • Grid lock (next to the grid read-out) — when locked, the tile count stays the same. Changing pixel size or overlap will adjust the ROI's physical size instead of changing the number of tiles. Useful when you want a fixed grid layout (e.g. always 3 × 3) regardless of other settings
  • Pixel size lock (next to Pixel Size) — when locked, changing the tile dimensions changes the physical size of each tile. When unlocked, changing the dimensions instead adjusts the pixel size to keep the tile's physical footprint constant
  • Aspect ratio lock (between Width and Height) — when locked, editing one of width or height automatically updates the other to preserve the original W : H ratio

7.4 Moving and Resizing ROIs

Moving an ROI

  1. Select the Hand tool (press H or pick it from the toolbar)
  2. Click and hold on the ROI in the viewport
  3. Drag to the new position and release to confirm

Resizing an ROI

  1. Hover over an edge or corner of the ROI
  2. Cursor changes to a resize indicator
  3. Click and drag to resize, then release to confirm

Snap While Moving

Two snap toggles in the viewport toolbar constrain ROI movement and creation:

  • Snap to grid — snaps the ROI's top-left corner to the nearest minor grid line on the viewport. Useful for aligning ROIs to a regular reference
  • Snap to tile — moves the ROI in steps the size of one tile (accounting for overlap). Useful for stepping an ROI cleanly onto an adjacent tile boundary without breaking the grid alignment

The two snap modes are mutually exclusive — enabling Snap to tile disables Snap to grid.

7.5 Deleting ROIs

  1. Select the ROI (click in viewport or ROI Panel)
  2. Click the Delete button (trash icon) in the ROI Panel
  3. Click the tick that appears to confirm

Captured images remain in the file system — they are not automatically cleaned up.

7.6 ROI Locking

Locking an ROI prevents accidental modifications during long experiments. ROIs are automatically locked when you generate cycles (see Section 5.4 — Phase 2), so the tile grid cannot drift relative to the data already acquired.

  1. Select the ROI
  2. Click the Lock icon (padlock) in the ROI Panel
  3. Click again to unlock — you can always unlock a locked ROI if you need to make a change, but be aware that modifying a locked ROI that already contains acquired data can cause data misalignment

Locking prevents: moving, resizing, changing settings, deleting.

Locking does NOT prevent: enabling/disabling tiles, capturing previews, normal acquisition.

7.7 Multiple ROIs

Create additional ROIs to image different areas with independent settings. During each cycle, ROIs are imaged in the order they appear in the ROI Panel list.

Figure 7.2: Multiple ROIs on the viewport, each with independent settings and tile grids

Typical experiments use 1–5 ROIs. Each ROI can have different pixel size, dwell time, tile enable/disable patterns, and autofocus designations. You can also use dedicated ROIs for tasks that don't produce final data — for example, a small ROI placed away from your imaging area and used solely as an autofocus reference, so the focus routine doesn't burn beam dose into the regions you actually want to record.

16.Working with Tiles

8.1 What are Tiles?

Tiles are individual image positions within an ROI. Each tile represents a single SEM image captured during acquisition.

Tile Naming Convention

Tiles are labelled by column letter and row number (e.g. A1, B2, C3; columns continue Z, AA, AB, … for very large grids). This naming is used in the saved image filenames in the experiment folder — you don't normally see it in the application UI.

Per-Tile Read-outs

Each tile in the grid displays two live read-outs:

  • Imaging time — the time it takes to acquire that tile at the current dwell time and image dimensions
  • Electron dose — the dose delivered to that tile, calculated from the live probe current, dwell time, and pixel size

Both values update immediately when you change a tile or ROI setting, so you can see the impact before you start the run.

Figure 8.1: Tile grid within an ROI showing the column-row naming convention

8.2 Tile Grid Generation

When an ROI is created or modified, Samurai automatically generates a grid of tiles. The tile size is calculated as:

Tile Width (mm)  = (Image Width in pixels × Pixel Size in nm) / 1,000,000
Tile Height (mm) = (Image Height in pixels × Pixel Size in nm) / 1,000,000

The grid is regenerated when you resize the ROI, change pixel size, or change image dimensions.

8.3 Enabling and Disabling Tiles

Disable tiles to skip empty or uninteresting areas and reduce acquisition time.

Method 1: Individual Tile

  1. Hover over a tile in the ROI Panel tile list
  2. Click the Ban icon (circle with line) that appears on hover
  3. Click again to re-enable

Method 2: Multiple Tiles

  1. Select multiple tiles using selection methods (see below)
  2. Click the Ban icon on any selected tile
  3. All selected tiles toggle their disabled state

8.4 Tile Selection Methods

MethodAction
Single clickSelect one tile (clears previous)
Ctrl+Click / Cmd+ClickAdd/remove from selection
Shift+ClickSelect range
Rectangle toolDraw selection box in viewport
Lasso toolDraw freeform selection shape

Drag Direction Changes Selection Mode

When drawing a selection box in the viewport, the direction of your drag changes which tiles get selected:

  • Drag to the right (end point to the right of start) — touch selection. The box is drawn as a solid blue outline and selects any tile the box touches, even partially
  • Drag to the left (end point to the left of start) — enclosed selection. The box is drawn as a dashed green outline and selects only tiles that are fully inside the box
Video 8.1: Using selection tools to select and disable tiles

8.5 Tile Operations

Capture Individual Tile

Hover over a tile in the ROI Panel and click the Camera icon to capture a preview image.

Mark for Autofocus

Hover over a tile and click the AF button. The button highlights cyan when active. Choose tiles with high-contrast, stable features.

Center Viewport on Tile

Click the Crosshair icon on a tile to center the viewport on it.

Figure 8.2: Tile action icons that appear on hover in the ROI Panel

8.6 Viewing Tile Information

Hover over a tile in the viewport to see its name, position coordinates, size, and capture status.

8.7 Tile Images

Captured tile images are stored as TIFF files:

experiment_folder/ROI_0/cycle_001/A1.tif
experiment_folder/ROI_0/cycle_001/A2.tif

Thumbnails (mipmaps) are generated for fast viewport display. Full-resolution images are available in the file system.

17.Cycles & Time Travel

9.1 Understanding Cycles

A cycle represents one complete iteration of the imaging-and-cut process. Each cycle produces one "slice" of your 3D dataset. The order of operations within a cycle is:

  1. 1. IMAGING ADDITION
    If enabled, raise the stage by the configured offset to bring the block face into the imaging plane
  2. 2. AUTOFOCUS
    If scheduled for this cycle, run the autofocus routine (and auto stigmation, if enabled) on marked tiles
  3. 3. IMAGING
    For each ROI in order, move the stage to each enabled tile and capture the image. Scripts attached to roi_arrival, tile_arrival, and acquisition_complete triggers fire during this phase
  4. 4. BEFORE-CUT SCRIPTS
    Run any scripts configured with the before_cut trigger
  5. 5. CUTTING
    Move stage to cut position → execute cutting stroke → retract knife → record Z position
  6. 6. AFTER-CUT SCRIPTS
    Run any scripts configured with the after_cut trigger
  7. CYCLE COMPLETE — Proceed to next cycle

On the very first cycle, the after-cut scripts run at the start (before imaging) so that the initial block-face surface can be captured.

9.2 Time Travel Feature

Time Travel allows you to navigate through cycles to view past data or make cycle-specific changes.

Figure 9.1: The Time Travel control for navigating between cycles

Navigate using:

  • Drag the clock icon for continuous cycle scrubbing
  • Mouse wheel scroll over the control to step through cycles
  • Direct input — click the cycle number and type a specific cycle
  • Home to jump to the first cycle, End to jump to the last

Visual Indicators

  • Current cycle: Normal appearance
  • Past cycle: Sepia/amber border
  • Future cycle: Purple border
Figure 9.2: Viewing a past cycle through Time Travel with captured images displayed

9.3 Cycle-Specific Modifications

Time Travel enables per-cycle customization:

  • Tile enable/disable states — skip certain tiles for specific cycles
  • Tile dwell times — use longer exposure for certain slices
  • Autofocus scheduling — run autofocus only on certain cycles
  • ROI positions — adjust ROI location for specific cycles (advanced)

Example: Skip Damaged Area Temporarily

  1. Navigate to cycle 50
  2. Disable tiles over a damaged region
  3. Re-enable them at cycle 60 when damage clears

9.4 Forward Propagation

Changes propagate forward automatically:

  • Change at cycle N → affects cycles N, N+1, N+2, …
  • Cycles 1 through N−1 are not affected

To create a "break point," navigate to a future cycle and make a different change there.

18.Running an Acquisition

10.1 Cutting Parameters

Slice Thickness

Amount of material removed per cut. Typical range: 20–200 nm. Thinner slices give you more Z resolution, but also mean:

  • A longer experiment overall — more cycles are needed to cover the same volume
  • A much lower dose per tile, so the same resin takes more cuts before it fails
  • A correspondingly lower kV (see Section 6.2) so the beam's interaction volume stays within one slice. Without this, the image on cycle N samples material you've not yet cut, blurring the Z-resolution you just paid for

Slice thickness doesn't stand alone — pick it alongside kV, cut speed, and retract clearance as a group.

Cut Speed

Speed of the knife during cutting stroke. Slower = cleaner cuts. Faster = quicker cycles but may cause compression artifacts.

Retract Clearance

Distance the knife retracts after cutting. Typical values are 300 µm and above — enough clearance to move the stage freely without risk of contact.

Oscillator Settings

Diamond knife oscillation reduces cutting artifacts and improves surface quality. Turn oscillation on and leave the frequency at one of the built-in presets — the presets are generally good for most samples. Only change the frequency or amplitude if you see cutting artifacts.

Manual Cut Commands

Three buttons in the Imaging tab fire single cuts on demand, useful for trimming the sample between automated runs. Each click triggers exactly one cut — clicking the 100 nm button ten times performs ten 100 nm cuts.

ButtonCut amount
FineUses the slice thickness, cut speed and other values from the Microtome Settings in the Imaging tab
100 nm100 nanometres per click
200 nm200 nanometres per click

10.2 Dwell Time Ease-In

Gradually increases dwell time over the first N cycles to reduce initial beam damage on fresh sample surfaces.

ModeDescription
OffNo ease-in; full dwell time from the start
NowEase-in ramp starts from the current cycle
NextEase-in ramp starts from the next cycle

Example with 10 ease-in cycles:

  • Cycle 1: 10% dwell time
  • Cycle 5: 50% dwell time
  • Cycle 10: 100% dwell time
  • Cycle 11+: 100% dwell time

10.3 Starting Acquisition

  1. Navigate to Imaging Tab
  2. Ensure you're at the starting cycle
  3. Click the Play (▶) button

Samurai verifies SEM connection, microtome connection, generated cycles, and at least one enabled tile before starting.

10.4 Monitoring Progress

Status Bar and Cycle Action List

  • Status: IDLE, PENDING, RUNNING, STOPPING, STOPPED, COMPLETED
  • Current Cycle: X of Y, with cumulative ΔZ and elapsed/remaining time
  • Cycle Action List: shows the current step (e.g. NOW Imaging ROI_2 - A2) and groups remaining work by ROI (e.g. ROI_1 9/9, ROI_2 2/4) followed by the cut step at the configured Z position
Figure 10.1: Status bar and the expanded cycle action list during an active acquisition, showing progress, ΔZ, elapsed/remaining time, the current step, and per-ROI tile counts.

Skip Options

During acquisition, you can skip operations:

  • Skip All Cycle Tiles — skips remaining tiles, proceeds to next cycle
  • Skip ROI Tiles — skips one ROI, others continue
  • Skip Individual Tile — skips a single tile

10.5 Pausing and Resuming

  • Pause: Click Pause (❚❚) — current operation completes before pausing
  • Resume: Click Play (▶) — acquisition continues from where it stopped
  • Stop: Click Stop (■) — halts acquisition; all progress is saved
Part IV · Advanced Features

19.Autofocus & Autostig

13.1 Purpose of Autofocus

During long SBF-SEM acquisitions (often running for days or weeks), optimal focus can drift due to thermal changes, sample charging, or mechanical drift. Autofocus automatically corrects the working distance (WD) to maintain sharp images.

13.2 Autofocus Methods

Samurai offers two methods, selectable in Settings > Autofocus > Method:

SEM Built-in

Uses the SEM manufacturer's built-in autofocus routine. Simplest to use — no additional configuration required. Choose this when you trust the SEM's own autofocus and don't need finer control.

Heuristic Autofocus

An autocorrelation-based method adapted from Briggman et al. (2011). More configurable and better suited to long SBF-SEM runs where focus drift needs to be tracked and corrected slowly. The routine:

  1. Captures images at slightly different working distances (current WD ± delta)
  2. Computes autocorrelation and analyzes the result with weight-function masks
  3. Determines the direction and magnitude of the needed correction
  4. Adjusts the working distance proportionally (PID Kp gain)

Focus metrics: Image Variance, Power Image Variance, Log-Ratio Multiscale, Autocorrelation Estimator, Composite Focus.

Key features: outlier detection, gradient consistency check, chase mode for large drift, WD trend tracking.

Figure 13.1: The Autofocus settings panel with method selection and configuration parameters

13.3 Marking Autofocus Tiles

  1. In the ROI Panel, select a tile
  2. Right-click and choose "Mark for Autofocus"
  3. The tile highlights to indicate it's an AF reference tile

Choose tiles with: high-contrast, stable features (e.g., cell membranes, resin boundaries). Avoid tiles with large empty resin areas.

13.4 Autofocus Settings

Per-experiment options (method, interval, tracking mode, autostig toggle) are set from the Autofocus panel in the right sidebar of the Imaging tab.

Algorithm parameters (WD perturbation, PID Kp, safety limits, chase mode, WD trend, gradient consistency, focus metric) live in Chapter 23: Settings under Imaging → Heuristic Autofocus. See that chapter for the full list of options, defaults and valid ranges.

13.5 AF Metrics Dialog

Access from the ROI Panel by clicking the AF metrics button on an autofocus tile. Displays:

  • Estimated Diff: Focus estimator value over time
  • Image Variance: Raw image sharpness metric
  • WD History: Corrected working distance over time
  • Gradient Values: Consistency check results
  • Chase Mode Status: Active/direction indicators
Figure 13.2: The AF Metrics Dialog showing real-time autofocus performance graphs

13.6 Troubleshooting Autofocus

  • Focus not converging: Check tile contrast, increase WD delta, reduce PID Kp
  • Corrections too slow: Increase PID Kp, enable chase mode, decrease interval
  • Too many outlier rejections: Lower outlier threshold or set to 0 to disable

20.Debris Detection

12.1 What is Debris Detection?

Debris detection monitors the block face for contamination as you image. During SBF-SEM the knife can leave debris on the surface, which obscures features, causes imaging artifacts, and accumulates over cycles. When debris is detected on a tile, Samurai automatically sweeps the knife and re-images that tile before continuing.

12.2 Enabling Debris Detection

  1. Navigate to the Imaging Tab
  2. In the microtome controls, toggle Debris Detection ON
  3. Choose which ROI to use as the detection ROI (debris detection runs on tiles within this ROI)
  4. Open Settings > Debris Detection to configure the parameters described below

12.3 Configuration Parameters

The four parameters below cover everything you typically need to tune. For the same settings with explicit ranges and UI labels, see Chapter 23: Settings under Imaging → Debris Detection.

Kernel Size

  • Median filter size used when comparing the current image with the previous cycle
  • Range 3–15 (must be odd); default 7
  • Smaller kernel detects smaller debris particles; larger kernel focuses on larger debris

Threshold (% of pixels)

The threshold is now expressed as a percentage of pixels that have changed between the previous and current image, not an absolute diff sum. This makes the value image-size independent — the same setting works for any tile resolution.

  • Range 0–100 %; default 50 %
  • Lower % → more sensitive, more false positives
  • Higher % → less sensitive, may miss small debris

Max Sweep Retry

How many sweep attempts to make on a single tile before giving up. Range 1–10; default 3. The retry count resets at the start of each cycle.

On Max Sweeps

What to do when the max retry count is reached on a tile:

  • Continue (default) — log a warning and proceed with the rest of the run
  • Stop — gracefully stop the acquisition so you can intervene

12.4 Detection Workflow

Debris detection runs inline during imaging, not as a separate cycle phase. For each tile in the detection ROI, immediately after the image is captured:

  1. 1. CAPTURE TILE
    Tile is imaged as part of the normal Imaging phase
  2. 2. COMPARE WITH PREVIOUS CYCLE
    Compute the percentage of pixels that have changed against the same tile from the most recent prior cycle
IF DIFF % < THRESHOLD
Tile is clean. Update the reference image for next cycle and continue imaging.
IF DIFF % > THRESHOLD
Lower stage to cutting plane → sweep knife → raise stage back → re-image the tile. Repeat up to Max Sweep Retry; if still not clean, apply the On Max Sweeps action.

12.5 Per-Tile Diff Read-out

Each tile in the detection ROI shows a corner badge with its diff result, so you can see at a glance which tiles passed and which triggered a sweep:

  • T 50%   Grey — tile not yet checked this cycle, threshold shown
  • 0.5% < 50%   Green — clean (diff % below threshold)
  • 75.2% > 50%   Red — debris detected (diff % above threshold)

You can also enable the Diff overlay in the viewport toolbar to display the actual diff image on top of each tile, with a green or red border matching the result.

12.6 Tuning Parameters

Too sensitive (false positives): raise the threshold percentage. Not sensitive enough (misses): lower the threshold or reduce the kernel size. Start with the defaults (kernel 7, threshold 50 %), run several cycles, review the per-tile diff badges, and iterate.

21.Scripting & Automation

14.1 Introduction to Scripting

Samurai's scripting system automates custom operations at specific points during the acquisition cycle:

  • Triggering other software applications
  • Adding custom delays or synchronization
  • Automating repetitive manual tasks

Scripts are stored in the main database and are reusable across all experiments.

14.2 The Scripting Tab

Figure 14.1: The Scripting panel with sequence list and trigger-timing badges

14.3 Creating Script Sequences

  1. Click the + button to add a new sequence
  2. Configure properties: name, trigger timing (Before Cut / After Cut)
  3. Click Add Action to add steps
  4. Save and enable the sequence
Figure 14.2: The Script Settings Dialog for creating and configuring sequences

14.4 Script Action Types

Wait Action

Pauses execution for a specified duration (seconds). Use for equipment stabilization or timing gaps.

Serial Port Action

Sends commands to devices via serial port (COM port). Configure connection, command text, response timeout, and retry behavior.

TCP Socket Action

Sends commands over network. Configure host, port, command text, and response handling.

Script Action (External Program)

Executes an external program or script file (.exe, .bat, .py, etc.). Configure path, arguments, timeout, and return value handling.

Autoclicker Action

Automates mouse clicks for controlling software without APIs:

  1. Click Record, position mouse, click to capture coordinates and screenshot
  2. Verify with screenshot preview
  3. Set window title and delay

Wait-for-Pixel-Change Action

Monitors a screen region for visual changes before proceeding. Useful for waiting on external software to finish processing or detecting when a screen element changes state.

14.5 Script Triggers

Standard Triggers

  • Before Cut: Executes before each cutting operation
  • After Cut: Executes after cutting, before imaging

Advanced Triggers

TriggerWhen It Fires
Knife ThresholdWhen the knife reaches a specific position threshold
ROI ArrivalWhen the SEM stage arrives at an ROI position
Tile ArrivalWhen the SEM stage arrives at a tile position
Acquisition CompleteWhen the entire acquisition finishes
ManualTriggered manually by the user on demand

Advanced triggers can also be configured with cycle intervals and direction filters.

Multiple sequences with the same trigger execute in sequence order (drag to reorder).

14.6 Managing Connections

Pre-configure frequently-used serial/TCP connections in the Connections Panel for reuse across sequences.

14.7 Testing Scripts

  1. Save the sequence
  2. Click the Play button next to it
  3. Watch Console Panel for output
  4. Verify expected behavior

22.Viewing Acquired Data

15.1 Image Storage Location

Images are stored as TIFF files in the experiment folder:

ROI_0/cycle_001/A1.tif, A2.tif, ...
ROI_0/cycle_002/...
ROI_1/cycle_001/...

15.2 Viewing Images in Samurai

  • Captured tiles show thumbnails in the viewport at their correct positions
  • Click a tile for a larger preview
  • Use Time Travel to navigate to completed cycles and see captured images
Figure 15.1: Captured tile images displayed as a mosaic in the viewport

15.3 Exporting Data

  • Images are standard TIFF files — compatible with any image analysis software
  • TrackEM2 export utility available for neuroscience workflows
  • Database contains all metadata (timestamps, positions, parameters)
Part V · Reference

23.Settings

The Settings dialog is organised into tabs that match the functional areas of the application. This section documents every setting a regular user can see.

16.1 Accessing Settings

Click the Settings icon (gear) in the application toolbar to open the Settings Dialog. The dialog features a searchable interface with categorised tabs.

Type in the search box to filter settings across all tabs — matching settings are highlighted and non-matching sections are hidden. Clear the search to return to normal view.

Tabs available: General, Microtome, Imaging, Advanced, Kensho (when enabled), and About.

Figure 16.1: The Settings dialog with search and categorised sections

16.2 General

Auto-Connect

  • Auto-connect SEM: Automatically connect to the configured SEM on application startup. (Default: on)
  • SEM to Connect: Which SEM configuration to use for auto-connection. (Shown when Auto-connect SEM is on)
  • Auto-connect Microtome: Automatically connect to the microtome controller on startup. (Default: on)

Colors

Colour pickers that control on-screen overlays and cycle indicators.

  • Overlay Text Color: Colour used for viewport overlay text (grid coordinates, performance overlay, etc.).
  • Overlay Panel Tint: Background tint applied to overlay panels.
  • Past Cycle Border: Viewport border colour when viewing a completed cycle via Time Travel. (Default: sepia/amber)
  • Future Cycle Border: Viewport border colour when viewing a future cycle. (Default: purple)
  • DB Update Border: Viewport border colour shown briefly during database write operations. (Default: red)
  • Overlay Text Effect: Rendering effect for overlay text to improve visibility on varying backgrounds. Options: None, Shadow (dark halo), Outline (contrasting edge), Difference (inverts on background).

16.3 Microtome

  • Warn on Z Re-sync: Show a warning dialog when Samurai detects the microtome Z position has changed unexpectedly (e.g. after a power cycle or manual adjustment). (Default: on)
  • Knife Fast Speed (mm/s): Speed used during knife retract and when the knife moves outside the cutting window. (Default: 5.0, Range: 1.0–20.0)
  • Knife Jog Speed (DAC/s): Speed for manual knife jogging when holding the left or right jog buttons. (Default: 500, Range: 50–1000)
  • Knife Jog Keyboard Shortcuts (A/D): Enable A / D keyboard shortcuts for jogging the knife left and right. (Default: off)
  • Drag Speed: How fast the knife tracks the cursor during a normal diamond drag. Options: Slow, Normal, Fast. (Default: Normal)
  • Shift-Drag Precision: How much the knife moves per pixel of mouse movement while Shift is held. Coarse = faster coverage, less precise. Fine = highest precision, more mouse travel needed. (Default: Normal)
  • Motor Stop Precision: How close the motor must be to the target position before it stops, in encoder counts. Lower values are more precise but may cause the motor to hunt. Increase if the motor oscillates around the target. (Default: 1, Range: 1–5)

16.4 Imaging

Top-level

  • Beam Off on Complete: Automatically turn off the SEM electron beam when an imaging run completes. (Default: off)

Image Quality Validation

The experiment is automatically halted if an image fails these validation checks.

  • Min Standard Deviation: Images with a standard deviation below this value trigger an integrity failure — low std dev indicates a uniform or blank image. Toggle beside the field enables the check. (Default: 10, disabled by default)
  • Max Clipping Allowed (%): Maximum percentage of completely black (0) or white (255) pixels allowed. Images exceeding this are likely over- or under-exposed. (Default: 67%, disabled by default)
  • Max Sequential Failed Tiles Allowed: Stop acquisition after this many consecutive failed tiles. Set to 0 to stop on the first failure. (Default: 0, Range: 0–100)

Debris Detection

Detects debris on the sample surface by comparing pre- and post-cut images and triggers automatic knife sweeps when debris is found.

  • Kernel Size: Size of the median filter applied before computing the difference between the two images. Smooths out fine speckle so it's not counted as debris. Larger = ignores more fine detail (less sensitive); smaller = more sensitive. Must be odd. (Default: 7, Range: 3–15)
  • Threshold (% of pixels): Debris is detected when more than this percentage of pixels in the checked tile differ noticeably from the same tile in the previous cycle. Higher = less sensitive; lower = more sensitive. (Default: 50%, Range: 0–100%)
  • Max Sweep Retry: Number of times to sweep and re-image a tile before giving up. (Default: 3, Range: 1–10)
  • On Max Sweeps: Action to take after the retry limit is reached. Continue logs a warning and proceeds (data may be affected); Stop halts the experiment so you can intervene manually. (Default: Continue)

Heuristic Autofocus

These parameters are shown when the Heuristic autofocus method is enabled. See Section 13 for the underlying algorithm and practical workflow.

Core parameters
  • Max Correction (mm): Safety limit — the maximum WD correction applied per cycle. Corrections exceeding this are rejected to prevent runaway drift. (Default: 0.002 mm)
  • WD Perturbation (mm): Alternating ± offset applied to the working distance on each slice. Builds focus estimators that track drift over time. (Default: 0.0005 mm)
  • Proportional Gain (Kp): Scales the focus gradient into a WD correction in micrometres. Larger = bigger corrections per cycle. (Default: 1000, Range: 0–100 000)
  • Outlier Rejection: Per-image metric outlier detection. Set to 0 to disable. If a single image's focus quality drops significantly below the recent level (mean − k×σ), it is excluded from gradient calculations. Typical: 3 (standard), 5 (conservative). (Default: 0, Range: 0–20)
  • Save Diagnostics: Save autocorrelation images and metrics charts to af_diagnostics/ inside the experiment folder each cycle. (Default: on)
Chase Mode
  • Chase Mode: Temporarily boosts Kp when the system detects it is chasing far from focus (consecutive large corrections in the same direction). Exits automatically when corrections drop below the threshold or reverse direction. (Default: off)
  • Threshold (µm): Correction magnitude that triggers chase tracking. (Default: 10)
  • Consecutive Count: Number of corrections above the threshold required to enter chase mode. (Default: 5)
  • Perturbation WD Boost: WD perturbation multiplier while in chase mode — gives a stronger measurement signal. (Default: 4.0×)
  • Proportional Response Boost: Kp multiplier while in chase mode. (Default: 4.0×)
WD Trend Prediction
  • WD Trend Prediction: Fits a 2nd-order polynomial to recent WD values and shifts the perturbation centre by the predicted drift offset. Automatically disabled during chase mode. (Default: off)
  • Trend Window (cycles): Number of recent WD values used for the polynomial fit. (Default: 10, Range: 3–50)
Gradient Consistency Check
  • Gradient Consistency Check: When two gradient pairs differ by more than the configured ratio, zero the correction to avoid wrong-direction moves. (Default: on)
  • Floor: Minimum gradient magnitude required for the check to trigger. (Default: 0.1)
  • Ratio: Maximum allowed ratio between gradient pair magnitudes. (Default: 3.0)
Focus Metric
  • Focus Metric: The metric used as the PID error signal for WD correction. Options:
    • Log-Ratio Multi-Scale (default) — compares autocorrelation power at different radii; robust for most samples
    • Image Variance — total image contrast
    • Image Variance (power) — variance raised to a tunable exponent; shows an additional Power input (default 0.5, range 0.001–1.0)
    • Focus Estimator (Binding) — (fi − fo) / (fi + fo) from autocorrelation
    • Composite Focus — experimental 50/50 blend
  • Correction Mode: Continuous computes and applies a correction every cycle. Grouped (3-image) collects three images at the same WD before correcting — reduces noise from WD changes between measurements. (Default: Continuous)
Sweep Test

A diagnostic tool for tuning. Sweeps the WD over a user-specified range, acquires images, and computes all focus metrics at each step. Results are shown in a chart so you can choose the best metric for your sample. The original WD is restored after the sweep.

Controls: range input in mm (step 0.05, range 0.05–2.0), Run / Stop button, and View Results once a sweep has finished.

Auto Stigmation
  • Auto Stigmation: Enable automatic stigmation correction alongside heuristic autofocus. (Default: off)
  • Max Correction X (%): Safety limit for stigmation X corrections per cycle. (Default: 5.0)
  • Max Correction Y (%): Safety limit for stigmation Y corrections per cycle. (Default: 5.0)
  • Stig X Perturbation (%): ± offset applied to stigmation X each slice to build the estimator. (Default: 1.0)
  • Stig Y Perturbation (%): ± offset applied to stigmation Y each slice. (Default: 1.0)

16.5 Advanced

  • Stage Position Tolerance (µm): Maximum acceptable error between target and actual stage position. If the stage doesn't reach the target within this tolerance the operation is flagged as failed. (Default: 10, Range: 1–1000)
  • SEM Failed Action Retries: Number of retries for failed SEM operations. (Default: 3, Range: 0–10)
  • Microtome Failed Action Retries: Number of retries for failed microtome operations. (Default: 3, Range: 0–10)
  • Require SEM for Acquisition: Block acquisition from starting if the SEM is not connected. (Default: on)
  • Stage Moving Poll Interval (ms): How often to poll the SEM stage position while the stage is moving. Lower values give smoother crosshair updates. (Default: 200, Range: 50–2000)
  • Stage Idle Poll Interval (ms): How often to poll the SEM stage position while the stage is idle. Higher values reduce network traffic. (Default: 500, Range: 100–5000)
  • Viewport Tracking Smoothing: Apply smooth viewport movement when following the stage position crosshair. (Default: on)
  • Generate TrakEM2 Imagelist: Action button — opens a folder picker and exports an imagelist.txt plus a calibration file, ready for use with TrakEM2 for stack stitching.

24.Keyboard Shortcuts

A complete quick-reference of all keyboard shortcuts and mouse interactions in Samurai 3.

19.1 Viewport Tools (Imaging Tab)

Cursor must be over the viewport.

KeyAction
VSelect tool
HHand/Pan tool
DRectangle/ROI drawing tool
IInvert tile selection
1 / 2 / 3 / 4Zoom to 100% / 200% / 300% / 400%
Numpad 0Cycle through ROIs
Numpad .Jump to SEM stage position
Space (hold)Temporary hand tool for panning
' (apostrophe)Open the Selection Scope picker — pick an ROI to scope subsequent selections to. Press ' or Esc again to clear the scope.
EnterComplete polygon selection
EscapeCancel operation / cycle tools

19.2 Mouse Interactions (Viewport)

ActionInput
ZoomScroll wheel (15% per step)
Fine zoomShift + Scroll (3% per step)
Pinch zoomCtrl + Scroll (trackpad)
PanHand tool drag, or Space + drag
Add to selectionCtrl/Cmd + Click
Remove from selectionAlt + Click
Lasso selectionShift + Drag
Polygon selectionShift + Click vertices, close near start
Select parent ROIDouble-click a tile
Context menuRight-click

19.3 Approach Tab — Knife Control

KeyAction
AJog knife LEFT (hold for continuous)
DJog knife RIGHT (hold for continuous)
Ctrl+Shift+KToggle knife debug overlay

Knife jog keys must be enabled in Settings.

19.4 ROI Panel Navigation

KeyAction
/ Navigate between ROIs and tiles
Expand selected ROI
Collapse ROI / deselect tile
EnterConfirm name edit
EscapeCancel name edit

19.5 Time Travel

KeyAction
HomeJump to first cycle
EndJump to last cycle
Mouse wheelScroll through cycles
Drag clock iconInfinite cycle scrubbing

19.6 Global Shortcuts

KeyAction
Ctrl/Cmd + ZUndo
Ctrl/Cmd + Shift + ZRedo
Ctrl/Cmd + YRedo (alternative)

19.7 Studio Tab

KeyAction
HHand tool
VSelect tool
LLine tool
RRectangle tool
BBrush tool
TText tool
0Fit to view
GToggle grid
Ctrl/Cmd + ZUndo
Ctrl/Cmd + Shift + ZRedo

25.Troubleshooting

17.1 Using the Console Panel

The Console Panel is your primary diagnostic tool:

  • Errors tab: Critical issues
  • Warnings tab: Non-critical issues
  • Logs tab: All activity
  • Z Movement tab: Cutting operations

17.2 Common Issues and Solutions

SEM Won't Connect

  • Verify SEM powered on and not in power-save mode
  • Check network connection
  • Ensure no other software controlling SEM

Microtome Won't Connect

  • Check USB cable
  • Verify power to Katana
  • Check COM port in Device Manager

Acquisition Stops Unexpectedly

  • Check Console for errors
  • Verify all connections stable
  • Adjust retry settings if needed

Motor Overheating

If the motor exceeds 71°C, Samurai pauses for a 5-second cooldown and reduces speed. Reduce knife speed, check sample hardness, ensure adequate ventilation.

Encoder Disconnect

If the encoder signal is lost, cutting operations halt. Reconnect the cable and re-establish connection from the bottom status bar.

17.3 Error Messages

ErrorMeaning
"SEM connection timed out"SEM not responding
"Katana command timeout"Microtome communication failed
"Position verification failed"Stage didn't reach target
"Motor OVERHEATED"Motor exceeded safe temperature
"Encoder signal lost"Encoder cable disconnected or fault

17.4 Recovery from Interruptions

  1. Restart Samurai
  2. Load experiment
  3. Verify Z position in Approach Tab
  4. Use Time Travel to find last completed cycle
  5. Resume from next cycle

26.Best Practices

18.1 Experiment Planning

  • Plan ROIs before starting
  • Calculate total time and storage needed
  • Test settings with preview images
  • Document experiment parameters

18.2 During Long Acquisitions

  • Monitor progress periodically
  • Watch Console for warnings
  • Minimize environmental disturbances
  • Only interrupt for genuine issues

18.3 Data Management

  • Back up experiment databases regularly
  • Verify image integrity after transfers
  • Use consistent naming conventions

27.Glossary

TermDefinition
AcquisitionAutomated imaging and cutting process
AdditionExtra Z movement added to specific cycles
Approach ModeManual knife positioning mode
AutoclickerScripting action that automates mouse clicks
AutofocusAutomated focus adjustment using designated tiles
Baud RateSerial communication speed (bits per second)
COM PortSerial communication port (e.g., COM3)
CycleOne complete cutting + imaging sequence
Debris DetectionAutomated contamination monitoring after cutting
Dwell TimeTime the electron beam stays at each pixel
Ease-InGradual dwell time increase over initial cycles
FoVField of View — physical image area
Histogram LimitDebris detection sensitivity threshold
KatanaUltramicrotome hardware for cutting
Kernel SizeAnalysis window size for debris detection
kVKilovolts — electron beam accelerating voltage
MipmapPre-generated image thumbnails for fast display
Mock SEMSoftware SEM simulation for testing
OscillatorDiamond knife vibration for improved cutting
Pixel SizePhysical size represented by each image pixel
Retract ClearanceDistance knife retracts after cutting
ROIRegion of Interest — defined imaging area
SBF-SEMSerial Block-Face Scanning Electron Microscopy
SequenceOrdered collection of scripting actions
Slice ThicknessAmount of material removed per cut
Stage TrackingViewport following SEM stage position
SweepCutting stroke without Z advancement (debris removal)
TCP SocketNetwork communication protocol for scripting
TileSingle image position within an ROI
Time TravelFeature to view/edit cycle-specific settings
TriggerEvent that starts a script sequence (Before/After Cut)