TransferFunction

MLModule
genre LUT
status stable
author Mathias Schlueter
package MeVisLab/Standard
dll MLTransferFunction
definition MLTransferFunction.def
see also Gradation
keywords Transfer, function, gradation, gamma, log, exp, lut, window, scale

Purpose

The module TransferFunction offers several transfer functions which for example can be applied to all voxels of an images, by connecting the output of the module to the Gradation module.

Details

The resulting transfer function object maps the interval [0,1] to itself.

If the checkboxes Invert input or Invert Output are checked, the input x / output y is mirrored at 0.5:

x -> 1-x  / y -> 1-y

The fields Function Parameter 1 and Function Parameter 2 parameterize the selected transfer function. They scale between -1 and 1. The value 0 means no change of the input value.

Windows

Default Panel

../../../Modules/ML/MLTransferFunction/mhelp/Images/Screenshots/TransferFunction._default.png

Output Fields

outputTransferFunction

name: outputTransferFunction, type: MLBase

Parameter Fields

Visible Fields

Function Parameter 1

name: functionParameter, type: Double, default: 0, minimum: -1, maximum: 1

Sets a value to control the transfer function.

Function Parameter 2

name: functionParameter2, type: Double, default: 0, minimum: -1, maximum: 1

Sets a value to control the transfer function.

Invert input

name: invertIn, type: Bool, default: FALSE

If checked, the input is mirrored at 0.5:

x -> 1 - x

Invert Output

name: invertOut, type: Bool, default: FALSE

If checked, the output is mirrored at 0.5:

y -> 1 - y

Transfer Function

name: transferFunction, type: Enum, default: Gamma

Defines the transfer function.

Values:

Title Name Description
Gamma Gamma

The gamma curve is applied to the input:

y = pow(x, gamma)

The exponent gamma is adjusted according to Function Parameter 1.

Positive values enhance and negative values lower the input value:

gamma = (1 - Function Parameter 1) / (1 + Function Parameter 1)
Log Exp LogExp

For positive values of Function Parameter 1 a logarithmic curve is applied to the input:

y = log(1 + a * x) / log(1 + a)

For negative values of Function Parameter 1 an exponential curve is applied to the input:

y = (exp(log(1 + a) * x) - 1) / a

The slope parameter a is adjusted according to Function Parameter 1. Positive values enhance and negative values lower the input value.

Window Window

A window function is applied to the input value.

Function Parameter 1 moves the center of the window from 0 to 1 according to:

center = 1/2 * (1 + Function Parameter 1)

Function Parameter 2 scales the width of the window from 0 to 2 according to:

width = 1 + Function Parameter 2
Scale Scale

The input value is scaled.

The scaling is defined by a left lower and a right upper point adjusted according to Function Parameter 1 and Function Parameter 2, respectively.

For Function Parameter 1 from 0 to 1 the output component of the left lower point moves from 0 to 1 and for Function Parameter 1 - values from 0 to -1 the input component of the left lower point moves from 0 to 1.

For Function Parameter 2 from 0 to 1 the input component of the right upper point moves from 1 to 0 and for Function Parameter 2 - values from 0 to -1 the output component of the right upper point moves from 1 to 0.