Skip to main content

CAS and CAS GUI

CAS GUI is a framework for rapidly building imaging system GUIs in Python. Originally designed for use in an optical imaging research in Mike Hughes' lab in the Applied Optics Group, University of Kent, it can be used to help develop GUIs for a wide range of applications which involve capturing and processing images from cameras or camera-like systems.

Screenshot of CAS GUI interface

GUIs are built using PyQt5. Images are displayed using an instance of ImageDisplayQT, a widget for displaying scientific images. To create your own GUI, you simple subclass the base class of CAS GUI and define your own image processing function. There are helper functions for creating additional menus or image displays. You can customise as much as you want by over-riding other methods.

Documentation and Examples

Full documentation is on readthedocs.

Simple examples of GUIs can be found in the examples folder

Rough Guide

The CAS-GUI class, in src/cas_gui/base.py, is the base class for camera GUIs. This can be run as is, and will provide a simple camera image viewer with the possibility to adjust exposure, frame rate and gain. Select the input camera from the drop-down menu in the 'Source' menu and click 'Live Imaging' to begin. It will obviously only work for cameras you have set up on your system - try the Webcam (if you have one) or Simulated Camera first. The Simulated Camera can load a sequence of images from a tif stack in order to simulate camera acquisition. Alternatively, select the 'File' source to load in a saved image or tif stack.

Classes for handling camera communications are in the src/cas_gui/cameras folder. For a specific camera, a new class must be created that inherits from GenericCamera. Override the functions from GenericCamera to implement the relevant functionality. See the other camera python files in the folder for examples.

To create a GUI for a specific purpose, create a new class that inherits from CAS_GUI in base.py. Three simple example are provided in the examples folder - gui_example, gui_example_multi_frame and gui_example_multi_core.

Supported Cameras

Camera classes exist for the following camera families. Functionality is implemented only as needed, so not every function is supported for every camera:

  • Webcam (WebCamera.py) - Returns monochrome images from webcameras. Partial support for exposure and gain (how well these work depend on the specific camera). Requires OpenCV.
  • Webcam Colour (WebCameraColour.py) - As Webcam, but returns colour images. Requires OpenCV.
  • Thorlabs DCX Series Camaras (DCXCameraInterface.py) - Supports setting and getting frame rate, exposure and gain. Requires instrumental package.
  • Thorlabs Kiralux Camera (KiraluxCamera.py) - Supports setting and getting frame rate, exposure and gain. Triggering not supported. Requires Thorlabs Scientific Cameras SDK.
  • FLIR FLea Camera (FleaCameraInterface.py) - Tested with Flea Camera series, may work with other cameras that use the Spinnaker API. Supports setting and getting frame rate, exposure and gain and triggering. Requires Spinnaker SDK.

In addition, there are two other camera classes:

  • File Interface (FileInterface.py) - Provides an interface to an image stored as a file which is compatible with the camera interfaces, simplifying GUIs which need to work with both videos streams from cameras and saved images.
  • Camera Simulator (SimulatedCamera.py) - Simulates a camera using a saved tif stack of images. Images are served at the requested frame rate. Requires PIL.

Examples

Examples of basic use of CAS are in the examples folder:

  • GUI Example - Demonstrates how to sub-class CAS-GUI to produce a simple GUI which applies a smoothing filter to the live video display.
  • GUI Multi Core Example - The same as GUI Example, but uses multiprocessing.
  • GUI Example Multi Frame - Demonstrates how to sub-class CAS-GUI to produce a simple GUI which averages multiple frames from the live video display.
  • Simulated Camera Example - Demonstrates how to capture images from a simulated camera which streams images from a tif stack file.
  • Webcamera Example - Demonstrates how to capture monochrome images from a web camera.
  • Flea Camera Example - Demonstrates how to capture images from a FLIR camera, including setting and getting various parameters and triggering.

Requirements

CAS requirements depends on the specific camera used (see list above).

CAS-GUI requires:

  • PIL (Python Image Library)
  • OpenCV
  • PyQt5
  • Numpy
  • Matplotlib

Metadata

Release files for CAS-GUI 1.0.5

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

Source distribution (sdist)

Source distribution for CAS-GUI 1.0.5
File Size Uploaded
cas_gui-1.0.5.tar.gz 93.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CAS-GUI 1.0.5
File Interpreter ABI Platform
cas_gui-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 203.1 kB

Release files / cas_gui-1.0.5.tar.gz

Download URL cas_gui-1.0.5.tar.gz
Size 93.8 kB
Tags Source
SHA-256 checksum
How to use checksums
55e5d9b49b269b208aca32d5ac208521b7cd5d2f79dca2a2e979b68908616b92
BLAKE2b-256 checksum
How to use checksums
6440dbe40025a3061384f2edc6be24ddabea261fe50788867c4a01089e4b0021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 2, 2025.

Transparency log

Release files / cas_gui-1.0.5-py3-none-any.whl

Download URL cas_gui-1.0.5-py3-none-any.whl
Size 109.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9137168718e4b3f777213f81eac8f459318db356bbc9c74a33e91aff0a26a982
BLAKE2b-256 checksum
How to use checksums
281333a133ada2d761c47a15567e453d88a71ebc6b2def0979b1618da95fa2fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Dec 2, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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