Module: algorithms.fwhm

Inheritance diagram for nipy.algorithms.fwhm:

Inheritance diagram of nipy.algorithms.fwhm

This module provides classes and definitions for using full width at half maximum (FWHM) to be used in conjunction with Gaussian Random Field Theory to determine resolution elements (resels).

A resolution element (resel) is defined as a block of pixels of the same size as the FWHM of the smoothed image.

There are two methods implemented to estimate (3d, or volumewise) FWHM based on a 4d Image:

fastFHWM: used if the entire 4d Image is available iterFWHM: used when 4d Image is being filled in by slices of residuals



class nipy.algorithms.fwhm.ReselImage(resels=None, fwhm=None, **keywords)

Bases: nipy.algorithms.fwhm.Resels

__init__(resels=None, fwhm=None, **keywords)

Initialize resel image


resels : core.api.Image

Image of resel per voxel values.

fwhm : core.api.Image

Image of FWHM values.

keywords : dict

Passed as keywords arguments to core.api.Image


class nipy.algorithms.fwhm.Resels(coordmap, normalized=False, fwhm=None, resels=None, mask=None, clobber=False, D=3)

Bases: nipy.externals.six.Iterator

The Resels class.

__init__(coordmap, normalized=False, fwhm=None, resels=None, mask=None, clobber=False, D=3)

Initialize resels class


coordmap : CoordinateMap

CoordinateMap over which fwhm and resels are to be estimated. Used in fwhm/resel conversion.

fwhm : Image

Optional Image of FWHM. Used to convert FWHM Image to resels if FWHM is not being estimated.

resels : Image

Optional Image of resels. Used to compute resels within a mask, for instance, if FWHM has already been estimated.

mask : Image

Mask over which to integrate resels.

clobber : bool

Clobber output FWHM and resel images?

D : int

Can be 2 or 3, the dimension of the final volume.


Convert FWHM fwhm to equivalent reseels per voxel


fwhm : float

Convert an FWHM value to an equivalent resels per voxel based on step sizes in self.coordmap.


resels : float


Integrate resels within mask (or use self.mask)


mask : Image

Optional mask over which to integrate (add) resels.


total_resels :

the resels contained in the mask

FWHM : float

an estimate of FWHM based on the average resel per voxel

nvoxel: int

the number of voxels in the mask


Convert resels as resels to isotropic FWHM


resels : float

Convert a resel value to an equivalent isotropic FWHM based on step sizes in self.coordmap.


fwhm : float