new WindowLevel(center, width)
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. |
- Source
- See
DICOM doc for Window Center and Window Width
Methods
apply(value) → {number}
Apply the window level on an input value.
Parameters:
Name | Type | Description |
---|---|---|
value | number | The value to rescale as an integer. |
- Source
Returns:
The leveled value, in the [ymin, ymax] range (default [0,255]).
- Type:
- number
equals(rhs) → {boolean}
Check for window level equality.
Parameters:
Name | Type | Description |
---|---|---|
rhs | object | The other window level to compare to. |
- Source
Returns:
True if both window level are equal.
- Type:
- boolean
getCenter() → {number}
Get the window center.
- Source
Returns:
The window center.
- Type:
- number
getWidth() → {number}
Get the window width.
- Source
Returns:
The window width.
- Type:
- number
setRange(min, max)
Set the output value range.
Parameters:
Name | Type | Description |
---|---|---|
min | number | The output value minimum. |
max | number | The output value maximum. |
- Source
setSignedOffset(offset)
Set the signed offset.
Parameters:
Name | Type | Description |
---|---|---|
offset | number | The signed data offset, typically: slope * ( size / 2). |
- Source
toString() → {string}
Get a string representation of the window level.
- Source
Returns:
The window level as a string.
- Type:
- string