pydicom.hooks.raw_element_value

pydicom.hooks.raw_element_value(raw: RawDataElement, data: dict[str, Any], *, encoding: str | MutableSequence[str] | None = None, ds: Dataset | None = None, **kwargs: Any) None[source]

Convert the encoded value for raw to an appropriate type.

Added in version 3.0.

Will set the VR to UN if unable to convert the value.

Default callback function for the "raw_element_value" hook.

Parameters:
  • raw (RawDataElement) – The raw data element to determine the value for.

  • data (dict[str, Any]) – A dict to store the results of the value conversion, which should be added as {"value": Any}.

  • encoding (str | MutableSequence[str] | None) – The character set encoding to use for text VRs.

  • **kwargs (dict[str, Any]) – Additional keyword arguments.