pydicom.pixel_data_handlers.convert_color_space

pydicom.pixel_data_handlers.convert_color_space(arr: numpy.ndarray, current: str, desired: str)numpy.ndarray[source]

Convert the image(s) in arr from one color space to another.

Changed in version 1.4: Added support for YBR_FULL_422

Parameters
  • arr (numpy.ndarray) – The image(s) as a numpy.ndarray with shape (frames, rows, columns, 3) or (rows, columns, 3).

  • current (str) – The current color space, should be a valid value for (0028,0004) Photometric Interpretation. One of 'RGB', 'YBR_FULL', 'YBR_FULL_422'.

  • desired (str) – The desired color space, should be a valid value for (0028,0004) Photometric Interpretation. One of 'RGB', 'YBR_FULL', 'YBR_FULL_422'.

Returns

The image(s) converted to the desired color space.

Return type

numpy.ndarray

References