NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.gifti.giftiio.read

Next topic

nibabel.gifti.gifti

Reggie -- the one

nibabel.gifti.giftiio.write

nibabel.gifti.giftiio.write(image, filename)

Save the current image to a new file

Parameters:

image : GiftiImage

A GiftiImage instance to store

filename : string

Filename to store the Gifti file to

Returns:

None :

Notes

We write all files with utf-8 encoding, and specify this at the top of the XML file with the encoding attribute.

The Gifti spec suggests using the following suffixes to your filename when saving each specific type of data:

.gii
Generic GIFTI File
.coord.gii
Coordinates
.func.gii
Functional
.label.gii
Labels
.rgba.gii
RGB or RGBA
.shape.gii
Shape
.surf.gii
Surface
.tensor.gii
Tensors
.time.gii
Time Series
.topo.gii
Topology

The Gifti file is stored in endian convention of the current machine.