Skip to main content

This is a python wrapper around the Lux Client windows solution

Project description

luxconnector

This is a python wrapper for the Lux Client windows solution. The package will only work on Windows.

Installation

To install this package follow the these steps:

Step 1: Drivers

Make sure you have or had a CytoSmart application installed. Recommend is the cell counter given it do not restart itself after closing. This is needed to have all the correct drivers installed. It doesn't matter if the app is uninstalled afterwards.

Step 2: pip install

pip install luxconnector

Usage

Initialization

Make sure at least one lux is physically connected to your computer via a USB3 port. The luxconnector is an object that maintains the connection with the Lux. To create the object use the following code:

from luxconnector import LuxConnector
connector = LuxConnector(number_of_devices=2)

NOTE: Make sure number_of_devices is at least the number of devices you have connected. If not the luxconnector will look for the missing devices forever.

Getting serial numbers

Each physical device has a serial number. This number is needed to send commands to a specific device.

serial_numbers = connector.get_all_serial_numbers()

Getting a single image

When you want a single image taken at this moment use get_image. This will return the image as a pillow image. You need to give the serial number of the device you want to target

img = connector.get_image(serial_number)

Changing the focus

This function will change the focus for the luxconnector object. Every image taken after this function will have the new focus.

The focus is in the range 0 until 1. (0.0 and 1.0 are valid entries)

You need to give the serial number of the device you want to target

connector.set_focus(serial_number, 0.5)
img1 = connector.get_image(serial_number) # Image with focus of 0.5
connector.set_focus(serial_number, 0.7)
img2 = connector.get_image(serial_number) # Image with focus of 0.7
img3 = connector.get_image(serial_number) # Image with focus of 0.7

Getting the temperature

This function returns the temperature in celsius of the device.

You need to give the serial number of the device you want to target

temperature = connector.get_temperature(serial_number)

Getting a z-stack

This function will return a list of pillow images. Each image will be at a different focus level.

This code will create a z-stack of 6 images. The focuses of these images will be [0.5, 0.6, 0.7, 0.8, 0.9, 1.0]

You need to give the serial number of the device you want to target

list_of_imgs = connector.get_z_stack(serial_number, num_img = 6, start_focus = 0.5, stop_focus = 1)

Changing zoom modes

There are 2 zoom modes: "IN" and "OUT". While zoomed in the resolution is higher but the ROI is smaller, zoomed out has a higher ROI but a lower resolution.

Changing this will change it for every image or z-stack taken afterwards.

You need to give the serial number of the device you want to target

connector.set_zoom(serial_number, "IN")
img1 = connector.get_image(serial_number) # Image is zoomed in
connector.set_zoom(serial_number, "OUT")
img2 = connector.get_image(serial_number) # Image is zoomed out

Live view

The live view of the Lux is hosted at http://localhost:3333/luxservice/live. This image can only been seen if the live view is turned on (by default the live view is turned on).

You need to give the serial number of the device you want to target

connector.set_liveview(serial_number, True) # in the browser you can see the image being updated
connector.set_liveview(serial_number, False) # Led of Lux turns off till you take a picture

Developers

Developers of the luxconnector please look at the developers readme

Credits

  • Tom Nijhof
  • Kyap
  • Nora

History

1.0.1 (2021-14-01)

  • Added support for LUX3 FL

1.0.0 (2020-09-15)

  • Added multi lux support
  • Changed output from numpy array to pillow
  • Require serial number with function to get information
  • Add get_temperature

0.1.2 (2020-06-30)

  • Rename failing to pinging in print statement

0.1.1 (2020-06-11)

  • Update documentation
  • Make setup.py fit for PyPI

0.1.0 (2020-05-20)

  • Update lux server to latest version

0.0.3 (2020-03-30)

  • bugfix: files were not copied into package on linux

0.0.2 (2020-03-24)

  • Bugfix: stop waiting for response after sending a message

0.0.1 (2020-03-16)

  • Add function: Copy the luxconnector
  • Add function: focus change option
  • Add function: z-stack
  • Bugfix: add lux app to manifest

0.0.0 (2020-03-13)

Copied basic package a start of luxconnector

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

luxconnector-1.0.1.tar.gz (18.3 MB view details)

Uploaded Source

Built Distribution

luxconnector-1.0.1-py2.py3-none-any.whl (19.1 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file luxconnector-1.0.1.tar.gz.

File metadata

  • Download URL: luxconnector-1.0.1.tar.gz
  • Upload date:
  • Size: 18.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.8

File hashes

Hashes for luxconnector-1.0.1.tar.gz
Algorithm Hash digest
SHA256 64aa73fc772a7063833ee9108dec718c7d8bbd549118e9e20a4193bb310400ca
MD5 148637e192210751553cc919599a2a19
BLAKE2b-256 744fc2accaeb7c4dd1431ecbd5a01ce996db2e103d20733086ba4c7ce37b0f1e

See more details on using hashes here.

File details

Details for the file luxconnector-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: luxconnector-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.1 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.8

File hashes

Hashes for luxconnector-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 772181a35c7344902370e39e9163860bd7b0b007a4b4ff10071444085a0da0e0
MD5 80e384afcbf0cccba3ba6ac44f36437a
BLAKE2b-256 e641ca2c30620a9091bd4c3d0ca31293519e22ddf3e9ca96c3d3071bad02e80a

See more details on using hashes here.

Supported by

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