Skip to main content

Function: toLowHighRange()

toLowHighRange(windowWidth, windowCenter, voiLUTFunction): object

Given a window width and center, return the lower and upper bounds of the window. The calculation depends on the VOI LUT Function:

LINEAR (default):

  • Uses the DICOM standard formula from C.11.2.1.2.1: if x {'<='} c - 0.5 - (w-1)/2 {'=>'} lower bound if x {'>'} c - 0.5 + (w-1)/2 {'=>'} upper bound

LINEAR_EXACT (C.11.2.1.3.2):

  • Uses: lower = c - w/2 upper = c + w/2

SIGMOID (C.11.2.1.3.1):

  • The sigmoid does not define linear "bounds" in the same way. It's asymptotic.
  • We define approximate bounds by choosing output thresholds (e.g., 1% and 99%) and solving for input x: y = 1/(1 + exp(-4*(x - c)/w)) For y=0.01 and y=0.99, solve for x.

Parameters

windowWidth: number

The width of the window

windowCenter: number

The center of the window

voiLUTFunction: VOILUTFunctionType = VOILUTFunctionType.LINEAR

'LINEAR' | 'LINEAR_EXACT' | 'SIGMOID'

Returns

object

An object containing the lower and upper bounds of the window

lower

lower: number

upper

upper: number

Defined in

packages/core/src/utilities/windowLevel.ts:53