numpy2ometiff
numpy2ometiff is a Python library designed to convert NumPy arrays into OME-TIFF files. This library facilitates exporting scientific imaging data to the OME-TIFF format, which is ideal for microscopy and bioimaging applications.
Features
- Simple API: Convert NumPy arrays to OME-TIFF with a single function call.
- Flexible Input: Supports single and multi-dimensional arrays (2D, 3D, 4D) representing multiple channels and z-slices.
- Customizable Metadata: Allows users to specify pixel sizes and channel information.
- Optional Pyramid Creation: Enable pyramid OME-TIFF files for large datasets, improving performance in compatible viewers.
Installation
You can install numpy2ometiff directly via pip:
pip install numpy2ometiff
Example Usage
This example demonstrates how to convert a NumPy array into an OME-TIFF file using the numpy2ometiff library. It assumes you have already installed numpy2ometiff as described in the installation section.
import numpy as np
from numpy2ometiff import write_ome_tiff
# Generate a dummy numpy array
data = np.random.rand(1, 3, 256, 256).astype(np.float32) # 1 z-slice, 3 channels, 256x256 pixels
# Define channel names
channel_names = ['DAPI', 'GFP', 'RFP']
# Define pixel sizes and physical size in Z
pixel_size_x = 0.65 # micron
pixel_size_y = 0.65 # micron
physical_size_z = 0.2 # micron
# Specify the output filename
output_filename = 'output_test_image.ome.tiff'
# Write the OME-TIFF file
write_ome_tiff(data=data,
output_filename=output_filename,
channel_names=channel_names,
pixel_size_x=pixel_size_x,
pixel_size_y=pixel_size_y,
physical_size_z=physical_size_z,
Unit='µm',
imagej=False,
create_pyramid=True,
compression='zlib')
print("The OME-TIFF file has been successfully written.")
Contributing
Contributions to numpy2ometiff are welcome! Feel free to fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.
Metadata
Release files for numpy2ometiff 0.1.4
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 |
|---|---|---|---|---|
| numpy2ometiff-0.1.4.tar.gz | 5.0 kB | Without provenance | Details for numpy2ometiff-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| numpy2ometiff-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for numpy2ometiff-0.1.4-py3-none-any.whl |
Total release size: 10.4 kB
Release files / numpy2ometiff-0.1.4.tar.gz
| Download URL | numpy2ometiff-0.1.4.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da1d164d75cbbd259083058b07aad33d17d6f0b1b39d0570ab030d536d6b3d78
|
|
BLAKE2b-256 checksum How to use checksums |
612620377761aaf09c65d94df513672d92f16af87764450675b12666077a61f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / numpy2ometiff-0.1.4-py3-none-any.whl
| Download URL | numpy2ometiff-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f14710695c68738d69c0e135fbe14e77cca2b925f1326d8fddf15defbb50ff99
|
|
BLAKE2b-256 checksum How to use checksums |
f9949aab0b2e4c94fd309ab46c6df67a61d124ec7e133308478d19e9ac4dafef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for numpy2ometiff 0.1.4
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.