region

This module defines the Region object, whose instances define regions of interest in images.

Module Contents

Classes

Region

Instances of this class define regions of interest.

API

class region.Region(x_start, x_end, y_start, y_end)

Instances of this class define regions of interest.

Initialization

property x_length

Returns the length of the region in the x-direction.

property y_length

Returns the length of the region in the y-direction.

property num_pixels

returns the number of pixels in the region.

classmethod from_dict(region_dict: dict)
Instantiates a Region from a dictionary with keys in:

[‘x’, ‘y’, ‘width’, ‘height’].

This is to help loading dictionarys that are generated by calling json.loads on the NXcollections found in I07 nexus files as of 27/04/2022.

__eq__(other)

Allows for equality checks to be made between instances of Region.

__str__()