neuralib.calimg.suite2p.plot

neuralib.calimg.suite2p.plot.get_soma_pixel(s2p, neuron_ids=None, *, color_diff=True, include_overlap_pixel=True)[source]

Get the image mask of the registered neuronal soma shape. The mask value equals to the neuron’s id + 1.

Parameters:
  • s2p (Suite2PResult) – Suite2PResult

  • neuron_ids (np.ndarray | None) – index ROIs array or bool mask array. Array[int|bool, N]

  • color_diff (bool) – whether show color difference across neurons

  • include_overlap_pixel (bool) – if taking overlap area into account

Returns:

2d imaging array, shape: (xpix, ypix)

Return type:

np.ndarray

neuralib.calimg.suite2p.plot.plot_soma_center(ax, s2p, neuron_ids=None, *, invert_xy=True, with_index=True, font_size=5, **kwargs)[source]

Plot center of roi soma and its corresponding index

Parameters:
  • ax (Axes) – matplotlib.axes.Axes

  • s2p (Suite2PResult) – Suite2PResult

  • neuron_ids (np.ndarray | None) – index ROIs array or bool mask array. Array[int|bool, N]

  • invert_xy (bool) – If invert the FOV xy pixel

  • with_index (bool) – whether plot the index ROI index nearby

  • font_size (float) – font size of the text

  • kwargs – additional args to plt.scatter()

Return type:

None