Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Ask DeepWiki License: MIT Python 3.10+

fibsemOS

A universal API for FIBSEM Control, Development and Automation

Overview

fibsemOS is a Python package for controlling and automating FIB/SEM microscopes. It provides a universal API for FIBSEM control, development and automation, abstracting away the details of the microscope hardware to provide a simple, intuitive interface. The package includes reusable modules for common workflows and operations, and is extensible to support new microscopes.

We currently aim to support ThermoFisher AutoScript, TESCAN Automation SDK, and Delmic Odemis (for the METEOR). A Zeiss Python API driver is planned, as is support for other FIBSEM systems.

For more information see the website.

Installation

There are several ways to install fibsemOS depending on your application and needs. Requires Python 3.10+.

PyPI (For Users)

Create a virtual environment (see Installation Guide for alternatives to conda), then install with the [ui] extra to get the GUI:

conda create -n fibsem python=3.11 pip
conda activate fibsem
pip install "fibsem[ui]"

Github (For Development)

Clone this repository:

git clone https://github.com/fibsem-os/fibsem-os.git
cd fibsem-os

Install dependencies and package:

conda create -n fibsem python=3.11 pip
conda activate fibsem
pip install -e ".[ui]"

Image labelling (fibsem_label) draws in napari, which is not part of [ui]; add the [labelling] extra for it:

pip install -e ".[ui,labelling]"

To run:

fibsem-autolamella-ui

Two flags skip the clicks that start every session, for development against a simulator or an instrument you reconnect to all day. --quickstart connects with the default microscope configuration as soon as the window is up; --quickload does that and then reopens the most recent experiment:

fibsem-autolamella-ui --quickload

Offline Installation

For computers with no internet connection, you can download the dependencies on a separate internet connected computer and transfer it to the Support PC (e.g. via USB).

On internet connected PC (Environment should match python version):

mkdir pkg
cd pkg
pip download "fibsem[ui]"

On Support PC: Transfer the pkg directory to the support pc, and then change to the pkg directory

cd pkg
pip install --no-index --find-links . "fibsem[ui]"

Additional Installation Information

For detailed instructions on installation, and installing the commercial microscope APIs, see Installation Guide.

Getting Started

For a complete walkthrough of the AutoLamella workflow, see the user guide, starting with Your first lamella.

Getting Started with the API

To get started with the fibsemOS API, see the example/example.py:

You can start an offline demo microscope by setting info.manufacturer: Demo in the configuration yaml file (fibsem/config/microscope-configuration.yaml), as the shipped file does. The file's hardware.devices list says which devices the microscope builds and how; see Configuring devices. This will start a demo microscope that you can use to test the API without connecting to a real microscope. To connect to a real microscope, set the ip_address and manufacturer of your microscope in the configuration file or alternatively, you can pass these arguments to utils.setup_session() directly. The simulator can also image a synthetic cryo-grid instead of noise; see docs/simulator.md.

Where fibsemOS keeps your files

Everything fibsemOS writes goes under ~/.fibsem (on Windows C:\Users\<account>\.fibsem); set FIBSEM_HOME to put it somewhere else, for example a folder shared by every account on a microscope PC. The installed package is never written, so upgrading or reinstalling does not touch your files.

Folder Holds
config/ preferences, the list of microscope configurations, the configurations you made, and session/ (saved positions, holder occupancy, FM settings, one file per configuration)
experiments/ new experiments when no default folder is set in preferences
log/ logs and data captured outside an experiment
autolamella/protocols/, autolamella/scripts/ your AutoLamella protocols and scripts

The App Server's discovery file, pairing tokens and the agent's files stay in ~/.fibsem even when FIBSEM_HOME is set. A release before this layout kept these files inside the package; the first start copies the settings out (leaving the originals) and moves the logs, experiments, protocols and scripts, logging each one and listing them in ~/.fibsem/MOVED-FROM.txt.

This example shows you how to connect to the microscope, take an image with both beams, and plot the results.

from fibsem import utils, acquire
import matplotlib.pyplot as plt

def main():

    # connect to microscope
    microscope, settings = utils.setup_session(ip_address="localhost", manufacturer="Demo")

    # take image with both beams
    sem_image, fib_image = acquire.take_reference_images(microscope, settings.image)

    # show images
    fig, ax = plt.subplots(1, 2, figsize=(7, 5))
    ax[0].imshow(sem_image.data, cmap="gray")
    ax[1].imshow(fib_image.data, cmap="gray")
    plt.show()


if __name__ == "__main__":
    main()

This example is available as a script in example/example.py. For more detailed examples, see the Examples section below.

The microscope's beams, stage and other hardware are also available as devices, whose parameters describe their own units, limits and choices:

from fibsem.structures.settings import BeamType

sem = microscope.beams[BeamType.ELECTRON]   # or microscope.devices["electron"]
sem.hfw.set_value(150e-6)
print(sem.current.get_value(), sem.current.choices)

See the device guide. The string-key microscope.get("key") and microscope.set(...) were removed in 0.6.0.

Examples

Core Functionality

For examples of core functionality please see:

  • example/example_imaging.py: image acquisition
  • example/example_movement.py: stage movement
  • example/example_milling.py: drawing patterns and beam milling
  • example/autolamella.py: recreation of AutoLamella V1 (automated cryo-lamella preparation) in ~150 lines of code

Additional example scripts and notebooks are available.

Working with experiment data

To read or modify a saved AutoLamella experiment from a plain Python script — no microscope or GUI needed — see the Scripting Guide.

Contributing

Contributions are welcome! Please open a pull request or issue.

Docs

fibsemOS is a large package with many features. For more detailed documentation, please see the Documentation Website.

Developer documentation, for changing or extending fibsemOS, is in docs/developers/.

Name Full Title Date
3DCT Site-Specific Cryo-focused Ion Beam Sample Preparation Guided by 3D Correlative Microscopy 2016
AutoLamella Automated cryo-lamella preparation for high-throughput in-situ structural biology 2020
SerialFIB A modular platform for automated cryo-FIB workflows 2021
PFIB-SEM Cryo-plasma FIB/SEM volume imaging of biological specimens 2023
OpenFIBSEM OpenFIBSEM: A universal API for FIBSEM control 2023
SEM Charging Reduction of SEM charging artefacts in native cryogenic biological samples 2025
Fillets Mind the corner: Fillets in cryo-FIB lamella preparation to minimise sample loss 2025

Metadata

Release files for fibsem 0.6.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fibsem 0.6.0rc1
File Size Uploaded Provenance Actions
fibsem-0.6.0rc1.tar.gz 8.3 MB With provenance Details for fibsem-0.6.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fibsem 0.6.0rc1
File Interpreter ABI Platform Actions
fibsem-0.6.0rc1-py3-none-any.whl Python 3 none any Details for fibsem-0.6.0rc1-py3-none-any.whl

Total release size: 12.1 MB

Release files / fibsem-0.6.0rc1.tar.gz

Download URL fibsem-0.6.0rc1.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
c763d092bb695a077b6b8ba7e50f87bcb0108bd2e7d55a611f92dd1f30f3b7e3
BLAKE2b-256 checksum
How to use checksums
50bc40055e4cc9d18312ba6b7897ebeaeec041d9b35005b47c96e9c32fced4a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / fibsem-0.6.0rc1-py3-none-any.whl

Download URL fibsem-0.6.0rc1-py3-none-any.whl
Size 3.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f6264faca7dede4c934431c0185ae6c8e30b55886149c062596a552e9985d96b
BLAKE2b-256 checksum
How to use checksums
e4d290c6796412b19ce2e1179b0d822e4f9d728b6a1f40415e67de8c28978881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for fibsem 0.6.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fibsem-0.6.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page