Table Of Contents

Previous topic

neurospin.graph.BPmatch

Next topic

neurospin.graph.graph

This Page

neurospin.graph.field

Module: neurospin.graph.field

Inheritance diagram for nipy.neurospin.graph.field:

Field processing (smoothing, morphology) routines. Here, a field is defined as arrays [eA,eB,eD,vF] where. (eA,eB,eC) define a graph and vF a dunction defined on the edges of the graph Author: Bertrand Thirion (INRIA Futurs, Orsay, France), 2004-2006.

Field

class nipy.neurospin.graph.field.Field(V, edges=None, weights=None, field=None)

Bases: nipy.neurospin.graph.graph.WeightedGraph

This is the basic field structure, which contains the weighted graph structure plus a matrix of data (the ‘field’) -field is an array of size(n,p) where n is the number of vertices of the graph and p is the field dimension

__init__(V, edges=None, weights=None, field=None)
INPUT: V: the number of vertices of the graph edges=None: the edge array of the graph weights=None: the asociated weights array field=None: the data itself This is the build function
closing(nbiter=1)
self.closing(nbiter=1) Morphological closing of the field IMPUT nbiter=1 : the number of iterations required
constrained_voronoi(seed)
label = self.constrained_voronoi(seed) performs a voronoi parcellation of the field starting from the input seed INPUT: seed: int array of shape(p), the input seeds OUTPUT: label: The resulting labelling of the data
copy()
copy function
custom_watershed(refdim=0, th=-inf)
idx,depth, major,label = self.custom_watershed(refim = 0,th=-infty) perfoms a watershed analysis of the field. Note that bassins are found aound each maximum (and not minimum as conventionally) INPUT : - th is a threshold so that only values above th are considered by default, th = -infty (numpy) OUTPUT: - idx: the indices of the vertices that are local maxima - depth: the depth of the local maxima depth[idx[i]] = q means that idx[i] is a q-order maximum Note that this is also the diameter of the basins associated with local maxima - major: the label of the maximum which dominates each local maximum i.e. it describes the hierarchy of the local maxima - label : a labelling of thevertices according to their bassin idx, depth and major have length q, where q is the number of bassins label as length n: the number of vertices
diffusion(nbiter=1)
diffusion of a field of data in the weighted graph structure INPUT : - nbiter=1: the number of iterations required (the larger the smoother) NB: - This is done for all the dimensions of the field
dilation(nbiter=1)
self.dilation(nbiter=1) Morphological openeing of the field IMPUT nbiter=1 : the number of iterations required
erosion(nbiter=1)
self.erosion(nbiter=1) Morphological openeing of the field IMPUT nbiter=1 : the number of iterations required
generate_blobs(refdim = 0, th=-infty, smin=0)
INPUT - th is a threshold so that only values above th are considered by default, th = -infty (numpy) - smin is the minimum size (in number of nodes) of the blobs to keep.
get_field()
get_local_maxima(refdim=0, th=-inf)
idx,depth = get_local_maxima(th=-infty) Look for the local maxima of field[:,refdim] INPUT : - refdim is the field dimension over which the maxima are looked after - th is a threshold so that only values above th are considered by default, th = -infty (numpy) OUTPUT: - idx: the indices of the vertices that are local maxima - depth: the depth of the local maxima : depth[idx[i]] = q means that idx[i] is a q-order maximum
local_maxima(refdim=0)

Look for all the local maxima of a field INPUT : - refdim is the field dimension over which the maxima are looked after OUTPUT: - depth: a labelling of the vertices such that

depth[v] = 0 if v is not a local maximum depth[v] = 1 if v is a first order maximum ... depth[v] = q if v is a q-order maximum
opening(nbiter=1)
self.opening(nbiter=1) Morphological openeing of the field IMPUT nbiter=1 : the number of iterations required
print_field()
set_field(field)
threshold_bifurcations(refdim=0, th=-inf)
idx,height, parents,label = threshold_bifurcations(refdim = 0,th=-infty) perfoms theanalysis of the level sets of the field: Bifurcations are defined as changes in the topology in the level sets when the level (threshold) is varied This can been thought of as a kind of Morse description INPUT : - th is a threshold so that only values above th are considered by default, th = -infty (numpy) OUTPUT: - idx: the indices of the vertices that are local maxima - height: the depth of the local maxima depth[idx[i]] = q means that idx[i] is a q-order maximum Note that this is also the diameter of the basins associated with local maxima - parents: the label of the maximum which dominates each local maximum i.e. it describes the hierarchy of the local maxima - label : a labelling of thevertices according to their bassin idx, depth and major have length q, where q is the number of bassins label as length n: the number of vertices