Skip to content

hoa_tools.dataset

Tools for working with individual datasets.

The core class representing a single dataset is Dataset. This inherits from HOAMetadata, which stores all the metadata for a given dataset.

Dataset objects are not designed to be created by users. To get a Dataset, use the get_dataset function in this module.

Dataset pydantic-model

Bases: HOAMetadata

An individual Human Organ Atlas dataset.

Config:

  • extra: forbid

Fields:

is_full_organ property

is_full_organ: bool

Whether this dataset contains the whole organ or not.

is_zoom property

is_zoom: bool

Whether this dataset is a zoom or not.

data_array

data_array(*, downsample_level: int) -> DataArray

Get a DataArray representing the array for this image.

get_children

get_children() -> list[Dataset]

Get child dataset(s).

Child datasets are high-resolution zooms of a full-organ dataset.

Notes

For full-organ datasets, this returns an empty list.

get_parents

get_parents() -> list[Dataset]

Get parent dataset(s).

Parent datasets are full-organ datasets from which a zoom dataset is taken from.

Notes

For zoom datasets, this returns an empty list.

get_registered

get_registered() -> set[Dataset]

Get a set of all datasets that are registered (even indirectly) to this dataset.

change_metadata_directory

change_metadata_directory(data_dir: Path, *, skip_invalid_meta: bool = False) -> None

Update available datasets from another directory of metadata files.

Designed for internal project members to load metadata files that aren't yet public.

Parameters:

Name Type Description Default
data_dir Path

Path to directory of metadata files.

required
skip_invalid_meta bool

If True, skip metadata files that fail validation.

False

get_dataset

get_dataset(name: str) -> Dataset

Get a dataset from its name.

The name of datasets can be looked up using the hoa_tools.inventory module.