non_file_based_rois.py 703 B

12345678910111213141516171819202122
  1. from .base_classes import BaseROIData
  2. import typing
  3. import numpy as np
  4. class UniformROIData(BaseROIData):
  5. def __init__(
  6. self,
  7. label="Non-file-uniform0",
  8. basic_text_description="A uniform ROI covering entire frame, not read from a file"):
  9. super().__init__(label=label, basic_text_description=basic_text_description)
  10. def get_boolean_mask(self, frame_size: typing.Iterable[int]) -> np.ndarray:
  11. """
  12. Returns an all-true boolean array of size <frame_size>
  13. :param frame_size: two member iterable of ints. Output mask will have this shape
  14. :return: numpy.ndarray
  15. """
  16. return np.ones(frame_size, dtype=bool)