Skip to main content

Scifo (Scientific Zarr) is a Python library for working with the Scifo image format

Project description

Scifo

License Apache Software License 2.0 PyPI Python Version codecov

Scifo (Multi-Resolution Zarr) is a Python library for working with the Scifo image format, designed specifically for 2D and 3D data. Scifo provides a comprehensive solution for storing, compressing, and efficiently manipulating image data with multi-resolution views. This readme provides an overview of the Scifo library and its key features.

Features

  • Multi-Resolution Views: Scifo supports multi-resolution representations of image data, allowing fast and efficient viewing at different levels of detail. This feature enables quick navigation and exploration of large images. Typically, this creates only a ~10% overhead.

  • Low Memory Consumption Scifo requires almost no memory even when loading and vieweing large multi-dimensional images due to memory-mapping, chunking and its multi-resolution views.

  • Automatic Chunking: Scifo incorporates automatic chunking for optimal performance. The library intelligently divides the image data into smaller chunks, resulting in fast loading, saving, and manipulation operations. Chunking also enables memory mapping of the image for efficient usage of system resources.

  • Array-Like Slicing: Scifo supports array-like slicing, allowing users to extract specific regions or subsets of the image data. This feature enables the selection of portions of the image based on desired coordinates, indices, or ranges. Array-like slicing provides flexibility in manipulating and analyzing the image data by operating only on the selected regions of interest. It avoids the need to load the entire dataset into memory, resulting in efficient memory usage and faster processing times.

  • Lossless Compression: Scifo utilizes the modern lossless JpegXL compressor for compressing the image data on a chunk basis. This compression method offers improved compression benefits compared to other 2D and 3D image formats. The chunk-based compression enables memory mapping of the image while still achieving high compression ratios.

  • Lossy Compression (Optional): In addition to lossless compression, Scifo provides an option for using lossy JpegXL compression. This option offers even better compression ratios, which can be advantageous in scenarios where the preservation of every detail is not critical.

  • Arbitrary Metadata: Scifo supports the storage of arbitrary metadata along with the image data. This feature allows you to associate additional information, such as annotations, tags, or custom properties, with the image.

Installation

You can install scifo via pip:

pip install scifo

Getting Started

To begin using the Scifo library, you can refer to the example code provided below:

import numpy as np
from scifo import Scifo

# Create or load your image array using NumPy
image = np.random.random((512, 512))

# Initialize an instance of Scifo with your image array
scifo = Scifo(image)

# Manipulate the image array using slicing
scifo[100:200, 100:200] = 1.0  # Set a 100x100 region to a value of 1.0

# Save the Scifo instance to disk
scifo.save(path="path/to/save.scifo")

# Initialize an instance of Scifo from the saved file
loaded_mzarr = Scifo("path/to/save.scifo")

# Access the image data as a NumPy array
loaded_image = loaded_mzarr.numpy()

# Retrieve metadata associated with the Scifo file
metadata = loaded_mzarr.attrs()

# Perform operations on the image or metadata as needed
# ...

For more detailed usage instructions and a complete list of available methods and parameters, please refer to the Scifo library documentation.

Contributing

We welcome contributions to the Scifo library! If you encounter any issues, have suggestions for improvements, or would like to add new features, please submit a pull request or open an issue on the official repository.

License

The Scifo library is released under the MIT License. Feel free to use and modify the library according to your needs.

Acknowledgments

The development of the Scifo library is made possible by the contributions of the open-source community. We would like to express our gratitude to all the individuals and organizations that have contributed to the project.

If you have any questions or need further assistance, please don't hesitate to reach out to the Scifo library maintainers or consult the documentation for additional information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

scifo-0.0.9-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file scifo-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: scifo-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for scifo-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c3e39fee974c3a01f76827a2459fb81172bf00f14145322dbdb25cf19703dcf6
MD5 a5fc2868f6d92db8518142cc3a6c1bea
BLAKE2b-256 b8620791f865824ada82ec84c85ed3daf9bb3afc9629a0dbaf968f13741a4a2c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page