Table Of Contents

Previous topic

io.nifti_ref

Next topic

modalities.fmri.filters

This Page

io.pyniftiio

Module: io.pyniftiio

Inheritance diagram for nipy.io.pyniftiio:

The Nipy interface to the PyNifti library.

Use PyNifti to open files and extract necessary data to generate a Nipy Image.

PyNiftiIO

class nipy.io.pyniftiio.PyNiftiIO(data, mode='r', dtype=None, header={})

Bases: object

Wrapper around the PyNifit image class.

__init__(data, mode='r', dtype=None, header={})

Create a PyNiftiIO object.

Parameters:

data : {array_like, filename}

Data should be either a filename (string), a numpy array or an object that implements the __array__ interface from which we get an array.

mode : {‘r’, ‘w’}, optional

File access mode. Read-only or read-write mode.

dtype : numpy.dtype

The dtype to save the data array as. An exception is raised if the requested dtype is not a valid nifti data type.

Returns:

pyniftiio : A PyNiftiIO object

affine
diminfo
filename
header
Get or set the pynifti header.
ndim
orientation
pixdim
save(affine, pixdim, diminfo, filename=None)
shape
nipy.io.pyniftiio.getaffine(img)

Get affine transform from a NiftiImage.

Parameters:

img : NiftiImage

image opened with PyNifti

Returns:

affine : array

The 4x4 affine transform as a numpy array