No project description provided
Project description
acquire-imaging
This python package provides a multi-camera video streaming library focusing on performant microscopy.
Note This is an early stage project. If you find it interesting please reach out!
Support for:
- Up to two independent video streams
- Camera support:
- Hamamatsu Orca Fusion BT (C15440-20UP) (windows only)
- Vieworks VC-151MX-M6H00
- Streaming file format support:
- Tiff
- Zarr v2
Installation
python -m pip install acquire-imaging
Usage
See the tests for more examples.
The provided napari plugin is a good example of how to stream for visualization.
List devices
import acquire
print(acquire.Runtime().device_manager().devices())
Finite triggered acquisition
import acquire
runtime=acquire.Runtime()
dm=runtime.device_manager()
props=runtime.get_configuration()
# select the first Hamamatsu camera
props.video[0].camera.identifier = dm.select(DeviceKind.Camera, "hamamatsu.*")
# stream to zarr
props.video[0].storage.identifier = dm.select(DeviceKind.Storage, "zarr")
props.video[0].storage.settings.filename="out.zarr"
props.video[0].camera.settings.shape = (2304, 2304)
props.video[0].camera.settings.pixel_type = SampleType.U16
props.video[0].max_frame_count = 100
props=runtime.configure(props)
runtime.start()
runtime.stop() # wait for acquisition to complete
Development
We welcome contributors. The following will help you get started building the code.
Environment
Requires
- CMake 3.23+ (download page or via chocolatey)
- A C++20 compiler (Microsoft Visual Studio Community download page, or clang)
- Rust (via rustup, see install page)
- conda (optional; via miniconda)
- libclang >= v5.0 (on windows via choco
choco install llvm
or, on osx, via brewbrew install llvm
)
It's strongly recommended you create a python environment for development
conda create --name acquire python=3.11
conda activate acquire
Build
conda activate acquire
git submodule update --init --recursive
pip install maturin
maturin build -i python
Important When updating the 'acquire-video-runtime' (the c api), to need to manually trigger
a rebuild by touching wrapper.h
.
git submodule update # updates acquire-video-runtime
touch wrapper.h # will trigger a rebuild
python -m build
This package depends on a submodule (acquire-video-runtime) and binaries from the following Acquire drivers:
The build script will automatically try to fetch the binaries from GitHub releases.
In order to configure which release of each driver to use, you can set the value in drivers.json
:
{
"acquire-driver-common": "0.1.0",
"acquire-driver-hdcam": "0.1.0",
"acquire-driver-egrabber": "0.1.0",
"acquire-driver-zarr": "0.1.0"
}
These values can be set to a specific version, or to nightly
for nightly builds.
Develop
pip install -e ".[testing]"
pytest -s --tb-short --log-cli-level=0
This project uses pre-commit
to run required
checks as git hooks.
pip install pre-commit
pre-commit install
Troubleshooting
Maturin can't find a python interpreter
Maturin
is a command line tool associated with
pyo3
. It helps automate the build and packaging
process. It's invoked by setuptools
during a build.
- Double-check you've activated the right conda environment.
- Try
maturin build -i python
This seems to happen on windows in anaconda environments when multiple python interpreters are available on the path.
It seems to happen less frequently when invoked via pip - pip install -e .
will end up invoking maturin.
Working with an editable install, how do I update the build?
It depends on what you changed:
- acquire-video-runtime (c/c++ code):
touch wrapper.h; maturin develop
- rust code:
maturin develop
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 Distributions
Built Distributions
Hashes for acquire_imaging-0.1.4-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 872324f270ada7ebe99912a90e3b9b2e8849699b4c09ca77b41a6591299758a1 |
|
MD5 | 7f8bcb9db29c06c1b7880255d49b90fc |
|
BLAKE2b-256 | c1876d1930826957a7c5cbc2247a4eb6507df3d57e8eefb67087738082f698cc |
Hashes for acquire_imaging-0.1.4-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90ea615098d9a27383a5a808dbda1fd2f3d4f5ed09add9a824a1dc079aa6f301 |
|
MD5 | adf925ccae619c8e21d4ca591c278871 |
|
BLAKE2b-256 | 8519af77a0c3c6b45e754d2cdb89ec1a77d503072b68bbd399acc61a7ca4704e |
Hashes for acquire_imaging-0.1.4-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb7b3ce7733b3c63fa0b91dbf4c4d1ad5df6cb6f9c44501bac543b020fbe264 |
|
MD5 | fb88881a332056300d968fdf7f733a1d |
|
BLAKE2b-256 | 8f5637b447b90e59f80d244667fd7265d66430dc41b04f6f8a2544a2715864d6 |