pydicom.pixel_data_handlers.gdcm_handler

Use the GDCM Python package to decode pixel transfer syntaxes.

Functions

create_data_element(dicom_dataset)

Return a gdcm.DataElement for the Pixel Data.

create_image(dicom_dataset, data_element)

Return a gdcm.Image.

create_image_reader(filename)

Return a gdcm.ImageReader.

get_pixeldata(dicom_dataset)

Use the GDCM package to decode Pixel Data.

is_available()

Return True if the handler has its dependencies met.

needs_to_convert_to_RGB(dicom_dataset)

Return True if the Pixel Data should to be converted from YCbCr to RGB.

should_change_PhotometricInterpretation_to_RGB(…)

Return True if the Photometric Interpretation should be changed to RGB.

supports_transfer_syntax(transfer_syntax)

Return True if the handler supports the transfer_syntax.

pydicom.pixel_data_handlers.gdcm_handler.create_data_element(dicom_dataset)

Return a gdcm.DataElement for the Pixel Data.

Parameters

dicom_dataset (dataset.Dataset) – The Dataset containing the Pixel Data.

Returns

The converted Pixel Data element.

Return type

gdcm.DataElement

pydicom.pixel_data_handlers.gdcm_handler.create_image(dicom_dataset, data_element)

Return a gdcm.Image.

Parameters
  • dicom_dataset (dataset.Dataset) – The Dataset containing the Image Pixel module.

  • data_element (gdcm.DataElement) – The gdcm.DataElement Pixel Data element.

Returns

Return type

gdcm.Image

pydicom.pixel_data_handlers.gdcm_handler.create_image_reader(filename)

Return a gdcm.ImageReader.

Parameters

filename (str or unicode) – The path to the DICOM dataset.

Returns

Return type

gdcm.ImageReader

pydicom.pixel_data_handlers.gdcm_handler.get_pixeldata(dicom_dataset)

Use the GDCM package to decode Pixel Data.

Returns

A correctly sized (but not shaped) array of the entire data volume

Return type

numpy.ndarray

Raises
  • ImportError – If the required packages are not available.

  • TypeError – If the image could not be read by GDCM or if the Pixel Data type is unsupported.

  • AttributeError – If the decoded amount of data does not match the expected amount.

pydicom.pixel_data_handlers.gdcm_handler.is_available()

Return True if the handler has its dependencies met.

pydicom.pixel_data_handlers.gdcm_handler.needs_to_convert_to_RGB(dicom_dataset)

Return True if the Pixel Data should to be converted from YCbCr to RGB.

This affects JPEG transfer syntaxes.

pydicom.pixel_data_handlers.gdcm_handler.should_change_PhotometricInterpretation_to_RGB(dicom_dataset)

Return True if the Photometric Interpretation should be changed to RGB.

This affects JPEG transfer syntaxes.

pydicom.pixel_data_handlers.gdcm_handler.supports_transfer_syntax(transfer_syntax)

Return True if the handler supports the transfer_syntax.

Parameters

transfer_syntax (uid.UID) – The Transfer Syntax UID of the Pixel Data that is to be used with the handler.