diff --git a/nibabel/streamlines/tck.py b/nibabel/streamlines/tck.py index 358c57936..0b4a941c3 100644 --- a/nibabel/streamlines/tck.py +++ b/nibabel/streamlines/tck.py @@ -385,7 +385,7 @@ def _read_header(cls, fileobj): 'TCK only supports single-file - in other words the filename part must be ' f"specified as '.' but '{hdr['file'].split()[0]}' was specified." ) - raise HeaderError("Missing 'file' attribute in TCK header.") + raise HeaderError(msg) # Set endianness and _dtype attributes in the header. hdr[Field.ENDIANNESS] = '>' if hdr['datatype'].endswith('BE') else '<'