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
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
imswitchclient-0.1.1.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for imswitchclient-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675355d37af2d3ec3a48141b48c2382e6f33c9734f7e025c7a424d47066b6b35 |
|
MD5 | 59cbef4ab8f3e4f5c0671f2e0abd46a4 |
|
BLAKE2b-256 | cb9cd84ded470fa620b86ccfabc6e30742abfc075065be2901ffabcc384c0970 |