Read / write access to NIfTI2 image format
Format described here:
Stuff about the CIFTI file format here:
Nifti2Header([binaryblock, endianness, ...]) | Class for NIfTI2 header |
Nifti2Image(dataobj, affine[, header, ...]) | Class for single file NIfTI2 format image |
Nifti2Pair(dataobj, affine[, header, extra, ...]) | Class for NIfTI2 format image, header pair |
Nifti2PairHeader([binaryblock, endianness, ...]) | Class for NIfTI2 pair header |
load(filename) | Load NIfTI2 single or pair image from filename |
save(img, filename) | Save NIfTI2 single or pair to filename |
Bases: nibabel.nifti1.Nifti1Header
Class for NIfTI2 header
NIfTI2 is a slightly simplified variant of NIfTI1 which replaces 32-bit floats with 64-bit floats, and increases some integer widths to 32 or 64 bits.
Initialize header from binary data block and extensions
Initialize header from binary data block and extensions
Create empty header binary block with given endianness
Get shape of data
Notes
Does not use Nifti1 freesurfer hack for large vectors described in Nifti1Header.set_data_shape()
Examples
>>> hdr = Nifti2Header()
>>> hdr.get_data_shape()
(0,)
>>> hdr.set_data_shape((1,2,3))
>>> hdr.get_data_shape()
(1, 2, 3)
Expanding number of dimensions gets default zooms
>>> hdr.get_zooms()
(1.0, 1.0, 1.0)
Set shape of data
If ndims == len(shape) then we set zooms for dimensions higher than ndims to 1.0
Parameters: | shape : sequence
|
---|
Notes
Does not apply nifti1 Freesurfer hack for long vectors (see Nifti1Header.set_data_shape())
Bases: nibabel.nifti1.Nifti1Image
Class for single file NIfTI2 format image
alias of Nifti2Header
Bases: nibabel.nifti1.Nifti1Pair
Class for NIfTI2 format image, header pair
alias of Nifti2PairHeader
Bases: nibabel.nifti2.Nifti2Header
Class for NIfTI2 pair header
Initialize header from binary data block and extensions
Initialize header from binary data block and extensions
Load NIfTI2 single or pair image from filename
Parameters: | filename : str
|
---|---|
Returns: | img : Nifti2Image or Nifti2Pair
|
Raises: | ImageFileError :
IOError :
|