VoiLut

VOI (Values of Interest) LUT class: apply window centre and width.

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

Ref: https://dicom.nema.org/medical/dicom/2022a/output/chtml/part03/sect_C.11.2.html.

Constructor

new VoiLut(wl)

Parameters:
NameTypeDescription
wlWindowLevel

The window center and width.

Classes

VoiLut

Methods

apply(value) → {number}

Apply the window level on an input value.

Parameters:
NameTypeDescription
valuenumber

The value to rescale as an integer.

Returns:

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

Type: 
number

getWindowLevel() → {WindowLevel}

Get the window and level.

Returns:

The window center and width.

Type: 
WindowLevel

setSignedOffset(offset)

Set the signed offset.

Parameters:
NameTypeDescription
offsetnumber

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