swectral.shp_roi_coords#

swectral.shp_roi_coords(roi_shp_path)[source]#

Get vertex coordinates of (multi-)polygon ROIs from shapefile.

Parameters:
shapefile_pathstr

Path to the input shapefile

Returns:
list of dict

A list of ROI dictionaries. Each ROI dictionary contains ROI name, ROI geometry type and lists of vertex coordinate pairs in tuples.

Raises:
ValueError

If geom_type is not supported.

Return type:

list[dict[str, Any]]

Examples

>>> coord_list = shp_roi_coords("/image_roi.shp")