FIBSEM Operating System
Translation pending
Developer toolsPython · TypeScriptGitHub @fibsem-osSelf-installOwner unconfirmed
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
Loading the full README. The saved excerpt is shown below.
A universal API for FIBSEM Control, Development and Automation
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 Zeiss Python API. Support for other FIBSEM systems is planned.Read the full README ↗A universal API for FIBSEM Control, Development and Automation
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.
There are several ways to install fibsemOS depending on your application and needs. Requires Python 3.10+.
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]"
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
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]"
For detailed instructions on installation, and installing the commercial microscope APIs, see Installation Guide.
For a complete walkthrough of the AutoLamella workflow, see the user guide, starting with Your first lamella.
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.
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.
For examples of core functionality please see:
Additional example scripts and notebooks are available.
To read or modify a saved AutoLamella experiment from a plain Python script — no microscope or GUI needed — see the Scripting Guide.
Contributions are welcome! Please open a pull request or issue.
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/.