NIPY logo

Site Navigation

NIPY Community

Table Of Contents

Previous topic

algorithms.segmentation.brain_segmentation

This Page

algorithms.segmentation.vem

Module: algorithms.segmentation.vem

Inheritance diagram for nipy.algorithms.segmentation.vem:

Class

VEM

class nipy.algorithms.segmentation.vem.VEM(data, labels, mask=None, noise='gauss', ppm=None, synchronous=False, scheme='mf')

Bases: object

Classification via VEM algorithm.

Methods

free_energy
run
sort_labels
ve_step
vm_step
__init__(data, labels, mask=None, noise='gauss', ppm=None, synchronous=False, scheme='mf')

A class to represent a variational EM algorithm for tissue classification.

Parameters :

data: array :

Image data (n-dimensional)

labels: int or sequence :

Desired number of classes, or sequence of strings

mask: sequence :

Sequence of one-dimensional coordinate arrays

free_energy()

Compute the free energy defined as:

F(q, theta) = int q(x) log q(x)/p(x,y/theta) dx

associated with input parameters mu, sigma and beta (up to an ignored constant).

run(mu=None, sigma=None, prop=None, beta=0.2, niters=20, freeze_prop=True)
sort_labels(mu)

Sort the array labels to match mean tissue intensities mu.

ve_step(mu, sigma, prop=None, beta=0.2)

VE-step

vm_step()

Return (mu, sigma)

Functions

nipy.algorithms.segmentation.vem.gauss_dist(x, mu, sigma)
nipy.algorithms.segmentation.vem.laplace_dist(x, mu, sigma)
nipy.algorithms.segmentation.vem.print_(s)
nipy.algorithms.segmentation.vem.vm_step_gauss(ppm, data_masked, mask)

ppm: ndarray (4d) data_masked: ndarray (1d, masked data) mask: 3-element tuple of 1d ndarrays (X,Y,Z)

nipy.algorithms.segmentation.vem.vm_step_laplace(ppm, data_masked, mask)

ppm: ndarray (4d) data_masked: ndarray (1d, masked data) mask: 3-element tuple of 1d ndarrays (X,Y,Z)

nipy.algorithms.segmentation.vem.weighted_median(x, w, ind)