This is a package that connects ImSwitch's REST API to the rest of the world (e.g. jupyter lab)
Project description
ImSwitchClient
This is a package that connects ImSwitch's REST API to the rest of the world (e.g. jupyter lab)
- Free software: MIT license
- Documentation: https://imswitchclient.readthedocs.io.
Install
pip install imswitchclient
Features
- remote control ImSwitchUC2 from the Jupyter Notebook with the fastapi endpoints
- access fastapi on http://localhost:8000/docs
Example
#%%
#%%
import imswitchclient.ImSwitchClient as imc
import numpy as np
import matplotlib.pyplot as plt
import cv2
stageName=None
scanMax=100
scanMin=-100
scanStep = 50
rescalingFac=10.0
gridScan=True
# Instantiate the ImSwitchClient
client = imc.ImSwitchClient()
#%%
# Test the get_positioner_names method
positioner_names = client.positionersManager.getAllDeviceNames()
print("Positioner Names:", positioner_names)
#%%
#
# Test the move_positioner method
positioner_name = positioner_names[0]
axis = "X"
dist = 1000
is_absolute = True
is_blocking = False
response = client.positionersManager.movePositioner(positioner_name, axis, dist, is_absolute, is_blocking)
print("Move Positioner Response:", response)
#%%
# Test the snap_numpy_to_fastapi method
image_array = client.recordingManager.snapNumpyToFastAPI()
print("Image Array Shape:", image_array.shape)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
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
imswitchclient-0.1.1.tar.gz
(11.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imswitchclient-0.1.1.tar.gz.
File metadata
- Download URL: imswitchclient-0.1.1.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cbda3708d7ae20ca0c3899aad96376a14d2d0a81467b49778489ef751912c8e
|
|
| MD5 |
d6e031e6f6f9034b5c2c4e80d8e56c6e
|
|
| BLAKE2b-256 |
96f9ee0224c6bfac7027f181eda3287fde28ad3cdc9cb5b694f4599dd3c90963
|
File details
Details for the file imswitchclient-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: imswitchclient-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
675355d37af2d3ec3a48141b48c2382e6f33c9734f7e025c7a424d47066b6b35
|
|
| MD5 |
59cbef4ab8f3e4f5c0671f2e0abd46a4
|
|
| BLAKE2b-256 |
cb9cd84ded470fa620b86ccfabc6e30742abfc075065be2901ffabcc384c0970
|