get_object_img

MPPData.get_object_img(obj_id, data='mpp', channel_ids=None, annotation_kwargs=None, **kwargs)[source]

Calculate data image of given object id.

Parameters
  • obj_id (str) – Object that should be visualised.

  • data (str) – Key in MPPData.data() that should be plotted on the image.

  • channel_ids (Optional[Iterable[int]]) – Only if key == ‘mpp’. Channels that the image should have. If None, all channels are returned.

  • annotation_kwargs (Optional[Mapping[str, Any]]) – Arguments for campa.pl.annotate_img() (annotation, to_col, color). Use this to plot clusterings on cells with custom colormaps.

  • img_size – Size of returned image. If None, images have minimal required size to fit all information. If None, offset information is returned by this function.

  • pad – Amount of padding added to returned image (only used when img_size is None).

Return type

Union[ndarray, Tuple[ndarray, Tuple[int, int]]]

Returns

  • If img_size is None, returns (image, (offset_x, offset_y).) – Offset is that value that needs to be subtracted from MPPData.x and MPPData.y before being able to use them to index the returned image.

  • Otherwise returns (image)