nii-rs
Rust library for reading/writing NIfTI-1 (nii.gz) files, with SimpleITK/NiBabel-like APIs, native Rust support, and Python bindings for cross-language performance.
If you have used SimpleITK/NiBabel, you will definitely love this and get started right away! 🕶
🎨Features
-
🚀Pure Rust Implementation: Thanks to nifti-rs, I/O speed is comparable to SimpleITK and slightly faster than NiBabel.
-
✨ Carefully Designed API: Super easy to use, with no learning curve; enjoy a consistent experience in Rust as in Python. Ideal for developers familiar with ITK-style libraries.
-
🛠️Rust-Python bindings: Write heavy operations in Rust and easily call them in Python, combining the performance of Rust with the flexibility of Python.
🔨Install
For Rust projects, add the following to your Cargo.toml:
[dependencies]
nii-rs = "*"
For Python, install via pip:
pip install nii-rs
🥒Develop
To start developing with nii-rs, use the following command:
maturin dev -r
📘Examples
For details, please refer to the rust examples and python examples。
🦀Rust
use nii;
// read image
let im = nii::read_image::<f32>("test.nii.gz");
// get attrs, style same as SimpleITK
let spacing: [f32; 3] = im.get_spacing();
let origin: [f32; 3] = im.get_origin();
let direction: [[f32; 3]; 3] = im.get_direction();
// get affine, style same as nibabel
let affine = im.get_affine();
// get array, style same as SimpleITK, i.e.: [z, y, x]
let arr: &Array3<f32> = im.ndarray();
// write image
nii::write_image(&im, "result.nii.gz")
🐍Python
import nii
# read image
im = nii.read_image("test.nii.gz")
# get attrs, style same as like SimpleITK
spacing = im.get_spacing()
origin = im.get_origin()
direction = im.get_direction()
# get affine, style same as nibabel
affine = im.get_affine()
# get array, style same as SimpleITK, i.e.: [z, y, x]
arr = im.ndarray()
# write image
nii.write_image(im, "result.nii.gz")
🔒License
Licensed under either of the following licenses, at your choice:
Apache License, Version 2.0
(See LICENSE-APACHE or visit http://www.apache.org/licenses/LICENSE-2.0)
MIT License
(See LICENSE-MIT or visit http://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project, as defined by the Apache License 2.0, will be dual-licensed under the above licenses without any additional terms or conditions.
Metadata
Release files for nii-rs 0.1.2
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 |
|---|---|---|---|---|
| nii_rs-0.1.2.tar.gz | 20.3 kB | Without provenance | Details for nii_rs-0.1.2.tar.gz |
Built distributions (wheels)
Total release size: 15.8 MB
Release files / nii_rs-0.1.2.tar.gz
| Download URL | nii_rs-0.1.2.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25a92f02f035c3b72494814b6d3b30bf3ce109ef5a076c8e7221b8bb3a402772
|
|
BLAKE2b-256 checksum How to use checksums |
2d42b849c2ed6e42687a88877592b0a927ea4f316082361e59cabbc3d9a5137a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 695.0 kB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
e6e540e20e1772d11bdf469827ab60dd078d3016655f285fbbfba33271623142
|
|
BLAKE2b-256 checksum How to use checksums |
c4b78fe08ddfb5d970e1e58d3d44b3da174ceb46f3d0102942023019a79573c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 745.4 kB |
| Tags | Linux glibc 2.17+ x86-32 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
28d26375d7d3b949558f07a5eaaefba47a9b23968ddf69ab3f03fe769d8ffa70
|
|
BLAKE2b-256 checksum How to use checksums |
5e2c80a83a1be0ca847660d943a5f21c9e8466c7ee8edcb8dee5a5488760acac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp313-cp313-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 495.5 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d381ee8db9e7501b733ca72623c0dd7743d3eb76e3568c1778bd9351b6a9527f
|
|
BLAKE2b-256 checksum How to use checksums |
430d3255b674f8e3fe6ba958f94f5a094368d4213c6686a42f5673d584fa0200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp313-cp313-win32.whl
| Download URL | nii_rs-0.1.2-cp313-cp313-win32.whl |
|---|---|
| Size | 452.7 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
73e1554db7cda9713b82e7d7f21a24871be368ab3611380819d3c012b3be08f6
|
|
BLAKE2b-256 checksum How to use checksums |
94615ce71da61703e59c0eb330442ef173e70572b45884535234c576fd68171a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 694.0 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e9c69adde04055f55af260a7bb83472e629fa88e7eb5cabbfe193c2ee2689415
|
|
BLAKE2b-256 checksum How to use checksums |
f4133d8d722b6aa78750fb9d52c41ae18972f9c6376428370a13e9ebf3914088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 746.2 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
d77cabb880856eb033b5833d32696b21a212a86b26460466f60ce59a546b6dc1
|
|
BLAKE2b-256 checksum How to use checksums |
8b52a728e18205252d9a071a31f61c5a650480f3450253bf3ee5b224f75a9b46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp312-cp312-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 495.6 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e11fc79708e68abf63a4063d072f316735a0f9fe174ce8ffb66c96de58d90b0a
|
|
BLAKE2b-256 checksum How to use checksums |
3360d678547bee95f1e1c2fa848a6c18357c0b00d3e56d59d5d04c2d32992cf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp312-cp312-win32.whl
| Download URL | nii_rs-0.1.2-cp312-cp312-win32.whl |
|---|---|
| Size | 452.7 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
6025d044995a9076ab704056bdf497da4cc4794174aab7d4ef4e38d211a4d77f
|
|
BLAKE2b-256 checksum How to use checksums |
ed0a96bac30267e79c757295b307d64577db9201c8f6c1306f43dd9eeef50faf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 694.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
912823025ef3b8e5b6b59d1503553c874d256a6b27c7fdda6e4dc138d8f45ef9
|
|
BLAKE2b-256 checksum How to use checksums |
50b01e633eefa042d08adea9f2eccb1af74666cd612c7f423230096c6a351337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 746.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
b93fcc4615b3d95e5a21584aeba3006ed5eafd60417e6e6c5f567d7b3f63e7e0
|
|
BLAKE2b-256 checksum How to use checksums |
75311da05ff06475a2f18027a7a5cd6aeec318e19524f5851f20b8e4f1796189
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp311-cp311-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 493.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1bf2f2e571c1a64eb37c96da229fa7b986393196621472f8923e19282e349401
|
|
BLAKE2b-256 checksum How to use checksums |
1adda9ef9852f136507a80975b6f367b09e5023639169dc22b5f52c5ff89c67b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp311-cp311-win32.whl
| Download URL | nii_rs-0.1.2-cp311-cp311-win32.whl |
|---|---|
| Size | 452.7 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f030288640dbbb9f6fd77c736f2b84a20adafd0bbeb3940e4796de3dd8bc2db7
|
|
BLAKE2b-256 checksum How to use checksums |
c4cb02dde55f946f4c3125fe209b489b21470b6aa43265183ecaea1e274e5b52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 694.6 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9f509e941a82e06697fb1b683cfb361c479bf9f8e2d75c1691d4fc756d32c074
|
|
BLAKE2b-256 checksum How to use checksums |
d5a4ab0c964f371f3df24911e6fd919a535a42d4aed2efbb21f94e7083cc6a74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 746.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
a01766ed6a822ee191ffa99e304a6be4f08a6d9ccbdf0f4751c170f874327fd0
|
|
BLAKE2b-256 checksum How to use checksums |
e893e01e638d49cf44c852d7b60a093e20669d17e322495b70296614212dfd61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp310-cp310-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 493.7 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
01d081ca7795b2189a91c87ec9cf87374fd6e300917c37f070e5a313d3ea5d7e
|
|
BLAKE2b-256 checksum How to use checksums |
5ef4a17bcc3ee6060e132d5244542d4486b531f4259320251dcd5181952ab5d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp310-cp310-win32.whl
| Download URL | nii_rs-0.1.2-cp310-cp310-win32.whl |
|---|---|
| Size | 452.6 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
2cb7016e0cb87b06ff1d5b890d0847f38844ffdd9ebe368e0d2304210fe712ba
|
|
BLAKE2b-256 checksum How to use checksums |
9e0261007414f6003c82b768fede0be2e7b0fbe5b88c95182e77362ec472039f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 694.8 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
be3c14a0faf8dfcc17a575fd2d719265557c8cbff7d218f843bc675c1fdf2b17
|
|
BLAKE2b-256 checksum How to use checksums |
782216ab0ec5fe7b429e530d6107463ed0e935a6878a7c01edee60bd589420b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 746.5 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
b806dbc65530475d1e21592b413ee1a756bd15735b4572413fa834c90f58625b
|
|
BLAKE2b-256 checksum How to use checksums |
cc4d7676ed006032a58d699e4e6ec73e3c0407352120170f9014d98ffa648021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp39-cp39-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 494.4 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4c53be03921c54f2afef5df08584dc97498c3f9f0a466ffbe6445aa4c6fda35f
|
|
BLAKE2b-256 checksum How to use checksums |
f4799034faeed6a86f47df64805721801df934d62a85fe0feac5998dd55a1646
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp39-cp39-win32.whl
| Download URL | nii_rs-0.1.2-cp39-cp39-win32.whl |
|---|---|
| Size | 452.9 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
e050022b1b94e4c6b673e05bfb85dd00412047d37d611bbfce07437888cf9d86
|
|
BLAKE2b-256 checksum How to use checksums |
0386505c0d6dd49ee5e2132079a666cb2bf0403bd2da1ecef93fa7cfd909a490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 695.7 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d96fe78fa8857913de74f9b3bd0b1b54a8f38ea4c1c680f416d4cf76027891c2
|
|
BLAKE2b-256 checksum How to use checksums |
ef6f1e88b1e448b75ab47d4aaffdf6c701f26e3d1514b26f836a20e64344443c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 747.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
55d99c2889fc06040569c989d28d017e7427720e47c560d21575869ffaa4e465
|
|
BLAKE2b-256 checksum How to use checksums |
2f901b7c279e92f24229aaac6bc3171e2c3213a9ede3ffc872b7a8ca206a75a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp38-cp38-win_amd64.whl
| Download URL | nii_rs-0.1.2-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 494.3 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dcc54a9acae826ea2d0cd3162b3a370246d10cd66799ae892f987c5b7ef723e7
|
|
BLAKE2b-256 checksum How to use checksums |
0d1424464feee85da32c77de8c3f4218bf7102aa93c87fe84325cc573cef47ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp38-cp38-win32.whl
| Download URL | nii_rs-0.1.2-cp38-cp38-win32.whl |
|---|---|
| Size | 452.5 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
ae2b4a44157b514863c46690739f5a649c0fe21da9ed4ce6486afd870d5ef86f
|
|
BLAKE2b-256 checksum How to use checksums |
79ee0ea16f76e9709e8da19d3a66e35de7e26a2028471c1b4603c4da0daa2318
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nii_rs-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 695.8 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d986abb5279fed476e6154f5d34b5f46c54f501b93745e7289a3d38aada23dad
|
|
BLAKE2b-256 checksum How to use checksums |
72461895e16c1fcece9b382e6660375e50adf0c7f6112880471053a0c3ebed8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Release files / nii_rs-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | nii_rs-0.1.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 747.1 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-32 |
|
SHA-256 checksum How to use checksums |
3b1a876285ad882a4dc68b94dea4396636db1f35ba196dc5c481bec3752dd46b
|
|
BLAKE2b-256 checksum How to use checksums |
e85e80e92b6b50a6782722075742d093d38c547e452920bd9afc5b43f0e16d2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.8.2
|
Security for nii-rs 0.1.2
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.