diff --git a/nibabel/streamlines/tck.py b/nibabel/streamlines/tck.py index ff12bc2322..17741928d1 100644 --- a/nibabel/streamlines/tck.py +++ b/nibabel/streamlines/tck.py @@ -319,7 +319,8 @@ def _read_header(fileobj): offset_data = f.tell() # Build header dictionary from the buffer. - hdr = dict(item.split(': ') for item in buf.rstrip().split('\n')[:-1]) + hdr = dict(item.split(': ') for item in buf.rstrip().split('\n') + if ': ' in item) hdr[Field.MAGIC_NUMBER] = magic_number # Check integrity of TCK header.