pydicom.values.convert_IS_string¶
- pydicom.values.convert_IS_string(byte_string: bytes, is_little_endian: bool, struct_format: str | None = None) IS | MutableSequence[IS] | int64 | ndarray[source]¶
Return a decoded ‘IS’ value.
Changed in version 2.0: The option to return numpy values was added.
- Parameters:
byte_string (bytes) – The encoded ‘IS’ element value.
is_little_endian (bool) –
Trueif the value is encoded as little endian,Falseotherwise.struct_format (str, optional) – Not used.
- Returns:
If
use_IS_numpyisFalse(default), returns a singleISor a list of themIf
use_IS_numpyisTrue, returns a singlenumpy.int64or andarrayof them- Return type:
ISor MultiValue of them, ornumpy.int64orndarrayof them- Raises:
ValueError – If
use_IS_numpyisTrueand the string contains non-valid charactersImportError – If
use_IS_numpyisTrueand numpy is not available