zea.data

Data subpackage for working with the zea data format.

This subpackage provides core classes and utilities for working with the zea data format, including file and dataset access, validation, and data loading. For more information on the zea data format, see Data.

Main classes

  • zea.data.File – Open and access a single zea HDF5 data file.

  • zea.data.Dataset – Manage and iterate over a collection of zea data files.

See the data notebook for a more detailed example: Working with the zea data format

Examples usage

>>> from zea import File, Dataset

>>> # Work with a single file
>>> path_to_file = (
...     "hf://zeahub/picmus/database/experiments/contrast_speckle/"
...     "contrast_speckle_expe_dataset_iq/contrast_speckle_expe_dataset_iq.hdf5"
... )

>>> with File(path_to_file, mode="r") as file:
...     # file.summary()
...     data = file.load_data("raw_data", indices=[0])
...     scan = file.scan()
...     probe = file.probe()

>>> # Work with a dataset (folder or list of files)
>>> dataset = Dataset("hf://zeahub/picmus")
>>> files = []
>>> for file in dataset:
...     files.append(file)  # process each file as needed
>>> dataset.close()

Modules

augmentations

Augmentation layers for ultrasound data.

convert

Data conversion of datasets to the zea data format.

data_format

Functions to write and validate datasets in the zea format.

dataloader

H5 dataloader for loading images from zea datasets.

datasets

zea.data.datasets

file

zea H5 file functionality.

file_operations

This module provides some utilities to edit zea data files.

layers

Keras layers for data preprocessing.

preset_utils

Preset utils for zea datasets hosted on Hugging Face.

utils

Utility functions for zea datasets.