labs.viz_tools.coord_tools

Module: labs.viz_tools.coord_tools

Misc tools to find activations and cut on maps

Functions

nipy.labs.viz_tools.coord_tools.coord_transform(x, y, z, affine)

Convert the x, y, z coordinates from one image space to another space.

Parameters:

x : number or ndarray

The x coordinates in the input space

y : number or ndarray

The y coordinates in the input space

z : number or ndarray

The z coordinates in the input space

affine : 2D 4x4 ndarray

affine that maps from input to output space.

Returns:

x : number or ndarray

The x coordinates in the output space

y : number or ndarray

The y coordinates in the output space

z : number or ndarray

The z coordinates in the output space

Warning: The x, y and z have their Talairach ordering, not 3D :

numy image ordering. :

nipy.labs.viz_tools.coord_tools.find_cut_coords(map, mask=None, activation_threshold=None)

Find the center of the largest activation connect component.

Parameters:

map : 3D ndarray

The activation map, as a 3D image.

mask : 3D ndarray, boolean, optional

An optional brain mask.

activation_threshold : float, optional

The lower threshold to the positive activation. If None, the activation threshold is computed using find_activation.

Returns:

x: float :

the x coordinate in voxels.

y: float :

the y coordinate in voxels.

z: float :

the z coordinate in voxels.

nipy.labs.viz_tools.coord_tools.find_maxsep_cut_coords(map3d, affine, slicer='z', n_cuts=None, threshold=None)

Heuristic function to find n_cuts along a given axis, which are maximally separated in space.

map3d: 3D array
the data under consideration
slicer: string, optional (default “z”)
sectional slicer; possible values are “x”, “y”, or “z”
n_cuts: int > 1, optional (default None)
number of cuts in the plot; if no value is specified, then a default value of 5 is forced
threshold: float, optional (default None)
thresholding to be applied to the map
Returns:

n_cuts: 1D array of length n_cuts :

the computed n_cuts

Raises:

ValueError :

nipy.labs.viz_tools.coord_tools.get_mask_bounds(mask, affine)

Return the world-space bounds occupied by a mask given an affine.

Notes

The mask should have only one connect component.

The affine should be diagonal or diagonal-permuted.