Create a template NIFTI v1 header. You will have to adapt it for your use case.
ni1header.template(pair = FALSE)named list, the NIFTI v1 header. All fields are present and filled with values of a proper type. Whether or not they make sense is up to you, but you will most likely have to adapt at least the following fields to your data: dim_raw, datatype, bitpix.
logical, whether the template describes a NIFTI v1 pair file (a .hdr header file plus a separate
.img data file, the variant that is also used by the ANALYZE 7.5 format and that FSL writes) instead of a
single file (.nii, the header and the data in one file). The two variants differ in the magic field and in
the vox_offset field, which is 352 for a single file (the data starts behind the header) and 0 for a pair (the
data starts at the first byte of the .img file). Both variants are written by write.nifti1.
ni1header.for.data