- implement shape in Rust

- implement more readers
- fix downloading of bioformats jar
- (mostly) compatible with python version
This commit is contained in:
w.pomp
2026-07-13 13:40:34 +02:00
parent 705ca16379
commit ff7cd562af
36 changed files with 7946 additions and 2843 deletions
+47 -33
View File
@@ -1,20 +1,19 @@
[package]
name = "ndbioimage"
version = "0.1.0"
version = "0.2.0"
edition = "2024"
rust-version = "1.87.0"
authors = ["Wim Pomp <w.pomp@nki.nl>"]
license = "MIT"
rust-version = "1.94.0"
authors = ["Wim Pomp <w.pomp@nki.nl>", "opencode"]
license = "MIT OR Apache-2.0"
description = "Read bio image formats using the bio-formats java package."
homepage = "https://git.wimpomp.nl/wim/ndbioimage/src/branch/rs"
repository = "https://git.wimpomp.nl/wim/ndbioimage/src/branch/rs"
homepage = "https://git.pomppervova.nl/wim/ndbioimage/src/branch/rs"
repository = "https://git.pomppervova.nl/wim/ndbioimage/src/branch/rs"
documentation = "https://docs.rs/ndbioimage"
readme = "README.md"
keywords = ["bioformats", "imread", "ndarray", "metadata"]
categories = ["multimedia::images", "science"]
exclude = ["/tests"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "ndbioimage"
crate-type = ["cdylib", "rlib"]
@@ -22,50 +21,65 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
clap = { version = "4", features = ["derive"] }
color-eyre = { version = "0.6", optional = true }
console = { version = "0.16", optional = true }
downloader = { version = "0.2", optional = true }
ffmpeg-sidecar = { version = "2", optional = true }
itertools = "0.14"
itertools = "0.15"
indexmap = { version = "2", features = ["serde"] }
indicatif = { version = "0.18", features = ["rayon"], optional = true }
j4rs = "0.24"
j4rs = { version = "0.25", optional = true }
libczirw-sys = { path = "../libczirw-sys", optional = true }
ndarray = { version = "0.17", features = ["serde"] }
num = "0.4"
numpy = { version = "0.28", optional = true }
ordered-float = "5"
numpy = { version = "0.29", optional = true }
ome-metadata = { path = "../ome-metadata/ome-metadata" }
ordered-float = { version = "5", optional = true }
phf = { version = "0.14", features = ["macros"] }
postcard = { version = "1", features = ["use-std"], optional = true }
pyo3 = { version = "0.29", features = ["abi3-py310", "eyre", "anyhow", "generate-import-lib"], optional = true }
pyo3-stub-gen = { version = "0.23", optional = true }
rayon = { version = "1", optional = true }
serde = { version = "1", features = ["rc"] }
serde_json = { version = "1", optional = true }
regex = "1"
serde = { version = "1", features = ["rc", "derive"] }
serde_yaml = { version = "0.9", optional = true }
serde_with = "3"
tiffwrite = { version = ">=2026.1.1, <2026.2.0", optional = true}
thread_local = "1"
ome-metadata = "0.4"
lazy_static = "1"
strum = { version = "0.28", features = ["derive"] }
thiserror = "2"
[dependencies.pyo3]
version = "0.28"
features = ["extension-module", "abi3-py310", "eyre", "generate-import-lib"]
optional = true
tiff = { version = "0.11", features = ["zstd"], optional = true }
tiffwrite = { version = "2026.6.0", optional = true }
tokio = { version = "1", features = ["rt", "rt-multi-thread"], optional = true }
thread_local = { version = "1", optional = true }
xmltree = { version = "0.12", optional = true }
bioformats = { version = "0.1", optional = true }
[dev-dependencies]
downloader = "0.2"
rayon = "1"
regex = "1"
reqwest = { version = "0.13", features = ["blocking"] }
[build-dependencies]
j4rs = "0.24"
j4rs = "0.25"
ffmpeg-sidecar = "2"
retry = "2"
toml = "1"
[features]
# Enables formats for which code in bioformats with a GPL license is needed
default = []
all = ["bioformats_java", "bioformats_rust", "czi", "gpl-formats", "movie", "tiffseq", "tiffwrite", "tiff"]
gpl-formats = []
# Enables python ffi using pyO3
python = ["dep:pyo3", "dep:numpy", "dep:serde_json", "dep:color-eyre"]
# Enables writing as tiff
tiff = ["dep:tiffwrite", "dep:indicatif", "dep:rayon"]
# Enables writing as mp4 using ffmpeg
movie = ["dep:ffmpeg-sidecar"]
python = ["dep:pyo3", "dep:numpy", "dep:color-eyre", "dep:pyo3-stub-gen", "dep:postcard", "ome-metadata/python"]
czi = ["dep:libczirw-sys", "dep:xmltree", "dep:thread_local"]
bioformats_rust = ["dep:bioformats", "dep:thread_local"]
bioformats_java = ["dep:j4rs", "dep:thread_local", "dep:downloader"]
tiffwrite = ["dep:tiffwrite", "dep:indicatif", "dep:console", "dep:rayon"]
tiffseq = ["dep:tiff", "dep:serde_yaml"]
tiff = ["dep:tiff", "dep:thread_local"]
movie = ["dep:ffmpeg-sidecar", "dep:tokio", "dep:ordered-float", "dep:indicatif", "dep:console"]
[package.metadata.docs.rs]
features = ["gpl-formats", "tiff", "movie"]
features = ["bioformats", "gpl-formats", "czi", "tiff", "movie"]
[profile.test]
inherits = "release"
[profile.dev.package.backtrace]
opt-level = 3