CategoricalROI#
- class glue.core.roi.CategoricalROI(categories=None)[source]#
Bases:
Roi
A ROI abstraction to represent selections of categorical data.
Methods Summary
contains
(x, y)Test whether a set categorical elements fall within the region of interest.
defined
()Returns True if the ROI is defined
from_range
(categories, lo, hi)Utility function to help construct the ROI from a range.
reset
()Just not possible.
update_categories
(categories)Methods Documentation
- contains(x, y)[source]#
Test whether a set categorical elements fall within the region of interest.
- Parameters:
- xarray-like
An array-like object of categories (includes CategoricalComponents).
- yobject or None
Unused but required for compatibility
- Returns:
- A list of True/False values, for whether each x value falls
- within the ROI
- static from_range(categories, lo, hi)[source]#
Utility function to help construct the ROI from a range.
- Parameters:
- categoriesobject
Anything understood by
._categorical_helper
… array, list or component.- loint or float
Lower bound of the range (rounded up to next integer)
- hiint or float
Upper bound of the range (rounded up to next integer)
- Returns:
- CategoricalROI object