OSOceanAcoustics / echoregions

Interfacing water column sonar data with annotations and labels
https://echoregions.readthedocs.io/
Apache License 2.0
6 stars 6 forks source link

Add option to `Regions2D` operations based on `region_class` in addition to `region_id` #131

Closed leewujung closed 8 months ago

leewujung commented 11 months ago

Many current operations allowed by Regions2D objects are based on region_id. It works, but in the use case I have it will be a lot more convenient if one could do the same operations (e.g., select_region, plot, mask) by passing in a list of desired region_class values. For example, I want to plot all regions that contain some kind of hake, then the command could be:

r2d.select_region(
    region_class=["Age-0 Hake", "Age-1 Hake", "Hake", "Hake Mix"],
    copy=True,
)