Purpose

The module FastMorphology applies some standard image morphology operators such as dilation, erosion, closing, opening.

For speed purposes, only quadratic/cubic shaped structure elements are supported. The module has a fast binary mode and a somewhat slower gray scale morphology mode (value := max/min under kernel).

Usage

Attach an image to the input, select morphological operation and size of structure element.

The structure element should always have an odd size, therefore the length of the side is given. For example, an input of 1 for the size gives a structure element with side 2*1 + 1 = 3.

Details

To gain speed, morphological operators are applied as a separated kernel.

Therefore, only quadratic/cubic shaped structure elements can be used. If another shape is desired, this can for example be implemented using the Convolution or Rank module.

Windows

Default Panel

../../../Modules/ML/MLFastMorphology/mhelp/Images/Screenshots/FastMorphology._default.png

Input Fields

input0

name: input0, type: Image

The input is an image.

All values in the image with the value 0 are counted as background and all other values as foreground.

Output Fields

output0

name: output0, type: Image

The filtering result image.

Parameter Fields

Field Index

Auto update: Bool Update: Trigger
Boundary Fill Value: Double Use Grey Scale Morphology: Bool
Boundary Handling: Enum Use same as input image max.: Bool
c: Integer Value: Double
Kernel Size: String x: Integer
Morphology Operation: Enum y: Integer
t: Integer z: Integer
u: Integer  

Visible Fields

Morphology Operation

name: morphologicOperation, type: Enum, default: Dilation

Defines the morphological operation.

Values:

Title Name Description
Dilation Dilation Dilation operation.
Erosion Erosion Erosion operation.
Closing Closing

Closing, implemented as a dilation (presumably to an internally appropriately enlarged intermediate image) followed by an erosion (computed only on the original grid).

Removes small holes from objects.

NOTE: On images of masks touching the boundary closing might and will often yield different (and probably more suitable) results then a chain of two modules running in dilation and then erosion mode!

Opening Opening

Opening, implemented as an erosion followed by a dilation.

Removes smaller objects.

x

name: xSize, type: Integer, default: 1

Sets the kernel size in x-direction.

The real size of the kernel is 2*n + 1.

y

name: ySize, type: Integer, default: 1

Sets the kernel size in y-direction.

The real size of the kernel is 2*n + 1.

z

name: zSize, type: Integer, default: 1

Sets the kernel size in z-direction.

The real size of the kernel is 2*n + 1.

c

name: cSize, type: Integer, default: 0

Sets the kernel size in c-direction.

The real size of the kernel is 2*n + 1.

t

name: tSize, type: Integer, default: 0

Sets the kernel size in t-direction.

The real size of the kernel is 2*n + 1.

u

name: uSize, type: Integer, default: 0

Sets the kernel size in u-direction.

The real size of the kernel is 2*n + 1.

Kernel Size

name: kernelSize, type: String, persistent: no

Shows the real kernel size in each dimension.

Use same as input image max.

name: useInputMaxValue, type: Bool, default: FALSE

If checked, the module uses the input image’s maximum value as object value for the output image.

Value

name: userSetMaxValue, type: Double, default: 1

Sets an object value for the output image.

Update

name: update, type: Trigger, deprecated name: calcButton

If pressed, the module triggers a refresh of the output.

Auto update

name: autoUpdate, type: Bool, default: TRUE

If checked, the module computes anew if any input or field changes.

Use Grey Scale Morphology

name: useGreyScaleMorphology, type: Bool, default: FALSE

If checked, the module also works on gray scale images correctly, not just on binary image.

Boundary Handling

name: boundaryHandling, type: Enum, default: Propagate boundary values

Defines the border handling for the kernel operation.

Values:

Title Name
Propagate boundary values Propagate boundary values
Pad with fill value Pad with fill value
Pad with input min value Pad with input min value
Pad with input max value Pad with input max value

Boundary Fill Value

name: boundaryFillValue, type: Double, default: 0

Sets a border value if Boundary Handling is set to Pad with fill value.