napari plugin to store napari projects in a .h5 file. Label layer are stored in a sparse representation (COO list).
This napari plugin was generated with Cookiecutter using with @napari’s cookiecutter-napari-plugin template.
This napari plugin provides a writer and reader to store existing layers in the current napari window, all the metadata is stored as well in a HDF5 file. All the stored preferences are included when a project file is opened.
Label layers are stored in a coordinate list sparse representation with the Sparse module to keep the project file size minimum when possible (aiming to implement this in other layers in the future).
The project file is a HDF5 generated with the h5py module. The file groups correspond to the different napari layer types and the layer metadata is stored as attributes of each layer.
In the case of the meta dictionary which is nested in the LayerData meta dictionary (napari IO), new keys are generated in the outer dictionary to use them as h5 dataset attributes. This nested dictionary architecture is reconstructed by the reader to ensure format compatibility.
You can install napari-hdf5-labels-io
via pip:
pip install napari-hdf5-labels-io
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the GNU GPL v3.0 license, “napari-hdf5-labels-io” is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.