pydicom.fileutil.read_undefined_length_value¶
-
pydicom.fileutil.
read_undefined_length_value
(fp, is_little_endian, delimiter_tag, defer_size=None, read_size=8192)[source]¶ Read until delimiter_tag and return the value up to that point.
On completion, the file will be set to the first byte after the delimiter and its following four zero bytes.
- Parameters
fp (file-like) – The file-like to read.
is_little_endian (bool) –
True
if file transfer syntax is little endian, elseFalse
.delimiter_tag (BaseTag) – Tag used as end marker for reading
defer_size (int or None, optional) – Size to avoid loading large elements in memory. See
dcmread()
for more parameter info.read_size (int, optional) – Number of bytes to read at one time.
- Returns
delimiter – The file delimiter.
- Return type
- Raises
EOFError – If EOF is reached before delimiter found.