Skip to main content

Python package for creating imaging system GUIs.

Project description

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 reseach in Mike Hughes' lab in the Applied Optics Group, University of Kent, it could 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.

Documentation and Examples

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cas_gui-1.0.0.tar.gz (213.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cas_gui-1.0.0-py3-none-any.whl (265.7 kB view details)

Uploaded Python 3

File details

Details for the file cas_gui-1.0.0.tar.gz.

File metadata

  • Download URL: cas_gui-1.0.0.tar.gz
  • Upload date:
  • Size: 213.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.20

File hashes

Hashes for cas_gui-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cc3006d6bafae5e4c84423f235e319e37986b0f8d5cc3f67c5e5f6acbeb2f6fd
MD5 1ce6f8831fc0fca5d56f47ae313958be
BLAKE2b-256 4a95feb1abc8b684493d5424f1da9ba8936d167375346d76b2594d174fc69d21

See more details on using hashes here.

File details

Details for the file cas_gui-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cas_gui-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 265.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.20

File hashes

Hashes for cas_gui-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2226776768471942951b982624b2d7b4e0847dbc3ad47a35daedfb1fe4d7616f
MD5 0823cc922cde9f9ee469cbbfb366948d
BLAKE2b-256 44c2e6e2a941ed4422b840a5b53709e460fc01b3d1973bcebc07e6d81baa120a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page