Table Of Contents

Previous topic

misc.vproperty

Next topic

atlases.fsl

This content refers to the previous stable release of PyMVPA. Please visit www.pymvpa.org for the most recent version of PyMVPA and its documentation.

atlases.base

Module: atlases.base

Inheritance diagram for mvpa.atlases.base:

Base classes for Anatomy atlases support

TODOs:

  • major optimization. Now code is sloppy and slow – plenty of checks etc

Module Organization

mvpa.atlases.base module contains support for various atlases

group Base:BaseAtlas XMLBasedAtlas Label Level LabelsLevel
group Talairach:
 PyMVPAAtlas LabelsAtlas ReferencesAtlas
group Exceptions:
 XMLAtlasException

Classes

BaseAtlas

class mvpa.atlases.base.BaseAtlas

Bases: object

Base class for the atlases.

Create an atlas object based on the... XXX

Label

class mvpa.atlases.base.Label(text, abbr=None, coord=(None, None, None), count=0, index=0)

Bases: object

Represents a label. Just to bring all relevant information together

Parameters:
  • text (basestring) – fullname of the label
  • abbr (basestring) – abbreviated name (optional)
  • coord (tuple of float) – coordinates (optional)
  • count (int) – count of those labels in the atlas (optional)
abbr

Returns abbreviated version if such is available

coord
count
static generateFromXML(Elabel)
index
text

LabelsAtlas

class mvpa.atlases.base.LabelsAtlas(*args, **kwargs)

Bases: mvpa.atlases.base.PyMVPAAtlas

Atlas which provides labels for the given coordinate

See also

Please refer to the documentation of the base class for more information:

PyMVPAAtlas

Initialize instance of PyMVPAAtlas

Parameters:
  • filename (string) – Filename for the xml definition of the atlas
  • resolution (None or float) – Some atlases link to multiple images at different resolutions. if None – best resolution is selected using 0th dimension resolution
  • image_file (None or str) – If None, overrides filename for the used imagefile, so it could load a custom (re-registered) atlas maps
  • query_voxel (bool) – By default [x,y,z] assumes coordinates in space, but if query_voxel is True, they are assumed to be voxel coordinates
  • coordT – Optional transformation to apply first
  • levels (None or slice or list of int) – What levels by default to operate on
labelVoxel(c, levels=None)

Return labels for the given voxel at specified levels specified by index

LabelsLevel

class mvpa.atlases.base.LabelsLevel(description, index=None, labels=[])

Bases: mvpa.atlases.base.Level

Level of labels.

XXX extend

find(target, unique=True)

Return labels descr of which matches the string

Parameters:
  • target (str or re._pattern_type) – Substring in abbreviation to be searched for, or compiled regular expression to be searched or matched if anchored.
  • unique (bool) – If True, raise exception if none or more than 1 was found. Return just a single item if found (not list).
static generateFromXML(Elevel, levelIndex=[0])
index
labels

Level

class mvpa.atlases.base.Level(description)

Bases: object

Represents a level. Just to bring all relevant information together

static generateFromXML(Elevel, levelType=None)

Simple factory of levels

levelType

PyMVPAAtlas

class mvpa.atlases.base.PyMVPAAtlas(*args, **kwargs)

Bases: mvpa.atlases.base.XMLBasedAtlas

Base class for PyMVPA atlases, such as LabelsAtlas and ReferenceAtlas

See also

Please refer to the documentation of the base class for more information:

XMLBasedAtlas

Initialize instance of PyMVPAAtlas

Parameters:
  • filename (string) – Filename for the xml definition of the atlas
  • resolution (None or float) – Some atlases link to multiple images at different resolutions. if None – best resolution is selected using 0th dimension resolution
  • image_file (None or str) – If None, overrides filename for the used imagefile, so it could load a custom (re-registered) atlas maps
  • query_voxel (bool) – By default [x,y,z] assumes coordinates in space, but if query_voxel is True, they are assumed to be voxel coordinates
  • coordT – Optional transformation to apply first
  • levels (None or slice or list of int) – What levels by default to operate on
Nlevels
source = 'PyMVPA'
space
spaceFlavor

ReferencesAtlas

class mvpa.atlases.base.ReferencesAtlas(distance=0, *args, **kwargs)

Bases: mvpa.atlases.base.PyMVPAAtlas

Atlas which provides references to the other atlases.

Example: the atlas which has references to the closest points (closest Gray, etc) in another atlas.

See also

Please refer to the documentation of the base class for more information:

PyMVPAAtlas

Initialize ReferencesAtlas

Parameters:
  • filename (string) – Filename for the xml definition of the atlas
  • resolution (None or float) – Some atlases link to multiple images at different resolutions. if None – best resolution is selected using 0th dimension resolution
  • image_file (None or str) – If None, overrides filename for the used imagefile, so it could load a custom (re-registered) atlas maps
  • query_voxel (bool) – By default [x,y,z] assumes coordinates in space, but if query_voxel is True, they are assumed to be voxel coordinates
  • coordT – Optional transformation to apply first
  • levels (None or slice or list of int) – What levels by default to operate on
distance
labelVoxel(c, levels=None)
levelsListing()
setDistance(distance)

Set desired maximal distance for the reference

setReferenceLevel(level)

Set the level which will be queried

ReferencesLevel

class mvpa.atlases.base.ReferencesLevel(description, indexes=[])

Bases: mvpa.atlases.base.Level

Level which carries reference points

static generateFromXML(Elevel)
indexes

XMLAtlasException

class mvpa.atlases.base.XMLAtlasException(msg='')

Bases: exceptions.Exception

Exception to be thrown if smth goes wrong dealing with XML based atlas

XMLBasedAtlas

class mvpa.atlases.base.XMLBasedAtlas(filename=None, resolution=None, image_file=None, query_voxel=False, coordT=None, levels=None)

Bases: mvpa.atlases.base.BaseAtlas

Parameters:
  • filename (string) – Filename for the xml definition of the atlas
  • resolution (None or float) – Some atlases link to multiple images at different resolutions. if None – best resolution is selected using 0th dimension resolution
  • image_file (None or str) – If None, overrides filename for the used imagefile, so it could load a custom (re-registered) atlas maps
  • query_voxel (bool) – By default [x,y,z] assumes coordinates in space, but if query_voxel is True, they are assumed to be voxel coordinates
  • coordT – Optional transformation to apply first
  • levels (None or slice or list of int) – What levels by default to operate on
coordT
extent
labelPoint(coord, levels=None)

Return labels for the given spatial point at specified levels

Function takes care about first transforming the point into the voxel space

Parameters:
  • coord (tuple) – Coordinates of the point (xyz)
  • levels (None or list of int) – At what levels to return the results
levelsListing()
levels_dict
loadAtlas(filename)
origin
setCoordT(coordT)

Set coordT transformation.

spaceT needs to be adjusted since we glob those two transformations together

spaceT
version
voxdim

Function

mvpa.atlases.base.checkRange(coord, range)

Check if coordinates are within range (0,0,0) - (range) Return True on success