pydicom.pixels.apply_voi

pydicom.pixels.apply_voi(arr: np.ndarray, ds: Dataset, index: int = 0) np.ndarray[source]

Apply a VOI lookup table to arr.

Added in version 2.1.

See apply_voi_lut() for applying Window Width/Window Center as a fallback if no VOI LUT Sequence is present.

Parameters:
  • arr (numpy.ndarray) – The ndarray to apply the VOI LUT to.

  • ds (dataset.Dataset) – A dataset containing a VOI LUT Module. If (0028,3010) VOI LUT Sequence is present then returns an array of np.uint8 or np.uint16, depending on the 3rd value of (0028,3002) LUT Descriptor, otherwise arr will be returned unchanged.

  • index (int, optional) – When the VOI LUT Module contains multiple alternative views, this is the index of the view to return (default 0).

Returns:

An array with applied VOI LUT.

Return type:

numpy.ndarray

References