v2.0.0

Changelog

LabThings

  • The microscope server now uses LabThings to handle API routes, documentation, extension management, locks, tasks, and view decorators.

  • This means that the following critical incompatibilities shold be noted:

    • All v1 API routes have been removed. Please use OpenFlexure eV >2.0
    • Extensions are now created in an entirely new way. The documentation now has an updated tutorial on the new extension system
    • Locations for microscope settings, captures, and logs are now different (defaulting to /var/openflexure)

Updated documentation for the new release can be found here on ReadTheDocs.

API v2

  • Restructured API routes for better organisation

    • Structure based on the W3C Web of Things architecture, distinguishing actions and properties
    • API root now returns a W3C Thing Description, with a "links" attribute for quick access to common microscope routes
  • Full, interactive API documentation on the microscope server

  • Documentation for API routes now automatically generated from docstrings and LabThings decorators

  • Added route to get a single-frame snapshot from the MJPEG stream

  • Added routes to shutdown and reboot the microscope (only if using a Raspberry Pi)

  • Added route to set the current stage coordinates to (0, 0, 0)

  • Added route to get a non-persistent (never saved to disk), full resolution (defaults to video port) capture

  • Numpy arrays can now be JSON-serialised

  • Added a minimal OpenFlexure-eV-like interface at the server root

Paths

  • Microscope will now try to save all relevant data to /var/openflexure/, falling back to user home directory if permissions and insufficient

Metadata

  • All metadata in captures and web routes now use JSON formatting (replacing partial use of YAML)

  • Full microscope settings, including lens shading table, are now included in capture EXIF data

  • Tile scan captures now include additional metadata on the scan parameters

Devices

  • Removed noise stream from MockCamera, replaced with system info and timestamp

  • Mock stage move action now takes time (using sleep)

  • PiCamera lens-shading table is now a memory-view of a C-contiguous array

  • Camera object is now resposible for rebuilding its own capture library

Settings

  • Device (camera and stage) types, and serial port information, is now stored in a separate microscope configuratio file

  • Settings object is now, by default, an application-level global

Captures

  • OFM metadata now stored in JPEG EXIF in JSON format

    • Note: This means captures taken in the v1 software will not be loaded back into the software gallery
  • Microscope capture objects now just handle on-disk data (no in-memory stream)

  • Capture "temporary" status is now stored as a tag (rather than its own dedicated property)

  • Handle passing a CaptureObject instance directly to capture() as the target

  • Capture library is now an OrderedDict

Tasks

  • Implemented a new background task system supporting progress updates, intermediate data, and task termination

Extensions

  • Completely overhauled extension system (v1 extensions are incompatible with v2!)

    • Extensions now loaded as Python modules from an extension directory (no settings keys required)
  • New default extension for downloading ZIP files of multiple captures

  • New default extension for switching between capture storage locations

  • Autofocus now checks for real camera and stage

  • Extension form descriptions now named gui

  • Extension GUIs can now be dynamic, using a function that returns a dictionary