Pixel Data (pydicom.pixels)

Image processing functions

apply_color_lut(arr[, ds, palette])

Apply a color palette lookup table to arr.

apply_icc_profile(arr[, ds, transform, ...])

Apply an ICC Profile to arr, either from the dataset ds or an existing Pillow color transformation object transform.

apply_modality_lut(arr, ds)

Apply a modality lookup table or rescale operation to arr.

apply_presentation_lut(arr, ds)

Apply a Presentation LUT to arr and return the P-values.

apply_rescale(arr, ds)

Apply a modality lookup table or rescale operation to arr.

apply_voi_lut(arr, ds[, index, prefer_lut])

Apply a VOI lookup table or windowing operation to arr.

apply_voi(arr, ds[, index])

Apply a VOI lookup table to arr.

apply_windowing(arr, ds[, index])

Apply a windowing operation to arr.

convert_color_space(arr, current, desired[, ...])

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

create_icc_transform([ds, icc_profile, ...])

Return a Pillow color transformation object from either the dataset ds or an ICC profile icc_profile.

Utility functions

as_pixel_options(ds, **kwargs)

Return a dict containing the image pixel element values from ds.

compress(ds, transfer_syntax_uid[, arr, ...])

Compress uncompressed pixel data and update ds in-place with the resulting encapsulated codestream.

decompress(ds, *[, as_rgb, ...])

Perform an in-place decompression of a dataset with a compressed Transfer Syntax UID.

get_decoder(uid)

Return the pixel data decoder corresponding to uid.

get_encoder(uid)

Return the pixel data encoder corresponding to uid.

iter_pixels(src, *[, ds_out, specific_tags, ...])

Yield decoded pixel data frames from src as ndarray.

pack_bits(arr[, pad])

Pack a binary numpy.ndarray for use with Pixel Data.

pixel_array(src, *[, ds_out, specific_tags, ...])

Return decoded pixel data from src as ndarray.

set_pixel_data(ds, arr, ...[, ...])

Use an ndarray to set a dataset's Pixel Data and related Image Pixel module elements.

unpack_bits(src[, as_array])

Unpack the bit-packed data in src.

Sub-modules