as_nifti_header {neuroim2} | R Documentation |
Construct a Minimal NIfTI-1 Header from a NeuroVol
Description
Given a NeuroVol
object (or similar), this function
builds a basic NIfTI-1 header structure, populating essential fields such as
dim
, pixdim
, datatype
, the affine transform, and the
quaternion parameters.
Usage
as_nifti_header(vol, file_name, oneFile = TRUE, data_type = "FLOAT")
Arguments
vol |
A |
file_name |
A character string for the file name (used within the header but not necessarily to write data). |
oneFile |
Logical; if |
data_type |
Character specifying the data representation, e.g. |
Details
This is a convenience function that calls createNIfTIHeader
first, then updates the fields (dimensions, pixdim
, orientation, etc.)
based on the vol
argument. The voxel offset is set to 352 bytes, and
the quaternion is derived from the transform matrix via
matrixToQuatern
.
Note: This function primarily sets up a minimal header suitable for writing standard single-file NIfTI-1. If you need a more comprehensive or advanced usage, consider manually editing the returned list.
Value
A list
representing the NIfTI-1 header fields, containing
elements like dimensions
, pixdim
, datatype
, qform
,
quaternion
, qfac
, etc. This can be passed to other
functions that write or manipulate the header.
See Also
createNIfTIHeader
for the base constructor of an empty NIfTI header.