pydicom.values.convert_DS_string¶
- pydicom.values.convert_DS_string(byte_string: bytes, is_little_endian: bool, struct_format: str | None = None) DSfloat | MutableSequence[DSfloat] | float64 | ndarray[source]¶
Return a decoded ‘DS’ value.
Changed in version 2.0: The option to return numpy values was added.
- Parameters:
byte_string (bytes) – The encoded ‘DS’ element value.
is_little_endian (bool) –
Trueif the value is encoded as little endian,Falseotherwise.struct_format (str, optional) – Not used.
- Returns:
If
use_DS_decimalisFalse(default), returns aDSfloator list of themIf
use_DS_decimalisTrue, returns aDSdecimalor list of themIf
use_DS_numpyisTrue, returns anumpy.float64or anumpy.ndarrayof them- Return type:
DSfloat,DSdecimal,numpy.float64, MultiValue of DSfloat/DSdecimal ornumpy.ndarrayofnumpy.float64- Raises:
ValueError – If
use_DS_numpyisTrueand the string contains non-valid charactersImportError – If
use_DS_numpyisTrueand numpy is not available