Description

An object representing a set of regions

Object Model





































































Remarks

One instance of this class is exposed as McImage.Aoi and another as McImage.RegionFeatures. Instances can also be created independently using McEngine.CreateOperator or the McFeatures.Duplicate method.

McRegions, like McLines and McPoints, derives from McFeatures, which controls a collection of region “features”. A “region feature” is an enclosed section of an image. Each McRegions instance holds zero or more of these features. Individual features are accessed by index or by an ID (McFeatures.Identifier). Most McFeatures properties and methods allow multiple, selected features to be accessed at once.

In image analysis, region representations take one of two distict flavors. A region may be represented as a closed polygon or it may be represented as a set of connected pixels. The McRegions class supports both of these approaches.

The mcofKeepRegionsAsUnion bit of the McFeatures.OptionsFlag property controls which of the two approaches is most “natural” for a given McRegions instance. By default, the mcofKeepRegionsAsUnion OptionsFlag bit is clear and regions are most naturally represented as closed polygons. In this case, region features may have boundaries with sub-pixel vertices and region features may overlap with other region features.

When the mcofKeepRegionsAsUnion OptionsFlag bit is set, then regions are most naturally represented as sets of connected foreground pixels (often referred to as “blobs”). Each region feature (blob) is a connected set of foreground bits. Regions are either 4-connected or 8-connected depending on the state of the mcofConnect8 OptionFlags bit (which is off by default, so that 4-connected blobs are the default). In the mcofKeepRegionsAsUnion case, region feature boundaries (i.e., outlines) are always constructed along the bounding pixels of each blob, and region features will never overlap with other region features. Furthermore, blobs can have “holes”, while the polygon representation of a region cannot (see the Holes property).

Whatever the state of the mcofKeepRegionsAsUnion bit of OptionsFlags, operations exposing and using both approaches are always available. For example, even when mcofKeepRegionsAsUnion is off, a bitwise (i.e., bit mask) representation of the regions may be accessed via the McFeatures.AccessMaskedImageData, McFeatures.GetLineSegments or McFeatures.CreateFeatureMask methods. And regions may always be set from bit mask data via the McFeatures.SetFromMask method or via the Threshold property (an instance of McThreshold, which can segment image data into foreground and background pixels based on image luminance or color).

Similarly, even when mcofKeepRegionsAsUnion is on, a polygon (outline) representation of each region feature is accessable via the McFeatures.GetFeaturePoints or McFeatures.GetFeaturePointsEx methods. And regions may always be added using the McFeatures.SetFeaturePoints (or the SetBox or SetEllipse) methods. Furthermore, McGraphOverlay.SelectTool can be used to invoke region creation tools to allow the user to add rectangular, elliptical or polygon regions no matter what the state of the mcofKeepRegionsAsUnion OptionsFlag (see McFeatures.AutoDisplayOverlay).

A few operations differ depending on the state of the mcofKeepRegionsAsUnion OptionsFlag. The McFeatures.Clip, McFeatures.Merge, McFeatures.MaskOff and McFeatures.Intersect methods perform bitwise operations when mcofKeepRegionsAsUnion is on and polygon operations when it is off. Holes are an intrinsically bit mask concept and when mcofKeepRegionsAsUnion is off, hole information is kept only so long as no change is made to the regions after they are set from a bit mask (via McFeatures.SetFromMask or the Threshold property).

Members

Methods
AccessMaskedImageData

Create an McRegionAccess that bounds this McFeatures and is masked by it if this is an McRegions.

CleanUpBordersAndNoise

Removes small features and/or those that touch selected borders of the Image or the borders of a specified McRegions instance.

Clip

Clips a set of features to a given rectangle.

ClipToImage

Clips a set of features to the bounds of an image.

CopyFrom

CopyFrom a source McFeatures into this one, replacing all existing features with those from the source McFeatures.

CreateFeatureMask

Creates either an McImage or an McBitMask mask of foreground pixels for selected features.

DistanceToFeaturePoint

Finds the distance to a point along a feature line or boundary.

Duplicate

Returns a duplicate of the McFeatures instance.

FeatureFromPoint

Finds the index of the feature under a given point

FeaturePointAtDistanceFromStart

Finds the point on a feature line or boundary that is a given distance from the starting point on that feature.

FillHoles

Remove holes in the features.

FilterOutlines

Smooth-out the outline of all sub-regions and holes

GetBounds

Returns the entire features' pixel bounds

GetEllipse

Get parameters for an elliptical feature.

GetFeatureBoundingBox

Returns the bounds of all or selected features

GetFeaturePoints

Get a list of coordinate points that describe a feature.

GetFeaturePointsEx

Get a list of coordinate points that describe some aspect of a feature.

GetFeatures

Copies selected features into a new McFeatures interface.

GetLineSegments

For a given y-position, get the list of horizontal line segments that lie within the features bounds.

GetOrderedPosition

Identifies the relative postion of features.

Intersect

Intersect a second McFeatures with this one.

MaskOff

Mask off features with those from a second, masking, McFeatures.

Merge

Merge a second McFeatures with this one.

Move

Move all features a given pixel displacement in the x and y directions

PointClosestToPoint

Finds the feature point that is closest to a given point

RemoveFeature

One or more features are removed.

Reset

Clears an McFeatures interface to its initialized “reset” state (as it was after it was first created).

SelectorFromID

Get a selector for one or more Identifier values

SetBox

Sets a feature to a rectangle.

SetEllipse

An elliptical feature is created.

SetFeaturePoints

Set the coordinate points that describe a feature.

SetFromMask

Sets all features from a source McBitMask.


Properties
AutoDisplayRead-write property

Enables automatic display of features.

AutoDisplayOverlayRead-only property

The McGraphOverlay upon which automatic display of features is done.

BoundingRectRead-only property

The bounds of all or selected features

ChangeCounterRead-only property

A running counter of changes made to the McFeatures

CountRead-only property

Count of the current number of features

DisplayedObjectsRead-only property

An McDisplayedObjects collection of McGraphObj instances.

DisplayOverlaysRead-only property

An McDisplayOverlays collection of McGraphOverlay instances

FeatureStatusFlagsRead-write property

Detailed status and other per-feature flags

HolesRead-write property

Holes of all features

IdentifierRead-only property

The feature Identifier property

IsEmptyRead-only property

Returns whether the region is “empty” or not

IsResetRead-only property

Returns whether the region is “reset” or not

maRgnCalipersRead-only property

Array of NumAngles caliper lengths

maRgnCentroidXYRead-only property

The X,Y coordinates of the centroid of the region boundary.

maRgnDiametersRead-only property

Array of NumAngles diameters.

maRgnRadiiRead-only property

Array of NumAngles radii.

MeasuresRead-only property

Measures give access to all measurements.

miRgnHoleParentRead-only property

For each hole, the feature index of its parent region feature.

miRgnNestedWithinIndexRead-only property

Feature index of the “parent” boundary enclosing this one, or -1 if an outermost boundary.

mpRgnCentroidAsPointRead-only property

The centroids of the regions as an McPoints.

mRgnAreaRead-only property

The scaled area of pixels under and interior to each region boundary

mRgnAspectRead-only property

Ratio between major axis and minor axis of ellipse equivalent to region.

mRgnBoundingBoxHeightRead-only property

Height of the region's bounding box.

mRgnBoundingBoxWidthRead-only property

Width of the region's bounding box.

mRgnBoxAreaRead-only property

Ratio between area of region and area of its bounding box.

mRgnBoxXYRead-only property

Ratio between width and height of object's bounding box.

mRgnCentroidXRead-only property

The X coordinates of the centroid of the region boundary.

mRgnCentroidYRead-only property

The Y coordinates of the centroid of the region boundary.

mRgnClassNumberRead-only property

Class to which region belongs.

mRgnClumpinessRead-only property

The fraction of heterogeneous pixels remaining after an erosion.

mRgnConvexPerimeterRead-only property

Perimeter of the convex outline of the region.

mRgnDendriticLengthRead-only property

Total length of all the dendrites.

mRgnDensityRead-only property

Average calibrated luminance (Intensity or Optical Density) of region.

mRgnDirectionRead-only property

Angle in degrees of the Major Axis, counterclockwise from the horizontal.

mRgnEllipsePerimeterRead-only property

Perimeter of the region's equivalent ellipse.

mRgnFractalDimensionRead-only property

Fractal dimension of the region's outline.

mRgnHeterogeneityRead-only property

Fraction of pixels that vary substantially from the average intensity of the region.

mRgnHoleAreaRead-only property

Area of the holes within the region.

mRgnHoleAreaRatioRead-only property

Ratio of region area excluding holes to total area of region.

mRgnIntegratedODRead-only property

Integrated Optical Density (or integrated intensity).

mRgnLengthRead-only property

Caliper length (i.e. Feret diameter) along major axis of region.

mRgnMajorAxisRead-only property

Length of major axis of ellipse with same moments of order 0, 1, and 2 as region.

mRgnMarginationRead-only property

A measure of the distribution of intensity between the center of a region and its edges.

mRgnMassCentroidXRead-only property

Intensity weighted centroid X-position.

mRgnMassCentroidYRead-only property

Intensity weighted centroid Y-position.

mRgnMaxCaliperRead-only property

Longest caliper (Feret diameter) length.

mRgnMaxDiameterRead-only property

Length of longest line joining two points of region's outline and passing through the centroid.

mRgnMaxIntensityRead-only property

Maximum luminance (intensity or density) inside region.

mRgnMaxRadiusRead-only property

Maximum distance between region centroid and boundary.

mRgnMeanBlueRead-only property

Region's mean blue value.

mRgnMeanCaliperRead-only property

Mean caliper (Feret diameter) length.

mRgnMeanDiameterRead-only property

Average length of diameter passing through region's centroid.

mRgnMeanGreenRead-only property

Region's mean green value.

mRgnMeanRedRead-only property

Region's mean red value.

mRgnMinCaliperRead-only property

Shortest caliper (Feret diameter) length.

mRgnMinDiameterRead-only property

Length of shortest line joining two points of region's outline and passing through the centroid.

mRgnMinIntensityRead-only property

inimum luminance (intensity or density) inside region.

mRgnMinorAxisRead-only property

Length of minor axis of ellipse with same moments of order 0, 1, and 2 as region.

mRgnMinRadiusRead-only property

Minimum distance between region centroid and boundary

mRgnNestedChildrenCountRead-only property

The number of “child” boundaries completely enclosed by this one.

mRgnNestingDepthRead-only property

The number of “ancestor” boundaries completely enclosing this one.

mRgnNumDendritesRead-only property

Number of dendrites.

mRgnNumEndPointsRead-only property

Number of dendrite end points.

mRgnNumHolesRead-only property

Number of holes within the region.

mRgnPerAreaRead-only property

Ratio of area of region to total area of image or AOI.

mRgnPerimeterRead-only property

Length of the region's boundary.

mRgnPerimeter2Read-only property

Chain code length of the outline.

mRgnPerimeterRatioRead-only property

Ratio of perimeter to convex perimeter.

mRgnPixelCentroidXRead-only property

The X coordinate of the mean pixel of the region.

mRgnPixelCentroidYRead-only property

The Y coordinate of the mean pixel of the region.

mRgnPolygonialAreaRead-only property

The scaled area of the region boundary polygon

mRgnRadiusRatioRead-only property

Ratio between Maximum Radius and Minimum Radius.

mRgnRelativeSizeRead-only property

Region size as an integral multiple of the size of the smallest selected regions.

mRgnRoundnessRead-only property

A measure of roundness (perimeter^2)/(4.pi.area).

mRgnSizeCountRead-only property

Size weighted region “count”.

mRgnStdDevIntensityRead-only property

Standard deviation of the luminance (intensity or density) inside region.

mRgnWidthRead-only property

Caliper length (i.e. Feret diameter) along minor axis of region.

mrRgnHolesAsRegionsRead-only property

The holes in connected regions as an McRegions.

mvRgnBranchLengthsRead-only property

Array of the lengths of the dentrites.

mvRgnHoleIndicesRead-only property

For each feature, an array of Hole indices.

mvRgnNestedChildIndicesRead-only property

For each feature, an array of nested child feature indices.

NestedWithinRead-only property

The feature index of the surrounding region if any.

OptionFlagsRead-write property

Flags reflecting and controlling optional behavior

ProfilesRead-only property

Holds sampled luminance profiles from the region features' boundaries.

ReferenceRead-only property

Holds a reference feature for measurements that require it.

SelectedRead-write property

A BOOLEAN property of each Feature setting and reflecting the Selected status.

SetFromMaskMethodRead-write property

Default method used to convert a bit mask into features.

SignatureRead-only property

A signature of one or all features.

SourceDataRead-write property

Per feature source data

SourceFlagsRead-write property

Per feature source flags

SpatialCalibrationRead-write property

A SpatialCalibration associated with this McFeatures

ThresholdRead-only property

A local threshold operator.

TypeRead-only property

The feature Type property


Events
ChangeMade

Fired for every change made to an McFeatures

CoordinatesChanged

Fired when coordinates of one or more features are changed

FeatureAdded

Fired when one or more features are added

FeatureRemoved

Fired when one or more features are removed

PropertyChanged

Fired when a property assignment is made to an McFeatures

Restructured

Fired when features get new Indentifiers