pydicom.filewriter.correct_ambiguous_vr(ds: Dataset, is_little_endian: bool) Dataset[source]

Iterate through ds correcting ambiguous VR elements (if possible).

When it’s not possible to correct the VR, the element will be returned unchanged. Currently the only ambiguous VR elements not corrected for are all retired or part of DICONDE.

If the VR is corrected and is ‘US’ or ‘SS’ then the value will be updated using the convert_numbers() function.

  • ds (pydicom.dataset.Dataset) – The dataset containing ambiguous VR elements.

  • is_little_endian (bool) – The byte ordering of the values in the dataset.


ds – The corrected dataset

Return type:



AttributeError – If a tag is missing in ds that is required to resolve the ambiguity.