WindowLevel

dwv.image. WindowLevel

new WindowLevel(center, width)

Source:
See:

WindowLevel class.
Pseudo-code:

 if (x <= c - 0.5 - (w-1)/2), then y = ymin
 else if (x > c - 0.5 + (w-1)/2), then y = ymax,
 else y = ((x - (c - 0.5)) / (w-1) + 0.5) * (ymax - ymin) + ymin
Parameters:
Name Type Description
center number

The window center.

width number

The window width.

Methods

apply(value) → {number}

Source:

Apply the window level on an input value.

Parameters:
Name Type Description
value number

The value to rescale as an integer.

Returns:

The leveled value, in the [ymin, ymax] range (default [0,255]).

Type
number

equals(rhs) → {boolean}

Source:

Check for window level equality.

Parameters:
Name Type Description
rhs object

The other window level to compare to.

Returns:

True if both window level are equal.

Type
boolean

getCenter() → {number}

Source:

Get the window center.

Returns:

The window center.

Type
number

getWidth() → {number}

Source:

Get the window width.

Returns:

The window width.

Type
number

setRange(min, max)

Source:

Set the output value range.

Parameters:
Name Type Description
min number

The output value minimum.

max number

The output value maximum.

setSignedOffset(offset)

Source:

Set the signed offset.

Parameters:
Name Type Description
offset number

The signed data offset, typically: slope * ( size / 2).

toString() → {string}

Source:

Get a string representation of the window level.

Returns:

The window level as a string.

Type
string