magmap.atlas.labels_meta module

Labels image metadata.

class magmap.atlas.labels_meta.LabelsMeta(prefix=None)[source]

Bases: object

Labels image metadata container and I/O.

Variables:
  • prefix – Path prefix for saving metadata and locating the reference file path. Any extension will be removed. Defaults to None.

  • save_path – Path to save this metadata.

  • path_ref – Path to labels reference file.

  • region_ids_orig – Sequence of original label IDs.

PATH_LABELS_META: str = 'meta_labels.yml'
load()[source]

Load metadata from a YAML file.

save()[source]

Save the metadata.

Also copies the reference file to the metadata’s directory.

property save_path

Get the save path.

Returns:

The save path if set, otherwise a path constructed from prefix if set and PATH_LABELS_META, or the constant alone.