bento.tl.raster

bento.tl.raster(sdata, shape_key, points_key='transcripts', step=1, recompute=False) None

Generate grid of points within each shape.

Creates a regular grid of points with spacing ‘step’ that covers each shape. Points outside the shape are excluded.

Parameters:
  • sdata (SpatialData) – Input SpatialData object

  • shape_key (str) – Key in sdata.shapes containing shape geometries

  • points_key (str, default “transcripts”) – Key for points in sdata.points

  • step (int, default 1) – Grid spacing between points

  • recompute (bool, default False) – Whether to force recomputation if feature exists

Returns:

Updates: - sdata.shapes[shape_key][‘{shape_key}_raster’]: Array of grid points per shape - sdata.points[‘{shape_key}_raster’]: All grid points as point cloud

Return type:

None