plot_numpy_ingest

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

plot_numpy_ingest(image: object, roi_mask: object | None = None, *, labels: object | None = None, title: str = 'From NumPy arrays to HABIT', panel_title: str = 'Subject anatomy + ROI', crop_pad: int = 8, matrix_cells: int = 10) → Figure[source]

Diagram for the array route: the data itself drawn as a colour matrix.

The badge matrix is a block-averaged miniature of the cropped ROI slice of image – the badge IS the data, not a stock icon.

Parameters:
  • image – Anatomy volume (array or ImageVolume) of one subject.

  • roi_mask – Optional ROI mask (array or MaskVolume); painted as a cyan fill on the data panel when labels is not given.

  • labels – Optional habitat label map (array or HabitatMap); when given, the data panel shows the habitat overlay instead.

  • title – Figure title (ASCII-sanitised).

  • panel_title – Title of the cropped data panel.

  • crop_pad – Context voxels around the foreground bounding box (default 8).

  • matrix_cells – Rows/columns of the badge matrix (default 10).

Returns:

A matplotlib Figure with the matrix badge on the left and the cropped data panel on the right.

Raises:

HABITAPIError – When neither roi_mask nor labels is given.

Examples using habit.viz.plot_numpy_ingest

Load from NumPy arrays

Load from NumPy arrays