Skip to content

Commit cf7c130

Browse files
committed
BF: bytes for PAR header content in parrec2nii
The extension contents needs to unpack to bytes, because we are writing into a binary (header) file.
1 parent 0d3d452 commit cf7c130

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/parrec2nii

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def proc_file(infile, opts):
198198
# container for potential NIfTI1 header extensions
199199
if opts.store_header:
200200
# dump the full PAR header content into an extension
201-
with open(infile, 'r') as fobj:
201+
with open(infile, 'rb') as fobj: # contents must be bytes
202202
hdr_dump = fobj.read()
203203
dump_ext = nifti1.Nifti1Extension('comment', hdr_dump)
204204
nhdr.extensions.append(dump_ext)

0 commit comments

Comments
 (0)