wsic.metadata package

Submodules

wsic.metadata.ngff module

Generation of metadata for the OME-NGFF (zarr) slides.

Based on version 0.4 of the specification: https://ngff.openmicroscopy.org/0.4/

class wsic.metadata.ngff.Axis(name, type, unit=None)[source]

Bases: object

Description of an axis including type and units.

Parameters:
  • name (str) – The name of the axis. Must be one of: “t”, “c”, “z”, “y”, “x”.

  • type (str) – The type of the axis. Msut be one of: “time”, “space”, “channel”.

  • unit (str) – The units of the axis.

name: Literal['t', 'c', 'z', 'y', 'x']
type: Literal['time', 'space', 'channel']
unit: Literal['angstrom', 'attometer', 'centimeter', 'decimeter', 'exameter', 'femtometer', 'foot', 'gigameter', 'hectometer', 'inch', 'kilometer', 'megameter', 'meter', 'micrometer', 'mile', 'millimeter', 'nanometer', 'parsec', 'petameter', 'picometer', 'terameter', 'yard', 'yoctometer', 'yottameter', 'zeptometer', 'zettameter'] | Literal['attosecond', 'centisecond', 'day', 'decisecond', 'exasecond', 'femtosecond', 'gigasecond', 'hectosecond', 'hour', 'kilosecond', 'megasecond', 'microsecond', 'millisecond', 'minute', 'nanosecond', 'petasecond', 'picosecond', 'second', 'terasecond', 'yoctosecond', 'yottasecond', 'zeptosecond', 'zettasecond'] | None = None
class wsic.metadata.ngff.Channel(active=True, coefficient=1.0, color='FF0000', family='linear', inverted=False, label='Red', window=<factory>)[source]

Bases: object

Description of a single channel.

Parameters:
  • active (bool) – Whether the channel is active by default.

  • color (str) – The color of the channel in hexadecimal format. E.g. “FF0000” for red.

  • family (str) – The family of the channel. E.g. “linear”.

  • inverted (bool) – Whether the channel is inverted.

  • window (Window) – The min and max values represented in the channel.

  • coefficient (float) –

  • label (str) –

active: bool = True
coefficient: float = 1.0
color: str = 'FF0000'
family: str = 'linear'
inverted: bool = False
label: str = 'Red'
window: Window
class wsic.metadata.ngff.CoordinateTransformation(type='identity', scale=None)[source]

Bases: object

Transformation from the zarr to slide coordinate system.

Parameters:
  • type (str) – The type of coordinate transform. E.g. “scale”.

  • scale (List[float]) – The scale factors. Must be one for each axis.

scale: List[float] | None = None
type: str = 'identity'
class wsic.metadata.ngff.Creator(name='wsic', version='0.9.0')[source]

Bases: object

Record the creator (wsic) information.

Parameters:
  • name (str) – The name of the creator.

  • version (str) – The version of the creator.

name: str = 'wsic'
version: str = '0.9.0'
class wsic.metadata.ngff.Dataset(path='0', coordinateTransformations=<factory>)[source]

Bases: object

Description of a single resolution.

Parameters:
  • path (str) – Path to the dataset. This will usually be a string of an integer e.g. “0”.

  • coordinateTransformations (List[CoordinateTransform]) – Transformations from the zarr to slide coordinate system.

coordinateTransformations: List[CoordinateTransformation]
path: str = '0'
class wsic.metadata.ngff.Multiscale(axes=<factory>, datasets=<factory>, version='0.4')[source]

Bases: object

Description of multiple resolutions present.

Parameters:
  • axes (List[Axis]) – The axes of the multiscales.

  • datasets (List[Dataset]) – The datasets of the multiscales.

  • version (str) – The version of the specification.

axes: List[Axis]
datasets: List[Dataset]
version: str = '0.4'
class wsic.metadata.ngff.Omero(name=None, id=1, channels=<factory>, rdefs=<factory>, version='0.4')[source]

Bases: object

Display information e.g. colour channel information.

Parameters:
  • name (str) – The display name.

  • id (int) – The omero ID.

  • channels (List[Channel]) – The colour channels.

  • rdefs (RDefs) – The default values for axes and colour model.

  • version (str) – The version of the specification.

channels: list
id: int = 1
name: str | None = None
rdefs: RDefs
version: str = '0.4'
class wsic.metadata.ngff.RDefs(defaultT=0, defaultZ=0, model='color')[source]

Bases: object

Defaults for axes and colour model.

Parameters:
  • defaultT (int) – Default timepoint.

  • defaultZ (int) – Default z-plane.

  • model (str) – Colour model: “color” or “greyscale”.

defaultT: int = 0
defaultZ: int = 0
model: Literal['color', 'greyscale'] = 'color'
class wsic.metadata.ngff.Window(end=255, max=255, min=0, start=0)[source]

Bases: object

The range of values within a channel.

Parameters:
  • end (int) – The end of the window.

  • max (int) – The maximum value in the window.

  • min (int) – The minimum value in the window.

  • start (int) – The start of the window.

end: Number = 255
max: Number = 255
min: Number = 0
start: Number = 0
class wsic.metadata.ngff.Zattrs(_creator=<factory>, multiscales=<factory>, _ARRAY_DIMENSIONS=<factory>, omero=<factory>)[source]

Bases: object

Root metadata.

Parameters:
  • _creator (Creator) – Information about the creator.

  • multiscales (Multiscales) – Information about the multiscales.

  • _ARRAY_DIMENSIONS (List[TCZYX]) – The dimensions of the array, for xarray compatibility.

  • omero (Omero) – Information about the display of image data.

multiscales: List[Multiscale]
omero: Omero

Module contents

Metadata parsing and generation.