m3resp.PixelMap#

class m3resp.PixelMap(name, values, modality='eit', category=None, unit=None, method=None, metadata=<factory>)[source]#

One number for each pixel of an EIT image.

Variables:
  • name (str) – What the numbers are, e.g. 'pixel_tiv'.

  • values (numpy.ndarray) – The numbers as a 2D grid of shape (row, column). They are stored as floats; NaN means the pixel has no value.

  • modality (str) – The device the values were measured with.

  • category (str | None) – The physical quantity the values are derived from (see m3resp.data.categories).

  • unit (str | None) – Unit of the values, normalized to a recognized spelling.

  • method (str | None) – Name of the method that produced the values.

  • metadata (dict[str, Any]) – Optional extra information.

Raises:
  • ValueError – If values is not a 2D grid.

  • TypeError – If values cannot be stored as floats without changing them (text, for example).

Parameters:

Methods

to_dict

Return the grid and its descriptive fields as a dictionary.

Attributes

category

method

modality

shape

Return the number of rows and columns, in that order.

unit

name

values

metadata

category: str | None = None#
metadata: dict[str, Any]#
method: str | None = None#
modality: str = 'eit'#
name: str#
property shape: tuple[int, int]#

Return the number of rows and columns, in that order.

to_dict()[source]#

Return the grid and its descriptive fields as a dictionary.

Returns:

The grid as a list of rows, together with name,

modality, category, unit, method and metadata. NaN pixels remain NaN. Metadata is copied at the top level.

Return type:

dict[str, Any]

unit: str | None = None#
values: ndarray#