RosettaSciIO is a Python library for reading and writing various scientific file formats, designed with a focus on ease of use and integration with scientific data analysis tools like HyperSpy. It supports a wide range of formats including HDF5, TIFF, DigitalMicrograph (DM3/DM4), and more, often leveraging optional backend libraries. The current version is 0.13.0, and new minor releases occur every few months, introducing new features and format support.
pip install rosettasciioVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to save a NumPy array to a common image format (PNG) and then read it back using RosettaSciIO. This leverages the `Pillow` dependency, which is installed by default.
Install `rosettasciio` with the necessary extras, for example, `pip install "rosettasciio[gatan-dm]"` for Gatan files, `pip install "rosettasciio[tifffile]"` for advanced TIFF, or `pip install "rosettasciio[all]"` for all optional features.
Ensure your Python environment is running Python 3.10 or later. Consider using `pyenv` or `conda` to manage Python versions.
Install `rosettasciio` with the `dask` and `hspy` extras (e.g., `pip install "rosettasciio[hspy]"` or `pip install "rosettasciio[all]"`). When reading, check documentation for lazy loading options relevant to your file format.
If you intend to work with `hyperspy` signals, install `hyperspy` as an optional dependency: `pip install "rosettasciio[hspy]"`.