smlmlp.image_colmap module

smlmlp.image_colmap(col, /, pix, x_shape=None, y_shape=None, shape=None, *, fill=nan, cuda=False, parallel=False)[source]

Create a 2D image map by aggregating a column over flattened pixel ids.

Parameters:
  • col (array-like) – Values to map.

  • pix (array-like) – Flattened pixel identifiers, encoded as y * x_shape + x.

  • x_shape (int or tuple, optional) – Output dimensions. If omitted, a one-row image large enough to contain the maximum pixel id is returned because a flat id alone cannot recover the original width.

  • y_shape (int or tuple, optional) – Output dimensions. If omitted, a one-row image large enough to contain the maximum pixel id is returned because a flat id alone cannot recover the original width.

  • shape (int or tuple, optional) – Output dimensions. If omitted, a one-row image large enough to contain the maximum pixel id is returned because a flat id alone cannot recover the original width.

  • fill (float, optional) – Value assigned to pixels without data. Default is NaN.

  • cuda (bool, optional) – Accepted for analysis API consistency.

  • parallel (bool, optional) – Accepted for analysis API consistency.

Returns:

  • image (ndarray) – Aggregated float32 map.

  • info (dict) – Aggregation metadata.