VoiLutLinearFunction
Source: voiLut.js:32
VOI LUT linear function.
Can be default linear or linear exact.
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) + yminCODE
if (x <= c - w/2), then y = ymin
else if (x > c + w/2), then y = ymax
else y = ((x - c) / w + 0.5) * (ymax- ymin) + yminRef: https://dicom.nema.org/medical/dicom/2024a/output/chtml/part03/sect_C.11.2.html#sect_C.11.2.1.2.
Constructor
new VoiLutLinearFunction(
center: number,
width: number,
isExact?: boolean,
): VoiLutLinearFunctionParameters
center(number) — The window level center.width(number) — The window level width.isExact(boolean, optional) — Is exact flag, defaults to false.
Instance Methods
getY(x: number): number
Get the value of the function at a given number.
Parameters
x(number) — The input value.
Returns
number— The value of the function at x.