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
withshape
(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
References
DICOM Standard, Part 3, Annex C.7.6.3.1.2
ISO/IEC 10918-5:2012 (ITU T.871), Section 7