mantidimaging.core.utility.sensible_roi module#

class mantidimaging.core.utility.sensible_roi.ROIBinner(roi: SensibleROI, step_size: int, bin_size: int)[source]#

Bases: object

property bin_size: int#
check_fits_exactly() bool[source]#

Check that the bins fit exactly in the roi

get_sub_roi(i: int, j: int) SensibleROI[source]#
is_valid() tuple[bool, str][source]#

Validates that the bin_size and step_size are compatible with aech other the roi dimensions - bin_size must be greater than zero (step_size must be checked at construction) - bin_size must be greater or equal than step_size (to avoid gaps) - bin_size must be less than or equal to roi width and height (to fit in the roi) Returns:

validity (bool), message (str)

lengths() tuple[int, int][source]#
property roi: SensibleROI#
property step_size: int#
class mantidimaging.core.utility.sensible_roi.SensibleROI(left: 'int' = 0, top: 'int' = 0, right: 'int' = 0, bottom: 'int' = 0)[source]#

Bases: Iterable[int]

bottom: int#
static from_list(roi: list[int] | list[float]) SensibleROI[source]#
static from_points(position: CloseEnoughPoint, size: CloseEnoughPoint) SensibleROI[source]#
property height: int#
left: int#
right: int#
to_list_string() str[source]#
top: int#
property width: int#