Skip to content

Conversation

@Baharis
Copy link
Member

@Baharis Baharis commented Jan 12, 2026

Last week I had the pleasure to visit Tatiana Gorelik from Ernst Ruska-Center where, with great support of Alex Clausen, I patched Instamatic and Instamatic-Tecnai-Server to fully support their FEI Titan 80-300 STEM with a built-in Gatan Ultrascan camera. The camera was particularly "interesting": being handled by Digital Micrograph software and accessible via the FEI comtypes interface, it boasts a massive 0.5 second delay (with binning 4). This was a real test for many Instamatic systems, in particular the cRED frames: I found the original cRED to work decently with RMB beam control (#151), while FastADT really required the movie delay calibration (#137). Ultimately, only two features were not supported nicely.

Firstly, in #143 I added support for streamable cameras. This was mainly to allow emulating TEM and camera in a separate process on the same computer (see also #104, #140, #141, and instamatic-TEM-emulator. However, I found that extending this support to truly remote cameras is not particularly demanding. In particular, the only thing that is currently missing is a proper generator support for get_movie: this I suggest adding using the following mechanism: whenever a server were to return a generator, it returns generator ID instead. Then, whenever a client attempts to yield from or close this generator, a request with generator ID and __gen_next__ or __gen_close__ attribute is sent.

The second fix introduced here is a fix for annotating an image if the image binsize is different than 1. I never found this issue because we always use binning = 1 on our camera, but for the Gatan ultrascan we had to use binsize = 4 because anything significantly increased delay and caused socket communication issues. With this patch, images in the GUI are properly annotated whenever default_binning is different than 1.

This PR will be briefly followed by PR instamatic-tecnai-server#4 that will introduce tests and optional separate camera server. To read more about configuring a Titan machine, check out this website.

Copy link
Member

@stefsmeets stefsmeets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, glad to hear you got it working on the Titan and that the workshop was a success =)

Just one comment from my side, add a link to https://sites.google.com/view/instamatic-on-titan/index in the docs (sidebar or installation page would be a good place), or consider copying the entire page to the instamatic docs as an application note.

@Baharis
Copy link
Member Author

Baharis commented Jan 13, 2026

@stefsmeets The workshop is in March, but I decided to visit earlier just in case to set up everything beforehand. I will think how to integrate the website with documentation: I made it mostly for workshop participants, and some information repeats with docs, but I'll likely just identify and put new stuff (e.g. configuration with remote detector or how to work if your detector has 0.5 s delay) in the docs. Afterwards I will merge it immediately as this PR includes bugfix + docs only.

@Baharis Baharis merged commit 941750b into instamatic-dev:main Jan 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants