pyXenium.contour.add_contours_from_geojson#

add_contours_from_geojson(sdata, geojson_path, *, key, id_key='polygon_id', coordinate_space='xenium_pixel', pixel_size_um=None, extract_he_patches=False, he_image_key='he', copy=False)#

Import polygon contours from a GeoJSON file into XeniumSlide.shapes.

The imported contour geometry is normalized into pyXenium’s dataframe-based shape representation, with coordinates expressed in microns.

When extract_he_patches=True, pyXenium additionally crops one level-0 H&E patch per imported contour and stores it under XeniumSlide.contour_images[key] using the contour’s axis-aligned bounding box plus a polygon mask.

Parameters:
Return type:

XeniumSlide | None