vreg.write_nifti#

vreg.write_nifti(vol: Volume3D, filepath: str)[source]#

Write volume to disk in NIfTI format.

Parameters:
  • vol (Volume3D) – the volume to write.

  • filepath (str) – filepath to the NIfTI file.

Raises:

ImportError – Error raised if nibabel is not installed.

Note

This requires a separate installation of the optional nibabel package, either via ‘pip install nibabel’ or by installing vreg with the rw option ‘pip install vreg[rw]’.

Warning

For volumes with more than 3 dimensions, saving to nifti will result in loss of information on the extra dimensions - specifically their name and coordinates of the images.