Description

Applies a morphological closing filter to an IMcImage (a dilation followed by an erosion of the same size).

Return Type

A McImage object.  

The resulting IMcImage.

Syntax

object.Close ([nPasses], [Shape], [vSourceImg], [vMaskImg])

The Close Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McMorpho.
nPassesOptional. A Long value.

Number of iterations. The NumPasses property is used if this parameter is omitted or negative.

ShapeOptional. A mcMorphoShape enumeration, as described in settings.

The structuring element used by the dilation.

vSourceImgOptional. A Variant value.

Optional input IMcImage.

vMaskImgOptional. A Variant value.

Optional mask IMcImage. If UseActiveFrameRange is FALSE, then the mask ActiveFrame is used to mask each frame in the destination image frame range. If UseActiveFrameRange is TRUE, then the shorter of the two frame ranges is used.

Settings

The settings for Shape are:

ConstantValueDescription
 mcmsDefault-1

Apply the Structuring Element specified in McMorpho.Shape.

 mcms2x2Square0

A 2 by 2, square Structuring Element.

 mcms3x1Row1

A 3 pixels horizontal Structuring Element.

 mcms1x3Column2

A 3 pixels vertical Structuring Element.

 mcms3x3Cross3

A cross like Structuring Element (4-Connectivity).

 mcms3x3Square8

A 3 by 3, square Structuring Element (8-Connectivity).

 mcms5x5Octagon4

The smallest octagonal Structuring Element.

 mcms7x7Octagon6

The smallest octagonal Structuring Element.

 mcms11x11Octagon7

A 11 by 11 octagon.

 mcmsCustomKernel5

Apply the Structuring Element provided in McMorpho.Kernel.

Remarks

If Shape is msCustomKernel, the Kernel property will be used as the structuring element (iterating on all the kernel instances if Kernel contains several of them).

If vMaskImg is not empty, this operation performs a dilation, ANDing the result with vMaskImg after each iteration. The dilation performed is either a ms3x3Cross or ms3x3Square. This operation can be used to combine multiple segmentation methods, by closing the more selective method against the mask of a less selective method, and obtaining results where both segmentation methods found objects.

Exceptions

The exception mceINVALIDARG (E_INVALIDARG) will be thrown if one of the parameters is invalid.