NDBioImage
Work in progress
Rust rewrite of python version. Read bio image formats using some Rust code, the libczi api, and if needed the bio-formats java package.
Exposes (bio) images as a numpy ndarray-like object (Python) or a struct that can be sliced like an ndarray Array (Rust), but without loading the whole image into memory, reading from the file only when needed. Some metadata is read and stored in an ome structure. Additionally, it can automatically calculate an affine transform that corrects for chromatic aberrations etc. and apply it on the fly to the image.
Currently, it supports imagej tif files, czi files, micromanager tif sequences and anything bioformats can handle.
To transition to semver, versions before 0.1.0 were yanked from crates.io.
Usage
Python
- Reading an image file and plotting the frame at channel=2, time=1
import matplotlib.pyplot as plt
from ndbioimage import Imread
with Imread('image_file.tif', axes='ctyx', dtype=int) as im:
plt.imshow(im[2, 1])
- Showing some image metadata
from ndbioimage import Imread
from pprint import pprint
with Imread('image_file.tif') as im:
pprint(im)
- Slicing the image without loading the image into memory
from ndbioimage import Imread
with Imread('image_file.tif', axes='cztyx') as im:
sliced_im = im[1, :, :, 100:200, 100:200]
sliced_im is an instance of Imread which will load any image data from file only when needed
- Converting (part) of the image to a numpy ndarray
from ndbioimage import Imread
import numpy as np
with Imread('image_file.tif', axes='cztyx') as im:
array = np.asarray(im[0, 0])
Rust
use ndarray::Array2;
use ndbioimage::{DynReader, Frame, Reader};
fn main() -> Result<(), ndbioimage::error::Error> {
let path = "/path/to/file";
let reader = DynReader::new(&path, 0, 0)?;
println!("shape: {}", reader.shape());
let frame = reader.get_frame(0, 0, 0)?;
if let Ok(arr) = <Frame as TryInto<Array2<i8>>>::try_into(frame) {
println!("{:?}", arr);
} else {
println!("could not convert Frame to Array<i8>");
}
let xml = reader.metadata()?.to_xml()?;
println!("{}", xml);
Ok(())
}
use ndbioimage::{DynReader, Reader};
fn main() -> Result<(), ndbioimage::error::Error> {
let path = "/path/to/file";
let reader = DynReader::new(&path, 0, 0)?;
let view = reader.view();
let view = view.max_proj(3)?;
let array = view.as_array::<u16>()?;
println!("{:?}", array.shape());
Ok(())
}
Command line
ndbioimage --help: show help
ndbioimage info image: show metadata about image
ndbioimage tiff image image.tif -r: copy image into image.tif, while registering channels
ndbioimage movie image image.mp4 -C cyan lime red copy image into image.mp4 (z will be max projected), make channel
colors cyan lime and red
Metadata
Release files for ndbioimage 2027.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ndbioimage-2027.0.8.tar.gz | 398.7 kB | Without provenance | Details for ndbioimage-2027.0.8.tar.gz |
Built distributions (wheels)
Total release size: 201.1 MB
Release files / ndbioimage-2027.0.8.tar.gz
| Download URL | ndbioimage-2027.0.8.tar.gz |
|---|---|
| Size | 398.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d044fe500fef6d180c2e3516afc1424ef2959fa0a00036c75f2a85a0c1f9058e
|
|
BLAKE2b-256 checksum How to use checksums |
d97a33ea8e6cc5cb5beb15edefdb60bcb664133dcec358429a80a143c7f5e0dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-win_arm64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 21.6 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
750d731aa3788766f213b109d7e0f34b1f21d3c09528aa5d3788c44f61108827
|
|
BLAKE2b-256 checksum How to use checksums |
937ee1c2cc268f56cdeae205fbed703fdc81c600c3e61e7ba395babf1401df43
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-win_amd64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 23.2 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
673ac500f6ce69317fd991e94dd19cd3ef351d093a8bd02e5a663ff60fea63db
|
|
BLAKE2b-256 checksum How to use checksums |
1de47857cd488370f294364bf978e377f9c2e4b753f54b18bfd35e28501ef6f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-musllinux_1_2_x86_64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 23.2 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
859bede1f593f68e239a68be99d8a1f4840e4997addf3bfe983dbb258ec4c012
|
|
BLAKE2b-256 checksum How to use checksums |
dabe9a24f9aa844187c3efbae97badbe9e5d8c871a79652af1a03d6c341bc3db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-musllinux_1_2_aarch64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 21.6 MB |
| Tags | CPython 3.10 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
6d065a1597e8169193bbc9ace452a5df42d9ba938ed155c73491430410fa6863
|
|
BLAKE2b-256 checksum How to use checksums |
c6d3f4a0931202135e4e26dfc4a6d2e238d548e4922c71d49738543f2436902c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 23.2 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b259e83e3580cc9b2be3db14892035d1c5898dd1680c423d0b1f41d20d91b4d4
|
|
BLAKE2b-256 checksum How to use checksums |
0a53196809986ff16101c4ad18eecc8714f93966630ad2d00e18ce4e976d7e96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-manylinux_2_34_aarch64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 21.6 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d1230d5c72f03a7220def1142db7a7d7ed009dee9f6d5c5514d4949c6d517cb7
|
|
BLAKE2b-256 checksum How to use checksums |
7f707d012a64e40facdaf1e8d2f7c9716aa42bbc92da4cff33dd366b507d3ea5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 32.4 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9ac081b77ab1e88ba2007373fc393e00ee3dc2ed9f559e5079d944649f0b4a31
|
|
BLAKE2b-256 checksum How to use checksums |
cf24258fc903eb4de8ee02d8c0c4eba183ab178b4ea93397e0b9c5b2230d8579
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ndbioimage-2027.0.8-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | ndbioimage-2027.0.8-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 33.9 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
cf1bca5b15b735e056a3bdd0688342aebb8f125e9b29657458f626ae961695ac
|
|
BLAKE2b-256 checksum How to use checksums |
8e8b150a2fc07d3d4fcde711efb912e43fa09c062ef2fb72d94d415314e5e738
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ndbioimage 2027.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.