Convolution

MLModule

genre

Kernel

author

MeVis Medical Solutions AG

package

MeVisLab/Standard

dll

MLKernel

definition

MLKernel.def

see also

ExtendedConvolution, Rank, KernelEditor, Morphology, BitMorphology, KernelExample, Sigma

keywords

enhance, kernel, input, filter, laplace, gauss, sobel, average, smooth, edge, interval, sphere, spherical, structure, element

Purpose

The module Convolution implements generic kernel-based filtering (linear and shift-invariant).

Details

The implemented kernel functions are defined by

../../../Modules/ML/MLKernel/mhelp/Images/formula1.gif

where g denotes the output, f the input, t the kernel, and k is a 6D multi-index.

Please note that in this module not a point-spread function (impulse response) is supplied by the user but a kernel function. The point-spread function h is related to the kernel via mirroring (origin is the kernel center):

../../../Modules/ML/MLKernel/mhelp/Images/formula2.gif

One can use some simple pre-defined kernels like Average, Gauss, Laplace, and Sobel, or supply a custom-defined kernel via the kernel-editor module.

Optionally, a threshold interval can be used to select a subset of voxels of the input image to which the filtering is applied. By using this threshold interval, the filtering can be applied selectively to regions in the image.

Windows

Default Panel

../../../Modules/ML/MLKernel/mhelp/Images/Screenshots/Convolution._default.png

Input Fields

input0

name: input0, type: Image

Output Fields

output0

name: output0, type: Image

Parameter Fields

Field Index

Border Handling: Enum

Use (useIntervalOfFilteredVoxels): Bool

External Kernel: String

Use (predefKernel): Enum

Fill Value: Double

Kernel Output: String

kernelInfo: String

Max: Double

Min: Double

referenceExtentMode: Enum

Visible Fields

Border Handling

name: borderHandling, type: Enum, default: PadSrcClamp, deprecated name: edgeMode

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

Fill Value

name: fillValue, type: Double, default: 0

Sets the fill value for certain Border Handling modes.

Min

name: intervalMinOfFilteredVoxels, type: Double, default: 0, deprecated name: ImageIntervalMin

Sets the minimum value threshold for outputting a subset of voxels.

Max

name: intervalMaxOfFilteredVoxels, type: Double, default: 1024, deprecated name: ImageIntervalMax

Sets the maximum value threshold for outputting a subset of voxels.

Use (useIntervalOfFilteredVoxels)

name: useIntervalOfFilteredVoxels, type: Bool, default: FALSE, deprecated name: UseImageInterval

If checked, the module outputs only on a subset of voxels defined by a value range.

External Kernel

name: externalKernel, type: String, deprecated name: kernelInput

Sets an external kernel as a string.

Use the module KernelEditor for editing the kernel or set the kernel by scripting.

Kernel Output

name: kernelOutput, type: String, persistent: no

Shows the used kernel as a string for connecting to other modules that use an external kernel.

Use (predefKernel)

name: predefKernel, type: Enum, default: 3x3 Average Kernel

Defines the applied filter.

Values:

Title

Name

Description

​3x3 Average Kernel

​3x3 Average Kernel

​All elements of this kernel have normalized and equal coefficients.

1/9  1/9  1/9
1/9  1/9  1/9
1/9  1/9  1/9

​5x5 Average Kernel

​5x5 Average Kernel

​All elements of this kernel have normalized and equal coefficients.

1/25  1/25  1/25  1/25  1/25
1/25  1/25  1/25  1/25  1/25
1/25  1/25  1/25  1/25  1/25
1/25  1/25  1/25  1/25  1/25
1/25  1/25  1/25  1/25  1/25

​7x7 Average Kernel

​7x7 Average Kernel

​All elements of this kernel have normalized and equal coefficents.

​10x10 Average Kernel

​10x10 Average Kernel

​All elements of this kernel have normalized and equal coefficients.

​25x25 Average Kernel

​25x25 Average Kernel

​All elements of this kernel have normalized and equal coefficients.

​3x3 Gauss Kernel

​3x3 Gauss Kernel

​Applies a 3x3 Gaussian kernel. Smooths image and emphasizes the inner voxels.

1/16  2/16  1/16
2/16  4/16  2/16
1/16  2/16  1/16

​5x5 Gauss Kernel

​5x5 Gauss Kernel

​Applies a 5x5 Gaussian kernel.

​Laplace Kernel

​Laplace Kernel

​Applies a 3x3 Laplacian kernel.

0   1   0
1  -4   1
0   1   0

​Laplace2 Kernel

​Laplace2 Kernel

​Applies a 3x3 Laplacian kernel for edge detection. This one is taking the second derivation into account.

1   2   1
2 -12   2
1   2   1

​Sobel1 Kernel |

​Sobel1 Kernel |

​Applies a 3x3 Sobel1 kernel. Used for edge detection in vertical direction and smoothing in horizontal direction.

1   0  -1
2   0  -2
1   0  -1

​Sobel2 Kernel -

​Sobel2 Kernel -

​Applies a 3x3 Sobel2 kernel. Used for edge detection in horizontal direction and smoothing in vertical direction.

 1   2   1
 0   0   0
-1  -2  -1

​Sobel3 Kernel

​Sobel3 Kernel

​Applies a 3x3 Sobel3 kernel. Used for edge detection in diagonal direction and smoothing in contrary direction.

0  -1  -2
1   0  -1
2   1   0

​Sobel4 Kernel /

​Sobel4 Kernel /

​Applies a 3x3 Sobel4 kernel. Used for edge detection in diagonal direction and smoothing in contrary direction.

-2  -1   0
-1   0   1
 0   1   2

​Id Kernel

​Id Kernel

​Simply copies the input image to the output.

​From Kernel Input

​From Kernel Input

​Uses the kernel specified in the kernel input field.

Usually this will be a kernel passed via a field connection from the text field of a kernel editor.

Note that a kernel defined once can be saved/loaded with the operator state normally even if it is not visible as kernel matrix.

Please note that the kernel editor specifies a kernel function, not a point-spread function.

Hidden Fields

referenceExtentMode

name: referenceExtentMode, type: Enum, default: Overlap

Values:

Title

Name

​Overlap

​Overlap

​Input0 Ext Without Fill

​Input0_ExtWithoutFill

​Input0 Ext With Fill

​Input0_ExtWithFill

​Max Extents Without Fill

​MaxExtentsWithoutFill

​Max Extents With Fill

​MaxExtentsWithFill

kernelInfo

name: kernelInfo, type: String, persistent: no