Metadata-Version: 2.4
Name: tomoz
Version: 0.2.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: System :: Archiving :: Compression
Requires-Dist: numpy>=1.24
Summary: Learned lossless compression for medical image volumes
Home-Page: https://github.com/ZeroXShot/tomoz
Author: ZeroXShot
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/ZeroXShot/tomoz

# tomoz (Python)

Python bindings of [Tomoz](https://github.com/ZeroXShot/tomoz), the learned
lossless codec for medical image volumes.

```python
import numpy as np
import tomoz

volume = np.load("ct.npy")            # (slices, rows, columns), int16/uint16/uint8/int8
data = tomoz.encode(volume)
assert np.array_equal(tomoz.decode(data), volume)
print(tomoz.info(data)["bits_per_sample"])
```

DICOM archives restore every file byte for byte:

```python
archive, report = tomoz.pack_dicom([("1.dcm", open("1.dcm", "rb").read())])
files = tomoz.unpack_dicom(archive)   # [(name, bytes)]
```

