IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
RegionSelector Class Reference

Public Member Functions

None __init__ (self, RegionArray regions)
 Creates a region selector.
 
RegionArray regions (self)
 Get the selected regions.
 
RegionSelector select_by_area (self, Interval interval)
 Select regions based on their area.
 
RegionSelector select_by_center_of_gravity_x (self, Union[Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval)
 Select regions based on the center of gravity's x coordinate.
 
RegionSelector select_by_center_of_gravity_y (self, Union[Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval)
 Select regions based in the center of gravity's y coordinate.
 
RegionSelector select_by_center_of_gravity_rect (self, Union[Rectangle, Tuple[float, float, float, float], List[float], Tuple[int, int, int, int], List[int]] rect)
 Select regions based in the center of gravity's position within a rectangle.
 

Data Fields

 regions
 

Protected Member Functions

RegionSelector _select_by (self, Callable select_by_get_count_function, Callable select_by_function, ctypes.Structure c_interval)
 

Protected Attributes

RegionArray _regions = regions
 

Detailed Description

Represents a selector for regions based on various criteria.

Since
ids_peak_icv 1.1

Definition at line 23 of file region_selector.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
RegionArray regions )

Creates a region selector.

It is possible to provide an empty numpy array (no regions), but it does not make sense, because in this case no regions can be selected.

Parameters
regionsList of Region objects to select from.
Exceptions
NotSupportedExceptionIf regions is not a numpy array.
Since
ids_peak_icv 1.1

Definition at line 32 of file region_selector.py.

Member Function Documentation

◆ _select_by()

RegionSelector _select_by ( self,
Callable select_by_get_count_function,
Callable select_by_function,
ctypes.Structure c_interval )
protected

Definition at line 182 of file region_selector.py.

◆ regions()

RegionArray regions ( self)

Get the selected regions.

Returns
List[Region]: List of selected Region objects.
Since
ids_peak_icv 1.1

Definition at line 53 of file region_selector.py.

◆ select_by_area()

RegionSelector select_by_area ( self,
Interval interval )

Select regions based on their area.

Parameters
intervalInterval to select by. Only positive values are allowed.
Returns
RegionSelector: New RegionSelector object with selected regions.
Exceptions
NotSupportedExceptionIf interval has a wrong type or the interval is not valid for this function.
NotPossibleExceptionIf interval has atleast one negative component.
Since
ids_peak_icv 1.1

Definition at line 64 of file region_selector.py.

◆ select_by_center_of_gravity_rect()

RegionSelector select_by_center_of_gravity_rect ( self,
Union[ Rectangle, Tuple[float, float, float, float], List[float], Tuple[int, int, int, int], List[ int]] rect )

Select regions based in the center of gravity's position within a rectangle.

Parameters
rectRectangle to select by.
Returns
RegionSelector: New RegionSelector object with selected regions.
Exceptions
NotSupportedExceptionIf interval has a wrong type or the interval is not valid for this function.
Since
ids_peak_icv 1.1

Definition at line 150 of file region_selector.py.

◆ select_by_center_of_gravity_x()

RegionSelector select_by_center_of_gravity_x ( self,
Union[ Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval )

Select regions based on the center of gravity's x coordinate.

Parameters
intervalInterval to select by.
Returns
RegionSelector: New RegionSelector object with selected regions.
Exceptions
NotSupportedExceptionIf interval has a wrong type or the interval is not valid for this function.
Since
ids_peak_icv 1.1

Definition at line 93 of file region_selector.py.

◆ select_by_center_of_gravity_y()

RegionSelector select_by_center_of_gravity_y ( self,
Union[ Interval, Tuple[float, float], List[float], Tuple[int, int], List[int]] interval )

Select regions based in the center of gravity's y coordinate.

Parameters
intervalInterval to select by.
Returns
RegionSelector: New RegionSelector object with selected regions.
Exceptions
NotSupportedExceptionIf interval has a wrong type or the interval is not valid for this function.
Since
ids_peak_icv 1.1

Definition at line 122 of file region_selector.py.

Field Documentation

◆ _regions

RegionArray _regions = regions
protected

Definition at line 50 of file region_selector.py.

◆ regions

regions

Definition at line 188 of file region_selector.py.