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: Divers
Make sure you have or had a CytoSmart application installed. 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
Make sure the 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()
Getting a single image
When you want a single image taken at this moment use get_image.
This will return the image as a numpy array
.
img = connector.get_image()
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)
connector.set_focus(0.5)
img1 = connector.get_image() # Image with focus of 0.5
connector.set_focus(0.7)
img2 = connector.get_image() # Image with focus of 0.7
img3 = connector.get_image() # Image with focus of 0.7
Getting a z-stack
This function will return a list of numpy arrays
.
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]
list_of_imgs = connector.get_z_stack(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.
connector.set_zoom("IN")
img1 = connector.get_image() # Image is zoomed in
connector.set_zoom("OUT")
img2 = connector.get_image() # 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).
connector.set_liveview(True) # in the browser you can see the image being updated
connector.set_liveview(False) # Led of Lux turns off till you take a picture
Credits
- Tom Nijhof
History
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file luxconnector-0.1.1.tar.gz
.
File metadata
- Download URL: luxconnector-0.1.1.tar.gz
- Upload date:
- Size: 18.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 939e928994c36176d6c940fe9788a1b16f06d9b048c61e85f9b5e7550582be66 |
|
MD5 | 9c38feb4ac829884c6cf63c7d61711ff |
|
BLAKE2b-256 | f99ff9a1c6f9283fb531a8e990a74372657df5d475abdf558e04609a81e027bd |
File details
Details for the file luxconnector-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: luxconnector-0.1.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.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67b279f1721c888f1a74a7f6f2e1876d1d03b2ef55817e0feec836c5c37a252c |
|
MD5 | c7cd59dcd5d4ae0c66c6a373c7d79db2 |
|
BLAKE2b-256 | ff6777d495e0996bc6b3fb044ac8be43820d4043c99d56f29a539deadecdaab7 |