IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
Region Class Reference
Inheritance diagram for Region:

Data Structures

class  Handle
 

Public Member Functions

 Region ()
 Creates an empty Region.
 
 Region (Point[] points)
 Creates a region from a collection of points.
 
 Region (Rectangle rectangle)
 Creates a region from a Rectangle.
 
void Dispose ()
 Releases the resources used by the Region class.
 
Region Difference (Region other)
 Computes the difference of two regions.
 
Region Union (Region other)
 Computes the union of two regions.
 
Region Intersection (Region other)
 Computes the intersection of two regions.
 
Region Dilation (Region structuringElement)
 Performs morphological erosion on the input region using the specified structuring element.
 
Region Erosion (Region structuringElement)
 Performs morphological erosion on the input region using the specified structuring element.
 
override string ToString ()
 Converts the region to a string.
 

Static Public Member Functions

static Region operator- (Region regionMinuend, Region regionSubtrahend)
 Performs a region difference operation. It is equivalent to the Difference method.
 
static Region operator+ (Region region1, Region region2)
 Performs a region union operation. It is equivalent to the Union method.
 

Properties

DisposableList< Region > ConnectedComponents [get]
 Calculate the connected components of the region.
 
List< Point > Points [get]
 The points of the region.
 
uint Area [get]
 Calculates the area of a region. The area is the number of pixels in the region.
 
PointF CenterOfGravity [get]
 Calculates the center of gravity of a region.
 
static IEqualityComparer< Region > Comparer = new RegionEqualityComparer() [get]
 Gets a default equality comparer for comparing Region data values.
 

Detailed Description

Represents a region defined by a set of points in the image plane.

The Region class models a geometric area within an image, represented as a collection of discrete points in 2D image coordinates. It serves as a logical grouping of image locations, which may be used for selection, analysis, or rendering purposes.

Painting Behavior

The Region class implements its own drawing logic via the IDrawable interface. When triggered by the Painter, it paints itself onto the target image by rendering only the points that fall within the image bounds.

  • Points inside the image are painted.
  • Points outside the image boundaries are silently ignored.
  • If the Region is empty (i.e., contains no points), the image remains unmodified, and the paint operation completes successfully without any effect.
See also
Concept Region, which defines the structure and properties of a region.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 42 of file Region.cs.

Constructor & Destructor Documentation

◆ Region() [1/3]

Region ( )
inline

Creates an empty Region.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 50 of file Region.cs.

◆ Region() [2/3]

Region ( Point[] points)
inline

Creates a region from a collection of points.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 60 of file Region.cs.

◆ Region() [3/3]

Region ( Rectangle rectangle)
inline

Creates a region from a Rectangle.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 73 of file Region.cs.

Member Function Documentation

◆ Difference()

Region Difference ( Region other)
inline

Computes the difference of two regions.

Returns
The difference of two regions.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 233 of file Region.cs.

◆ Dilation()

Region Dilation ( Region structuringElement)
inline

Performs morphological erosion on the input region using the specified structuring element.

The reference point of the structuring element is at (0, 0).

Returns
The dilated region.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 285 of file Region.cs.

◆ Dispose()

void Dispose ( )
inline

Releases the resources used by the Region class.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 207 of file Region.cs.

◆ Erosion()

Region Erosion ( Region structuringElement)
inline

Performs morphological erosion on the input region using the specified structuring element.

The reference point of the structuring element is at (0, 0).

Returns
The eroded region.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 304 of file Region.cs.

◆ Intersection()

Region Intersection ( Region other)
inline

Computes the intersection of two regions.

Returns
The intersection of two regions.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 266 of file Region.cs.

◆ operator+()

static Region operator+ ( Region region1,
Region region2 )
inlinestatic

Performs a region union operation. It is equivalent to the Union method.

Returns
The united region.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 351 of file Region.cs.

◆ operator-()

static Region operator- ( Region regionMinuend,
Region regionSubtrahend )
inlinestatic

Performs a region difference operation. It is equivalent to the Difference method.

Parameters
regionMinuendThe region from which the subtrahend is subtracted.
regionSubtrahendThe region that is subtracted from the minuend.
Returns
The difference of the two regions.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 339 of file Region.cs.

◆ ToString()

override string ToString ( )
inline

Converts the region to a string.

Returns
The point coordinates of the region as a string.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 320 of file Region.cs.

◆ Union()

Region Union ( Region other)
inline

Computes the union of two regions.

Returns
The united region.
See also
Determining the union
Since
IDSImaging.Peak.ICV 1.3

Definition at line 250 of file Region.cs.

Property Documentation

◆ Area

uint Area
get

Calculates the area of a region. The area is the number of pixels in the region.

Returns
The area of the region.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 166 of file Region.cs.

◆ CenterOfGravity

PointF CenterOfGravity
get

Calculates the center of gravity of a region.

Returns
The center of gravity as a floating point.
Exceptions
IcvMathErrorExceptionThe center of gravity could not be computed.
Since
IDSImaging.Peak.ICV 1.3

Definition at line 186 of file Region.cs.

◆ Comparer

IEqualityComparer<Region> Comparer = new RegionEqualityComparer()
staticget

Gets a default equality comparer for comparing Region data values.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 201 of file Region.cs.

◆ ConnectedComponents

DisposableList<Region> ConnectedComponents
get

Calculate the connected components of the region.

The 8-neighborhood is used to determine the components.

Returns
The connected components of the region as a collection of regions.
See also
Determining connected components
Since
IDSImaging.Peak.ICV 1.3

Definition at line 99 of file Region.cs.

◆ Points

List<Point> Points
get

The points of the region.

Since
IDSImaging.Peak.ICV 1.3

Definition at line 138 of file Region.cs.