| genre | Morphology |
| status | stable |
| author | Jan-Martin Kuhnigk |
| package | MeVisLab/Standard |
| dll | MLKernel |
| definition | MLKernel.def |
| see also | Morphology, Rank |
| keywords | close, gap, kernel, filter, majority, smooth, binary, dilate, dilation, erosion, erode, morphology, contour, point, extraction, jmk |
The module CloseGap performs basic close gap operations for binary images.
Additionally, it allows majority filtering, contour point extraction, as well as ordinary binary dilation and erosion with arbitrary kernels.
The fill value of the binary operations is determined by the max grey value of the input image.
| Border Handling: Enum | Make kernel spherical: Bool | Use (useIntervalOfFilteredVoxels): Bool |
| External Kernel: String | Max (intervalMaxOfFilteredVoxels): Double | Use (useIntervalOfVoxelsForFiltering): Bool |
| Fill Value: Double | Max (intervalMaxOfVoxelsForFiltering): Double | Use (filterMode): Enum |
| Info: String | Min (intervalMinOfFilteredVoxels): Double | Use External Kernel: Bool |
| Kernel type: Enum | Min (intervalMinOfVoxelsForFiltering): Double | |
| KernelX: Integer | numKernelElements: Integer | |
| KernelY: Integer | referenceExtentMode: Enum | |
| KernelZ: Integer | Sensitivity: Float |
Defines the border handling mode.
See Border Handling in Kernel Operations for details.
Values:
| Title | Name |
|---|---|
| No Pad | NoPad |
| Pad Src Fill | PadSrcFill |
| Pad Dst Fill | PadDstFill |
| Pad Dst Fill With Orig | PadDstFillWithOrig |
| Pad Src Undefined | PadSrcUndefined |
| Pad Dst Undefined | PadDstUndefined |
| Pad Src Clamp | PadSrcClamp |
Sets the fill value for certain Border Handling modes.
Sets the x-extent of the kernel.
Sets the y-extent of the kernel.
Sets the z-extent of the kernel.
If checked, the used kernel is a spherical kernel, not a rectangular one.
Sets the minimum value threshold for outputting a subset of voxel.
Sets the maximum value threshold for outputting a subset of voxel.
If checked, the module outputs only on a subset of voxels defined by a value range.
Sets the minimum value threshold for operating on a subset of voxel.
Sets the maximum value threshold for operating on a subset of voxel.
If checked, the module operates only on a subset of voxels defined by a value range.
Sets an external kernel as a string.
Use the module KernelEditor for editing the kernel or set the kernel by scripting.
If checked, the optionally attached External Kernel is used.
Shows information about the used kernel.
Defines the filter mode of this module.
Values:
| Title | Name | Description |
|---|---|---|
| Id | Id | Copies the input image. |
| Close-Gap | CloseGap | Closes gaps in binary images. Use only with the CloseGap kernel provided by this module. Using the sensitivity-parameter, it does the following: newVoxelValue = oldVoxelValue OR [(#positiveVoxelPairs / #totalVoxelPairs) > (sensitivity / 100)] If a 2D kernel dimension is chosen, 4 voxel pairs will be tested. The current voxel lies exactly between each voxel pair in order to avoid contour changes. The 2D situation looks like this: <----------kernelExt.x-------------->
1 2 3
4 current 4
3 2 1
In 3D there are 8 pairs, each corner of the kernel cube belonging to one. Two voxels with the same number are considered a pair. The logical value of a pair is the AND of the corresponding values in the original image. Ordinarily the sequential use of multiple filters with decreasing kernel size performs best, eventually in combination with ordinary dilation and erosion filters. Input image and result:
|
| Majority | Majority | Writes the grey value that occurs most often. All voxels that lie beneath a kernel element will be considered (unless a kernel interval is used). The actual values of the kernel elements specified are irrelevant. This filter mode is useful for performing morphological operations on images that contain differently gray-value-coded object masks. For example in the image shown here, three majority filters of decreasing kernel sizes were used in a row. All three of them used an image interval of [0,0] as well as the CloseGap kernel. To smooth the result at the end, a fourth majority filter was used with a small full kernel, not constrained to any interval. Result of multiple sequential majority filter operations:
|
| Majority Close-Gap | MajorityCloseGap | A combination of the CloseGap and Majority filter modes. We examine the pairs from the CloseGap filter, but only take into account those pairs (valid pairs) that consist of voxels with equal gray values. We count all valid pairs with the same gray value (while the center voxel counts as a pair itself) and write the value that occurs most often. This filter is supposed to preserve the original structure shapes more effectively than the ordinary majority filter. Just like the CloseGap filter mode, this one is restricted to the CloseGap kernel. |
| Binary Dilation | BinaryDilation | The voxel elements below the kernel are ORed to determine whether the result voxel will be set or not. |
| Binary Erosion | BinaryErosion | The voxel elements below the kernel are ANDed to determine whether the result voxel will be set or not. |
| Contour Point Filter | ContourPointFilter | his filter deletes all voxels that have more than sensitivity % voxels of the same gray value in their neighborhood (the neighborhood is defined by the kernel). For example, to obtain the complete 2D-contours of a solid object, you could set the kernel type to full and specify the kernel extensions as 3x3x1 and set the sensitivity to 75. You can play with the sensitivity parameter to reduce or increase the number of remaining contour points. |
Defines the kernel that will be used for the current filter.
Values:
| Title | Name | Description |
|---|---|---|
| Close-Gap | CloseGap | See Use for detailed information. |
| Full | Full | The whole kernel mask will be filled with only the value 1. |
| Star | Star | A 2D/3D star will be used as a kernel. |
| Box | Box | The only kernel elements set (to 1) will be the center element and all boundary elements. |