Table Of Contents

Previous topic

mvpa.mappers.mask

Next topic

mvpa.mappers.pca

This Page

Quick search

mvpa.mappers.metric

Classes and functions to provide sense of distances between sample points

The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.mappers.metric (for developers).

Classes

DescreteMetric

class mvpa.mappers.metric.DescreteMetric(elementsize=1, distance_function=<function cartesianDistance at 0x8fa7e9c>)

Bases: mvpa.mappers.metric.Metric

Find neighboring points in descretized space

If input space is descretized and all points fill in N-dimensional cube, this finder returns list of neighboring points for a given distance.

As input points it operates on discretized values, not absolute coordinates (which are e.g. in mm)

Initialize the class provided @elementsize and @distance_function

elementsize
filter_coord
Lets allow to specify some custom filter to use
getNeighbors(origin, radius=0)

Returns coordinates of the neighbors which are within distance from coord

XXX radius might need to be not a scalar but a vector of scalars to specify search distance in different dimensions differently... but then may be it has to be a tensor to specify orientation etc? :-) so it might not be necessary for now

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the DescreteMetric documentation.

Full API documentation of DescreteMetric in module mvpa.mappers.metric.

Metric

class mvpa.mappers.metric.Metric

Bases: object

Abstract class for any finder.

Classes subclasses from this class show know about structure of the data and thus be able to provide information about the neighbors. At least one of the methods (getNeighbors, getNeighbor) has to be overriden in the derived class. NOTE: derived #2 from derived class #1 has to override all methods which were overrident in class #1

getNeighbor(*args, **kwargs)

Generator to return coordinate of the neighbor.

Base class contains the simplest implementation, assuming that getNeighbors returns iterative structure to spit out neighbors 1-by-1

getNeighbors(*args, **kwargs)

Return the list of coordinates for the neighbors.

By default it simply constracts the list based on the generator getNeighbor

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the Metric documentation.

Full API documentation of Metric in module mvpa.mappers.metric.