pydicom.values.convert_IS_string¶
-
pydicom.values.
convert_IS_string
(byte_string, is_little_endian, struct_format=None)¶ Return a decoded ‘IS’ value.
Changed in version 2.0: The option to return numpy values was added.
- Parameters
byte_string (bytes or str) – The encoded ‘IS’ element value.
is_little_endian (bool) –
True
if the value is encoded as little endian,False
otherwise.struct_format (str, optional) – Not used.
- Returns
If
use_IS_numpy
isFalse
(default), returns a singleIS
or a list of themIf
use_IS_numpy
isTrue
, returns a singlenumpy.int64
or andarray
of them- Return type
IS
or list of them, ornumpy.int64
orndarray
of them- Raises
ValueError – If
use_IS_numpy
isTrue
and the string contains non-valid charactersImportError – If
use_IS_numpy
isTrue
and numpy is not available