pydicom.pixel_data_handlers.apply_voi

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

Apply a VOI lookup table to arr.

New in version 2.1.

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