Purpose

The module KernelEditor implements an editor for 6D kernels.

Operations on the kernel like textual editing, element normalization, gauss settings, undo/redo, size changes and arithmetic operations are supported.

Usage

The typical way to use the edited kernel in other modules is to connect the text field with the kernel input fields of other operators.

The textual input of the kernel shows rows of kernel elements. A typical kernel string look like

(*,0,0,0,0,0):          ,          ,  0.038462,          ,
(*,1,0,0,0,0):          ,  0.038462,  0.038462,  0.038462,
(*,2,0,0,0,0):  0.038462,  0.038462,  0.038462,  0.038462,  0.038462
(*,3,0,0,0,0):          ,  0.038462,  0.038462,  0.038462,
(*,4,0,0,0,0):          ,          ,  0.038462,          ,

(*,0,1,0,0,0):          ,          ,  0.038462,          ,
(*,1,1,0,0,0):          ,  0.038462,  0.038462,  0.038462,
(*,2,1,0,0,0):  0.038462,  0.038462,  0.038462,  0.038462,  0.038462
(*,3,1,0,0,0):          ,  0.038462,  0.038462,  0.038462,
(*,4,1,0,0,0):          ,          ,  0.038462,          ,

This example shows a 5x5x2 kernel with extents 1 in c, t and u dimension.

All rows contain their start coordinates in the kernel where the x coordinate is an asterisk since it represents all x coordinates in the row.

Details

  • Not all kernel elements need to be specified. Empty fields separated by commas do not become part of the kernel.
  • Kernel extents are automatically adapted to the extent given by really defined kernel elements. So it is not possible to create an empty kernel of size 3x3x1x1x1x1 in which only one voxel is defined. Extents will be set automatically to 1x1x1x1x1x1 in this case.

For large kernels it might be useful to specify single elements like the following example

(3,4,1,0,0,0):17

This sets the kernel element at position (3,4,1,0,0,0) to value 17.

Windows

Default Panel

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

Output Fields

output0

name: output0, type: Image

Parameter Fields

Field Index

All: Trigger Kernel: String Sphere: Trigger
Apply: Trigger KernelC: Integer Sqrt(K): Trigger
C: Trigger KernelT: Integer Status: String
Element Sum: Double KernelU: Integer T: Trigger
Field Width: Integer KernelX: Integer U: Trigger
FillGaps: Trigger KernelY: Integer Undo: Trigger
Gauss: Trigger KernelZ: Integer V-K: Trigger
K*V: Trigger Log v(K): Trigger V/K: Trigger
K+V: Trigger Norm: Trigger Value v=: Double
K-V: Trigger Num Elements: Integer X: Trigger
K/V: Trigger Precision: Integer Y: Trigger
K^2: Trigger Redo: Trigger Z: Trigger
K^V: Trigger SetValues: Trigger  

Visible Fields

KernelX

name: kernelX, type: Integer, default: 3, minimum: 1

Sets the x-extent of the kernel.

KernelY

name: kernelY, type: Integer, default: 3, minimum: 1

Sets the y-extent of the kernel.

KernelZ

name: kernelZ, type: Integer, default: 1, minimum: 1

Sets the z-extent of the kernel.

KernelC

name: kernelC, type: Integer, default: 1, minimum: 1

Sets the c-extent of the kernel.

KernelT

name: kernelT, type: Integer, default: 1, minimum: 1

Sets the t-extent of the kernel.

KernelU

name: kernelU, type: Integer, default: 1, minimum: 1

Sets the u-extent of the kernel.

Field Width

name: fieldWidth, type: Integer, default: 10, minimum: 1

Sets the minimum number of characters used to show a kernel element in the text field.

It can be used to adapt the textual appearance of the kernel to the length of the kernel element numbers.

Precision

name: precision, type: Integer, default: 6, minimum: 1, maximum: 64

Sets the minimum number of digits after the comma used to show a kernel element in the text field.

It can be adjusted to adapt the textual appearance of the kernel and the precision of the kernel element

Value v=

name: value, type: Double, default: 1

Sets a generic value used by many of the operations (e.g., K+V, K-V, K^V, etc.).

Apply

name: setKernelExt, type: Trigger

If pressed, the edited kernel is being reset to the currently set extent.

Newly generated kernel elements are set initially to the value given in Value v=.

SetValues

name: setElementValues, type: Trigger

If pressed, all kernel elements are set to the value in Value v=.

FillGaps

name: fillGapsWith, type: Trigger

If pressed, all empty kernel elements so far are being set to the value in Value v=.

K+V

name: add, type: Trigger

If pressed, the value in Value v= is being added to all kernel elements.

K-V

name: sub, type: Trigger

If pressed, the value in Value v= is being subtracted from all kernel elements.

K*V

name: mult, type: Trigger

If pressed, the value in Value v= is being multiplied to all kernel elements.

K/V

name: div, type: Trigger

If pressed, all kernel elements are being divided by the value in Value v=.

K^2

name: sqr, type: Trigger

If pressed, each kernel element is raised to the power of 2.

Sqrt(K)

name: sqrt, type: Trigger

If pressed, each kernel element is replaced by its square root.

V/K

name: invDiv, type: Trigger

If pressed, the value in Value v= is being divided by all kernel elements.

V-K

name: invSub, type: Trigger

If pressed, each kernel element is being subtracted from the value in Value v=.

K^V

name: pow, type: Trigger

If pressed, each kernel element is being raised by the power of the value in Value v=.

Log v(K)

name: log, type: Trigger

If pressed, all kernel elements are being replaced by its logarithm to the base of the value in Value v=.

Gauss

name: gauss, type: Trigger

If pressed, the kernel elements are set to form a normalized Gaussian kernel.

Norm

name: normalize, type: Trigger

If pressed, the kernel elements are being normalized.

This means that the sum of all elements result to 1.

Sphere

name: spherical, type: Trigger

If pressed, the kernel is converted to a spherical kernel.

All

name: mirror, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in 6D.

X

name: mirrorX, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the x-dimension.

Y

name: mirrorY, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the y-dimension.

Z

name: mirrorZ, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the y-dimension.

C

name: mirrorC, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the c-dimension.

T

name: mirrorT, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the t-dimension.

U

name: mirrorU, type: Trigger

If pressed, all kernel elements are being mirrored in a point symmetric manner in the u-dimension.

Undo

name: undo, type: Trigger

If pressed, the last change is being undone.

Redo

name: redo, type: Trigger

If pressed, the last undo operation is undone.

Num Elements

name: numElements, type: Integer, persistent: no

Shows the number of kernel elements.

Element Sum

name: elementSum, type: Double, persistent: no

Shows the sum of all kernel elements.

Status

name: status, type: String, persistent: no

Shows information about the module.

Kernel

name: kernel, type: String

Shows and sets the kernel as a string.

After editing, this field can be connected to the external kernel field of various kernel modules.