[![Downloads](https://pepy.tech/badge/AxionVueOpenAPI)](https://pepy.tech/project/AxionVueOpenAPI)
[![Downloads](https://pepy.tech/badge/CytoSmartOpenAPI)](https://pepy.tech/project/CytoSmartOpenAPI)
[![Downloads](https://pepy.tech/badge/luxconnector)](https://pepy.tech/project/luxconnector)
# Axion Vue Open API
This is a Python wrapper for the Axion Vue Windows app to use it headless.
The package will only work on Windows 10 and above.
This package was formally known as `luxconnector`
## Warranty
> ⚠️ **Hardware warranty is void by using this open API** ⚠️:
>
> Using the AxionVueOpenAPI means you will have NO hardware warranty (see license).
This is because our devices are made to handle the normal usage ([the GUI app](https://download.axionbio.com/)).
It also includes additionally bought warranty.
Only if your additionally bought warranty implicitly includes the Open API usage you will have warranty.
## Installation
To install this package follow these steps:
### Step 1: Drivers
Make sure you had a [Axion Vue application installed](http://download.axionbio.com/).
Recommended is the cell counter given it does not restart itself after closing.
This is needed to have all the correct drivers installed.
Uninstall the app afterwards.
If the app is on the same machine the Open API might connect with the wrong one.
### Step 2: pip install
```cmd
pip install AxionVueOpenAPI
```
## Initialization
Make sure at least one Axion imaging device is physically connected to your computer via a USB3 port.
The AxionVueOpenAPI is an object that maintains the connection with the device.
To create the object use the following code:
```python
from AxionVueOpenAPI import AxionVueOpenAPI
connector = AxionVueOpenAPI(number_of_devices=2, warranty=False)
```
> ⚠️ You are voiding your warranty by using this package
NOTE: Make sure number_of_devices does not exceed the number of devices you have physically connected.
Otherwise the AxionVueOpenAPI 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.
```python
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`](https://pillow.readthedocs.io/en/stable/reference/Image.html).
You need to give the serial number of the device you want to target.
```python
img = connector.get_image(serial_number)
```
or
```python
img = connector.get_image(serial_numbers[index])
```
## Changing the focus
This function will change the focus for the AxionVueOpenAPI 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.
```python
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
```
## Auto focus
The device goes over multiple possible focuses to find the best focus.
It will use image analysis to determine how well the image is in focus.
```python
# Fast but goes over a limited range to cover most manufactured cell counting slides
connector.do_autofocus(serial_number, "slide")
# Fastest: goes over the limited range where cells can be in focus on the Axion Exact slide
connector.do_autofocus(serial_number, "CSslide")
# Slow, but goes over the full range of possible focusses: suitable for any vessel that works with the Axion imaging device
connector.do_autofocus(serial_number, "other")
```
## 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.
```python
temperature = connector.get_temperature(serial_number)
```
## Change active camera (fluorescence)
To use fluorescence you will need to change the active camera.
The camera can be set to 3 different values, RED, GREEN, or BRIGHTFIELD.
This will only work if your device is an FL device otherwise only BRIGHTFIELD is available.
```python
connector.set_active_camera(serial_number, "RED")
connector.set_active_camera(serial_number, "GREEN")
connector.set_active_camera(serial_number, "BRIGHTFIELD")
```
## Change camera setting
Each camera has its own settings.
Not all settings are available for BRIGHTFIELD.
- exposure: The time in milliseconds that the camera is detecting light. (Lux and Exact devices only; for Omni devices use flash duration)
- gain: The multiplication of the camera. (Fluo only)
If very little light goes into the camera sensor make sure the gain is high.
- brightness: Strength of the led when it is on. (Fluo only)
- focus_offset: The difference in focus between brightfield and fluo.
If focus is set to 0.4 and focus_offset for RED is set to 0.1 RED focus is 0.5 (Fluo only)
```python
connector.set_camera_settings(serial_number, "RED", 500, gain=30, brightness=5000, focus_offset=0.0)
connector.set_camera_settings(serial_number, "BRIGHTFIELD", 10)
```
## Change flash duration (Omni only)
The Omni cannot change the exposure time but can change the time the led is on.
This can be done with set_flash_duration.
It will set the duration between 40 and 250 μs.
```python
connector.set_flash_duration(serial_number, duration=120)
```
If you do NOT have an Omni use set_camera_settings.
## Getting a z-stack
This function will return a list of [`pillow images`](https://pillow.readthedocs.io/en/stable/reference/Image.html).
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.
```python
list_of_imgs = connector.get_z_stack(serial_number, num_img = 6, start_focus = 0.5, stop_focus = 1)
```
## Change stage (Omni only)
To change the position of the Omni stage (camera, led, arm, ect.) give the new position in mm.
- Position x in mm
- Position y in mm
- Time in seconds it can wait till it arrives (default 60)
```python
connector.move_stage(serial_number, 100, 100, 60)
```
After this the normal process for obtaining and changing cameras applies.
## Get stage position (Omni only)
If you need to know where the stage is, use get_position.
This also works if the Omni moved without a move_stage command (e.g. when it goes to sleep).
```python
print(connector.get_position(serial_number))
```
## Changing zoom modes (Lux only)
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.
Since zooming in comprises digital zoom, the image will not show more sample details.
Changing this setting 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.
```python
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 device is hosted at http://localhost:3333/cytosmartservice/live?serialNumber=##########.
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 at the place of the #-symbols.
```python
connector.set_liveview(serial_number, False) # Led of device turns off till you take a picture
connector.set_liveview(serial_number, True) # In the browser you can see the image being updated
connector.open_liveview(serial_number) # Opens liveview in the default browser
```
## Developers
Developers of the AxionVueOpenAPI please look at the [`developers readme`](README_DEV.md)
## Credits
- Tom "RoadRunner" Nijhof
- Nora
- Tessa
- Marc "it is with a c" van Vijven
- Julia "I did not break it, I tested it" van den Beemd
- Count Nicolai Vondracek, Señior sunshine manager
History
-------
1.3.1 (2023-03-29)
------------------
- Renaming to AxionVueOpenAPI
1.3.0 (2022-08-25)
------------------
- Add open_liveview
- Add do_autofocus
- Add listener to autofocus change
- Bugfix: set_focus. Make sure camera_setting is completed before setting the focus
1.2.0 (2022-06-27)
------------------
- Update server to support Omni
- Add move stage
- Add get position
- Add set flash duration
- Add mandatory turning off of warranty
- Check for connection loss and reconnect is closed
- Check for sleeping device
1.1.1 (2022-06-29)
------------------
- Update documentation
1.1.0 (2021-12-03)
------------------
- Add change camera settings
- Add set activate camera (brightfield, red-fluo, or green-fluo)
- Change focus:
make sure focus always happens in brightfield camera mode
Add sleep after changing to focus so camera can move to new position
- Update to new Cytosmart app
1.0.4 (2021-04-15)
------------------
- Update Pillow
- Fix installation requirements
1.0.3 (2021-11-22)
------------------
- Update requirements of websocket and websocket-client to include version 1
- Check if app is open before starting a new one
1.0.2 (2021-04-15)
------------------
- Update pillow
- Update license to ACADEMIC PUBLIC LICENSE
1.0.1 (2021-01-14)
------------------
- Added support for LUX3 FL
- Bugfix: toggle liveview when change zoom level
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
ACADEMIC PUBLIC LICENSE
version 1.1
Copyright (C) 2021
Preamble
This license contains the terms and conditions of using AxionVueOpenAPI in
noncommercial settings: at academic institutions for teaching and research
use and for personal or educational purposes. You will find that this
license provides noncommercial users of AxionVueOpenAPI with rights that are
similar to the well-known GNU General Public License, yet it retains the
possibility for AxionVueOpenAPI authors to financially support the development by
selling commercial licenses. In fact, if you intend to use AxionVueOpenAPI in a
"for-profit" environment, where research is conducted to develop or enhance
a product, is used in a commercial service offering, or when an entity uses
AxionVueOpenAPI to participate in government-funded, EU-funded, military or similar
research projects, then you need to obtain a commercial license.
In that case, or if you are unsure, please contact the Author imaging.support@axionbio.com
to inquire about commercial licenses.
What are the rights given to noncommercial users? Similarly to GPL, you
have the right to use the software, to distribute copies, to receive source
code, to change the software and distribute your modifications or the
modified software. Also similarly to the GPL, if you distribute verbatim or
modified copies of this software, they must be distributed under this
license.
By modeling the GPL, this license guarantees that you're safe when using
AxionVueOpenAPI in your work, for teaching or research. This license guarantees
that AxionVueOpenAPI will remain available free of charge for nonprofit use. You
can modify AxionVueOpenAPI to your purposes, and you can also share your modifications.
Even in the unlikely case of the authors abandoning AxionVueOpenAPI entirely, this
license permits anyone to continue developing it from the last release, and
to create further releases under this license.
We believe that the combination of noncommercial open-source and commercial
licensing will be beneficial for the whole user community, because income from
commercial licenses will enable faster development and a higher level of
software quality, while further enjoying the informal, open communication
and collaboration channels of open source development.
The precise terms and conditions for using, copying, distribution and
modification follow.
ACADEMIC PUBLIC LICENSE
TERMS AND CONDITIONS FOR USE, COPYING, DISTRIBUTION AND MODIFICATION
0. Definitions
"Program" means a copy of AxionVueOpenAPI, which is said to be distributed under
this Academic Public License.
"Work based on the Program" means either the Program or any derivative work
under copyright law: that is to say, a work containing the Program or a
portion of it, either verbatim or with modifications and/or translated into
another language. (Hereinafter, translation is included without limitation
in the term "modification".)
"Using the Program" means any act of creating executables that contain or
directly use libraries that are part of the Program, running any of the
tools that are part of the Program, or creating works based on the Program.
Each licensee is addressed as "you".
1. Permission is hereby granted to use the Program free of charge for
noncommercial purposes, including teaching and academic research at
universities, colleges and other educational institutions and personal
non-profit purposes. For using the Program for commercial purposes,
including but not restricted to consulting activities, design of commercial
hardware or software networking products, and joint research with a
commercial entity, government-funded, EU-funded, military or similar
research projects, you have to contact the Author at imaging.support@axionbio.com
for an appropriate license. Permission is also granted to use the Program
for a reasonably limited period of time for the purpose of evaluating its
usefulness for a particular purpose.
2. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
The program is provided on an "as-is" basis. The maintainers of the program
make no warranties regarding the information provided,
and disclaims liability for damages resulting from its use.
Using the program voids the warranty given by the manufacturer of the device.
3. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 2
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose regulations for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
(If the same, independent sections are distributed as part of a package
that is otherwise reliant on, or is based on the Program, then the
distribution of the whole package, including but not restricted to the
independent section, must be on the unmodified terms of this License,
regadless of who the author of the included sections was.)
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based or reliant on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
storage or distribution medium does not bring the other work under
the scope of this License.
4. You may copy and distribute the Program (or a work based on it,
under Section 3) in object code or executable form under the terms of
Sections 2 and 3 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
2 and 3 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 2 and 3 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you received
the program in object code or executable form with such an offer,
in accord with Subsection b) above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
5. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
6. You are not required to accept this License, since you have not
signed it. Nothing else grants you permission to modify or distribute
the Program or its derivative works; law prohibits these actions
if you do not accept this License. Therefore, by modifying or distributing
the Program (or any work based on the Program), you indicate your
acceptance of this License and all its terms and conditions for copying,
distributing or modifying the Program or works based on it, to do so.
7. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
8. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
9. If the distribution and/or use of the Program are restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
NO WARRANTY
10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED ON IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Initially written by Andras Varga (public domain) for OMNeT++ https://omnetpp.org/intro/license,
adapted by CytoSMART TECHNOLOGIES BV. The adaptation is licensed under CC0 1.0 (Public Domain Dedication).
Raw data
{
"_id": null,
"home_page": "https://github.com/cytosmart-bv/AxionVueOpenAPI",
"name": "AxionVueOpenAPI",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "AxionVueOpenAPI",
"author": "Tom Nijhof",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/e2/23/25ec09557b586c7c463ca1f965cc81dc031441e557f50f6d5b6c8aed2541/AxionVueOpenAPI-1.3.1.tar.gz",
"platform": null,
"description": "[![Downloads](https://pepy.tech/badge/AxionVueOpenAPI)](https://pepy.tech/project/AxionVueOpenAPI)\n[![Downloads](https://pepy.tech/badge/CytoSmartOpenAPI)](https://pepy.tech/project/CytoSmartOpenAPI)\n[![Downloads](https://pepy.tech/badge/luxconnector)](https://pepy.tech/project/luxconnector)\n\n# Axion Vue Open API\n\nThis is a Python wrapper for the Axion Vue Windows app to use it headless.\nThe package will only work on Windows 10 and above.\n\nThis package was formally known as `luxconnector`\n\n## Warranty\n\n> \u26a0\ufe0f **Hardware warranty is void by using this open API** \u26a0\ufe0f:\n>\n> Using the AxionVueOpenAPI means you will have NO hardware warranty (see license).\n\nThis is because our devices are made to handle the normal usage ([the GUI app](https://download.axionbio.com/)).\nIt also includes additionally bought warranty.\nOnly if your additionally bought warranty implicitly includes the Open API usage you will have warranty.\n\n## Installation\n\nTo install this package follow these steps:\n\n### Step 1: Drivers\n\nMake sure you had a [Axion Vue application installed](http://download.axionbio.com/).\n\nRecommended is the cell counter given it does not restart itself after closing.\nThis is needed to have all the correct drivers installed.\nUninstall the app afterwards.\nIf the app is on the same machine the Open API might connect with the wrong one.\n\n### Step 2: pip install\n\n```cmd\npip install AxionVueOpenAPI\n```\n\n## Initialization\n\nMake sure at least one Axion imaging device is physically connected to your computer via a USB3 port.\nThe AxionVueOpenAPI is an object that maintains the connection with the device.\nTo create the object use the following code:\n\n```python\nfrom AxionVueOpenAPI import AxionVueOpenAPI\nconnector = AxionVueOpenAPI(number_of_devices=2, warranty=False)\n```\n\n> \u26a0\ufe0f You are voiding your warranty by using this package\n\nNOTE: Make sure number_of_devices does not exceed the number of devices you have physically connected.\nOtherwise the AxionVueOpenAPI will look for the missing devices forever.\n\n## Getting serial numbers\n\nEach physical device has a serial number.\nThis number is needed to send commands to a specific device.\n\n```python\nserial_numbers = connector.get_all_serial_numbers()\n```\n\n## Getting a single image\n\nWhen you want a single image taken at this moment use get_image.\nThis will return the image as a [`pillow image`](https://pillow.readthedocs.io/en/stable/reference/Image.html).\nYou need to give the serial number of the device you want to target.\n\n```python\nimg = connector.get_image(serial_number)\n```\n\nor\n\n```python\nimg = connector.get_image(serial_numbers[index])\n```\n\n## Changing the focus\n\nThis function will change the focus for the AxionVueOpenAPI object.\nEvery image taken after this function will have the new focus.\n\nThe focus is in the range 0 until 1. (0.0 and 1.0 are valid entries)\n\nYou need to give the serial number of the device you want to target.\n\n```python\nconnector.set_focus(serial_number, 0.5)\nimg1 = connector.get_image(serial_number) # Image with focus of 0.5\nconnector.set_focus(serial_number, 0.7)\nimg2 = connector.get_image(serial_number) # Image with focus of 0.7\nimg3 = connector.get_image(serial_number) # Image with focus of 0.7\n```\n\n## Auto focus\n\nThe device goes over multiple possible focuses to find the best focus.\nIt will use image analysis to determine how well the image is in focus.\n\n```python\n# Fast but goes over a limited range to cover most manufactured cell counting slides\nconnector.do_autofocus(serial_number, \"slide\")\n# Fastest: goes over the limited range where cells can be in focus on the Axion Exact slide\nconnector.do_autofocus(serial_number, \"CSslide\")\n# Slow, but goes over the full range of possible focusses: suitable for any vessel that works with the Axion imaging device\nconnector.do_autofocus(serial_number, \"other\")\n```\n\n## Getting the temperature\n\nThis function returns the temperature in Celsius of the device.\n\nYou need to give the serial number of the device you want to target.\n\n```python\ntemperature = connector.get_temperature(serial_number)\n```\n\n## Change active camera (fluorescence)\n\nTo use fluorescence you will need to change the active camera.\nThe camera can be set to 3 different values, RED, GREEN, or BRIGHTFIELD.\nThis will only work if your device is an FL device otherwise only BRIGHTFIELD is available.\n\n```python\nconnector.set_active_camera(serial_number, \"RED\")\nconnector.set_active_camera(serial_number, \"GREEN\")\nconnector.set_active_camera(serial_number, \"BRIGHTFIELD\")\n```\n\n## Change camera setting\n\nEach camera has its own settings.\nNot all settings are available for BRIGHTFIELD.\n\n- exposure: The time in milliseconds that the camera is detecting light. (Lux and Exact devices only; for Omni devices use flash duration)\n- gain: The multiplication of the camera. (Fluo only)\n If very little light goes into the camera sensor make sure the gain is high.\n- brightness: Strength of the led when it is on. (Fluo only)\n- focus_offset: The difference in focus between brightfield and fluo.\n If focus is set to 0.4 and focus_offset for RED is set to 0.1 RED focus is 0.5 (Fluo only)\n\n```python\nconnector.set_camera_settings(serial_number, \"RED\", 500, gain=30, brightness=5000, focus_offset=0.0)\nconnector.set_camera_settings(serial_number, \"BRIGHTFIELD\", 10)\n```\n\n## Change flash duration (Omni only)\n\nThe Omni cannot change the exposure time but can change the time the led is on.\nThis can be done with set_flash_duration.\nIt will set the duration between 40 and 250 \u03bcs.\n\n```python\nconnector.set_flash_duration(serial_number, duration=120)\n```\n\nIf you do NOT have an Omni use set_camera_settings.\n\n## Getting a z-stack\n\nThis function will return a list of [`pillow images`](https://pillow.readthedocs.io/en/stable/reference/Image.html).\nEach image will be at a different focus level.\n\nThis code will create a z-stack of 6 images.\nThe focuses of these images will be [0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\n\nYou need to give the serial number of the device you want to target.\n\n```python\nlist_of_imgs = connector.get_z_stack(serial_number, num_img = 6, start_focus = 0.5, stop_focus = 1)\n```\n\n## Change stage (Omni only)\n\nTo change the position of the Omni stage (camera, led, arm, ect.) give the new position in mm.\n\n- Position x in mm\n- Position y in mm\n- Time in seconds it can wait till it arrives (default 60)\n\n```python\nconnector.move_stage(serial_number, 100, 100, 60)\n```\n\nAfter this the normal process for obtaining and changing cameras applies.\n\n## Get stage position (Omni only)\n\nIf you need to know where the stage is, use get_position.\nThis also works if the Omni moved without a move_stage command (e.g. when it goes to sleep).\n\n```python\nprint(connector.get_position(serial_number))\n```\n\n## Changing zoom modes (Lux only)\n\nThere are 2 zoom modes: \"IN\" and \"OUT\".\nWhile zoomed in the resolution is higher but the ROI is smaller, zoomed out has a higher ROI but a lower resolution.\nSince zooming in comprises digital zoom, the image will not show more sample details.\n\nChanging this setting will change it for every image or z-stack taken afterwards.\n\nYou need to give the serial number of the device you want to target.\n\n```python\nconnector.set_zoom(serial_number, \"IN\")\nimg1 = connector.get_image(serial_number) # Image is zoomed in\nconnector.set_zoom(serial_number, \"OUT\")\nimg2 = connector.get_image(serial_number) # Image is zoomed out\n```\n\n## Live view\n\nThe live view of the device is hosted at http://localhost:3333/cytosmartservice/live?serialNumber=##########.\nThis image can only been seen if the live view is turned on (by default the live view is turned on).\n\nYou need to give the serial number of the device you want to target at the place of the #-symbols.\n\n```python\nconnector.set_liveview(serial_number, False) # Led of device turns off till you take a picture\nconnector.set_liveview(serial_number, True) # In the browser you can see the image being updated\nconnector.open_liveview(serial_number) # Opens liveview in the default browser\n```\n\n## Developers\n\nDevelopers of the AxionVueOpenAPI please look at the [`developers readme`](README_DEV.md)\n\n## Credits\n\n- Tom \"RoadRunner\" Nijhof\n- Nora\n- Tessa\n- Marc \"it is with a c\" van Vijven\n- Julia \"I did not break it, I tested it\" van den Beemd\n- Count Nicolai Vondracek, Se\u00f1ior sunshine manager\n\n\nHistory\n-------\n1.3.1 (2023-03-29)\n------------------\n- Renaming to AxionVueOpenAPI\n\n1.3.0 (2022-08-25)\n------------------\n- Add open_liveview\n- Add do_autofocus\n- Add listener to autofocus change\n- Bugfix: set_focus. Make sure camera_setting is completed before setting the focus\n\n1.2.0 (2022-06-27)\n------------------\n- Update server to support Omni\n- Add move stage\n- Add get position\n- Add set flash duration\n- Add mandatory turning off of warranty\n- Check for connection loss and reconnect is closed\n- Check for sleeping device\n\n1.1.1 (2022-06-29)\n------------------\n- Update documentation\n\n1.1.0 (2021-12-03)\n------------------\n- Add change camera settings\n- Add set activate camera (brightfield, red-fluo, or green-fluo)\n- Change focus: \n make sure focus always happens in brightfield camera mode\n Add sleep after changing to focus so camera can move to new position\n- Update to new Cytosmart app\n\n1.0.4 (2021-04-15)\n------------------\n- Update Pillow\n- Fix installation requirements\n\n1.0.3 (2021-11-22)\n------------------\n- Update requirements of websocket and websocket-client to include version 1\n- Check if app is open before starting a new one\n\n1.0.2 (2021-04-15)\n------------------\n- Update pillow\n- Update license to ACADEMIC PUBLIC LICENSE\n\n1.0.1 (2021-01-14)\n------------------\n- Added support for LUX3 FL\n- Bugfix: toggle liveview when change zoom level\n\n1.0.0 (2020-09-15)\n------------------\n- Added multi lux support\n- Changed output from numpy array to pillow\n- Require serial number with function to get information\n- Add get_temperature\n\n0.1.2 (2020-06-30)\n------------------\n- Rename failing to pinging in print statement\n\n0.1.1 (2020-06-11)\n------------------\n- Update documentation\n- Make setup.py fit for PyPI\n \n0.1.0 (2020-05-20)\n------------------\n- Update lux server to latest version\n\n0.0.3 (2020-03-30)\n------------------\n- bugfix: files were not copied into package on linux\n\n0.0.2 (2020-03-24)\n------------------\n- Bugfix: stop waiting for response after sending a message\n\n0.0.1 (2020-03-16)\n------------------\n\n- Add function: Copy the luxconnector \n- Add function: focus change option\n- Add function: z-stack\n- Bugfix: add lux app to manifest\n\n0.0.0 (2020-03-13)\n------------------\n\nCopied basic package a start of luxconnector\n\n\n ACADEMIC PUBLIC LICENSE\n version 1.1\n\n Copyright (C) 2021\n\n\n Preamble\n\nThis license contains the terms and conditions of using AxionVueOpenAPI in\nnoncommercial settings: at academic institutions for teaching and research\nuse and for personal or educational purposes. You will find that this\nlicense provides noncommercial users of AxionVueOpenAPI with rights that are\nsimilar to the well-known GNU General Public License, yet it retains the\npossibility for AxionVueOpenAPI authors to financially support the development by\nselling commercial licenses. In fact, if you intend to use AxionVueOpenAPI in a\n\"for-profit\" environment, where research is conducted to develop or enhance\na product, is used in a commercial service offering, or when an entity uses\nAxionVueOpenAPI to participate in government-funded, EU-funded, military or similar\nresearch projects, then you need to obtain a commercial license.\nIn that case, or if you are unsure, please contact the Author imaging.support@axionbio.com\nto inquire about commercial licenses.\n\nWhat are the rights given to noncommercial users? Similarly to GPL, you\nhave the right to use the software, to distribute copies, to receive source\ncode, to change the software and distribute your modifications or the\nmodified software. Also similarly to the GPL, if you distribute verbatim or\nmodified copies of this software, they must be distributed under this\nlicense.\n\nBy modeling the GPL, this license guarantees that you're safe when using\nAxionVueOpenAPI in your work, for teaching or research. This license guarantees\nthat AxionVueOpenAPI will remain available free of charge for nonprofit use. You\ncan modify AxionVueOpenAPI to your purposes, and you can also share your modifications.\nEven in the unlikely case of the authors abandoning AxionVueOpenAPI entirely, this\nlicense permits anyone to continue developing it from the last release, and\nto create further releases under this license.\n\nWe believe that the combination of noncommercial open-source and commercial\nlicensing will be beneficial for the whole user community, because income from\ncommercial licenses will enable faster development and a higher level of\nsoftware quality, while further enjoying the informal, open communication\nand collaboration channels of open source development.\n\nThe precise terms and conditions for using, copying, distribution and\nmodification follow.\n\n ACADEMIC PUBLIC LICENSE\n\n TERMS AND CONDITIONS FOR USE, COPYING, DISTRIBUTION AND MODIFICATION\n\n0. Definitions\n\n\"Program\" means a copy of AxionVueOpenAPI, which is said to be distributed under\nthis Academic Public License.\n\n\"Work based on the Program\" means either the Program or any derivative work\nunder copyright law: that is to say, a work containing the Program or a\nportion of it, either verbatim or with modifications and/or translated into\nanother language. (Hereinafter, translation is included without limitation\nin the term \"modification\".)\n\n\"Using the Program\" means any act of creating executables that contain or\ndirectly use libraries that are part of the Program, running any of the\ntools that are part of the Program, or creating works based on the Program.\n\nEach licensee is addressed as \"you\".\n\n1. Permission is hereby granted to use the Program free of charge for\n noncommercial purposes, including teaching and academic research at\n universities, colleges and other educational institutions and personal\n non-profit purposes. For using the Program for commercial purposes,\n including but not restricted to consulting activities, design of commercial\n hardware or software networking products, and joint research with a\n commercial entity, government-funded, EU-funded, military or similar\n research projects, you have to contact the Author at imaging.support@axionbio.com\n for an appropriate license. Permission is also granted to use the Program\n for a reasonably limited period of time for the purpose of evaluating its\n usefulness for a particular purpose.\n\n2. You may copy and distribute verbatim copies of the Program's\n source code as you receive it, in any medium, provided that you\n conspicuously and appropriately publish on each copy an appropriate\n copyright notice and disclaimer of warranty; keep intact all the\n notices that refer to this License and to the absence of any warranty;\n and give any other recipients of the Program a copy of this License\n along with the Program.\n The program is provided on an \"as-is\" basis. The maintainers of the program\n make no warranties regarding the information provided,\n and disclaims liability for damages resulting from its use.\n Using the program voids the warranty given by the manufacturer of the device.\n\n3. You may modify your copy or copies of the Program or any portion\n of it, thus forming a work based on the Program, and copy and\n distribute such modifications or work under the terms of Section 2\n above, provided that you also meet all of these conditions:\n\n\n a) You must cause the modified files to carry prominent notices\n stating that you changed the files and the date of any change.\n\n b) You must cause any work that you distribute or publish, that in\n whole or in part contains or is derived from the Program or any\n part thereof, to be licensed as a whole at no charge to all third\n parties under the terms of this License.\n\nThese requirements apply to the modified work as a whole. If\nidentifiable sections of that work are not derived from the Program,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works. But when you\ndistribute the same sections as part of a whole which is a work based\non the Program, the distribution of the whole must be on the terms of\nthis License, whose regulations for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote it.\n(If the same, independent sections are distributed as part of a package\nthat is otherwise reliant on, or is based on the Program, then the\ndistribution of the whole package, including but not restricted to the\nindependent section, must be on the unmodified terms of this License,\nregadless of who the author of the included sections was.)\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based or reliant on the Program.\n\nIn addition, mere aggregation of another work not based on the Program\nwith the Program (or with a work based on the Program) on a volume of\nstorage or distribution medium does not bring the other work under\nthe scope of this License.\n\n4. You may copy and distribute the Program (or a work based on it,\n under Section 3) in object code or executable form under the terms of\n Sections 2 and 3 above provided that you also do one of the following:\n\n\n a) Accompany it with the complete corresponding machine-readable\n source code, which must be distributed under the terms of Sections\n 2 and 3 above on a medium customarily used for software interchange; or,\n\n b) Accompany it with a written offer, valid for at least three\n years, to give any third party, for a charge no more than your\n cost of physically performing source distribution, a complete\n machine-readable copy of the corresponding source code, to be\n distributed under the terms of Sections 2 and 3 above on a medium\n customarily used for software interchange; or,\n\n c) Accompany it with the information you received as to the offer\n to distribute corresponding source code. (This alternative is\n allowed only for noncommercial distribution and only if you received\n the program in object code or executable form with such an offer,\n in accord with Subsection b) above.)\n\nThe source code for a work means the preferred form of the work for\nmaking modifications to it. For an executable work, complete source\ncode means all the source code for all modules it contains, plus any\nassociated interface definition files, plus the scripts used to\ncontrol compilation and installation of the executable. However, as a\nspecial exception, the source code distributed need not include\nanything that is normally distributed (in either source or binary\nform) with the major components (compiler, kernel, and so on) of the\noperating system on which the executable runs, unless that component\nitself accompanies the executable.\n\nIf distribution of executable or object code is made by offering\naccess to copy from a designated place, then offering equivalent\naccess to copy the source code from the same place counts as\ndistribution of the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n5. You may not copy, modify, sublicense, or distribute the Program\n except as expressly provided under this License. Any attempt\n otherwise to copy, modify, sublicense or distribute the Program is\n void, and will automatically terminate your rights under this License.\n However, parties who have received copies, or rights, from you under\n this License will not have their licenses terminated so long as such\n parties remain in full compliance.\n\n6. You are not required to accept this License, since you have not\n signed it. Nothing else grants you permission to modify or distribute\n the Program or its derivative works; law prohibits these actions\n if you do not accept this License. Therefore, by modifying or distributing\n the Program (or any work based on the Program), you indicate your\n acceptance of this License and all its terms and conditions for copying,\n distributing or modifying the Program or works based on it, to do so.\n\n7. Each time you redistribute the Program (or any work based on the\n Program), the recipient automatically receives a license from the\n original licensor to copy, distribute or modify the Program subject to\n these terms and conditions. You may not impose any further\n restrictions on the recipients' exercise of the rights granted herein.\n You are not responsible for enforcing compliance by third parties to\n this License.\n\n8. If, as a consequence of a court judgment or allegation of patent\n infringement or for any other reason (not limited to patent issues),\n conditions are imposed on you (whether by court order, agreement or\n otherwise) that contradict the conditions of this License, they do not\n excuse you from the conditions of this License. If you cannot\n distribute so as to satisfy simultaneously your obligations under this\n License and any other pertinent obligations, then as a consequence you\n may not distribute the Program at all. For example, if a patent\n license would not permit royalty-free redistribution of the Program by\n all those who receive copies directly or indirectly through you, then\n the only way you could satisfy both it and this License would be to\n refrain entirely from distribution of the Program.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply and the section as a whole is intended to apply in other\ncircumstances.\n\n9. If the distribution and/or use of the Program are restricted in\n certain countries either by patents or by copyrighted interfaces, the\n original copyright holder who places the Program under this License\n may add an explicit geographical distribution limitation excluding\n those countries, so that distribution is permitted only in or among\n countries not thus excluded. In such case, this License incorporates\n the limitation as if written in the body of this License.\n\n NO WARRANTY\n\n10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n REPAIR OR CORRECTION.\n\n11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED ON IN WRITING\n WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED\n TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGES.\n\n END OF TERMS AND CONDITIONS\n\nInitially written by Andras Varga (public domain) for OMNeT++ https://omnetpp.org/intro/license,\nadapted by CytoSMART TECHNOLOGIES BV. The adaptation is licensed under CC0 1.0 (Public Domain Dedication).\n",
"bugtrack_url": null,
"license": "",
"summary": "This is a python wrapper for the Axion Vue windows app to use it headless",
"version": "1.3.1",
"split_keywords": [
"axionvueopenapi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "62a8c5d5b901e586326823fb38b118814de7a3a0ab60c67b926351155c708715",
"md5": "b59255042c2fa3d16c3df2cc22aa57e4",
"sha256": "aa9885038a75c4fffb37c64447b3f049604de787d605cb7418d9a125dcd158ab"
},
"downloads": -1,
"filename": "AxionVueOpenAPI-1.3.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "b59255042c2fa3d16c3df2cc22aa57e4",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 27643723,
"upload_time": "2023-03-30T09:47:29",
"upload_time_iso_8601": "2023-03-30T09:47:29.373889Z",
"url": "https://files.pythonhosted.org/packages/62/a8/c5d5b901e586326823fb38b118814de7a3a0ab60c67b926351155c708715/AxionVueOpenAPI-1.3.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e22325ec09557b586c7c463ca1f965cc81dc031441e557f50f6d5b6c8aed2541",
"md5": "a6fe9f4bb6717673ef8aa36217258724",
"sha256": "464ad387e75528a179f021cc9c588963be2fcbba6fe5eaac4526db7b982dfcd0"
},
"downloads": -1,
"filename": "AxionVueOpenAPI-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "a6fe9f4bb6717673ef8aa36217258724",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 26755018,
"upload_time": "2023-03-30T09:47:32",
"upload_time_iso_8601": "2023-03-30T09:47:32.927181Z",
"url": "https://files.pythonhosted.org/packages/e2/23/25ec09557b586c7c463ca1f965cc81dc031441e557f50f6d5b6c8aed2541/AxionVueOpenAPI-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-30 09:47:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "cytosmart-bv",
"github_project": "AxionVueOpenAPI",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"requirements": [],
"lcname": "axionvueopenapi"
}