mvpa2.testing.datasets.local_random_affine_transformations(ds, distort_seeds, distort_neighbor, space, scale_fac=100, shift_fac=10)

Distort a dataset in the local neighborhood of selected features.

This function is similar to random_affine_transformation(), but applies multiple random affine transformations to a spatially constraint local neighborhood.


ds : Dataset

The to be transformed/distorted dataset.

distort_seeds : list(int)

This a sequence of feature ids (corresponding to the input dataset) that serve as anchor to determine the local neighborhood for a distortion. The number of seeds also determines the number of different local distortions that are going to be applied.

distort_neighbor : callable

And object that when called with a coordinate generates a sequence of coordinates that comprise its neighborhood (see e.g. Sphere()).

space : str

Name of the feature attribute of the input dataset that contains the relevant feature coordinates (e.g. ‘voxel_indices’).

scale_fac : float

See random_affine_transformation()

shift_fac : float

See random_affine_transformation()



A dataset derived from the input dataset with added local distortions.