brainiak.searchlight package

Distributed Searchlight

Submodules

brainiak.searchlight.searchlight module

class brainiak.searchlight.searchlight.Searchlight(sl_rad=1, max_blk_edge=10)

Bases: object

Distributed Searchlight

Run a user-defined function over each voxel in a multi-subject dataset.

Optionally, users can define a block function which runs over larger portions of the volume called blocks.

broadcast(bcast_var)

Distribute data to processes

Parameters:bcast_var (shared data which is broadcast to all processes) –
distribute(subjects, mask)

Distribute data to MPI ranks

Parameters:
  • subjects (list of 4D arrays containing data for one or more subjects.) –

    Each entry of the list must be present on at most one rank, and the other ranks contain a “None” at this list location.

    For example, for 3 ranks you may lay out the data in the following manner:

    Rank 0: [Subj0, None, None] Rank 1: [None, Subj1, None] Rank 2: [None, None, Subj2]

    Or alternatively, you may lay out the data in this manner:

    Rank 0: [Subj0, Subj1, Subj2] Rank 1: [None, None, None] Rank 2: [None, None, None]

  • mask (3D array with "True" entries at active vertices) –
run_block_function(block_fn)

Perform a function for each block in a volume.

Parameters:block_fn

Parameters

data: list of 4D arrays containing subset of subject data,
which is padded with sl_rad voxels.

mask: 3D array containing subset of mask data

sl_rad: radius, in voxels, of the sphere inscribed in the cube

bcast_var: shared data which is broadcast to all processes

run_searchlight(voxel_fn, pool_size=None)

Perform a function at each active voxel

Parameters:voxel_fn

Parameters

subj: list of 4D arrays containing subset of subject data

mask: 3D array containing subset of mask data

sl_rad: radius, in voxels, of the sphere inscribed in the cube

bcast_var: shared data which is broadcast to all processes

pool_size: Number of parallel processes in shared memory
process pool