neurosynth/base/imageutils.py
def map_peaks_to_image(peaks, r=4, vox_dims=(2, 2, 2), dims=(91, 109, 91),
                       header=None):
    """ Take a set of discrete foci (i.e., 2-D array of xyz coordinates)
    and generate a corresponding image, convolving each focus with a
    hard sphere of radius r."""
    data = np.zeros(dims)
    for p in peaks:
        valid = get_sphere(p, r, vox_dims, dims)
        valid = valid[:, ::-1]
        data[tuple(valid.T)] = 1
    return nifti1.Nifti1Image(data, None, header=header)
def map_peaks_to_image(peaks, r=4, vox_dims=(2, 2, 2), dims=(91, 109, 91),
                       header=None):
    """ Take a set of discrete foci (i.e., 2-D array of xyz coordinates)
    and generate a corresponding image, convolving each focus with a
    hard sphere of radius r."""
    data = np.zeros(dims)
    for p in peaks:
        valid = get_sphere(p, r, vox_dims, dims)
        valid = valid[:, ::-1]
        data[tuple(valid.T)] = 1
    return nifti1.Nifti1Image(data, None, header=header)
def map_peaks_to_image ( peaks , r = 4 , vox_dims = ( 2 , 2 , 2 ) , dims = ( 91 , 109 , 91 ) , header = None ) : data = np . zeros ( dims ) for p in peaks : valid = get_sphere ( p , r , vox_dims , dims ) valid = valid [ : , : : - 1 ] data [ tuple ( valid . T ) ] = 1 return nifti1 . Nifti1Image ( data , None , header = header )
Take a set of discrete foci (i.e., 2-D array of xyz coordinates)
    and generate a corresponding image, convolving each focus with a
    hard sphere of radius r.
Take a set of discrete foci ( i . e . 2 - D array of xyz coordinates ) and generate a corresponding image convolving each focus with a hard sphere of radius r .