Get a hypercube neighborhood at a voxel. Get the values in a local 
    neighborhood of an image.
    
    ANTsR function: `getNeighborhoodAtVoxel`

    Arguments
    ---------
    image : ANTsImage
        image to get values from.
    
    center : tuple/list
        indices for neighborhood center
    
    kernel : tuple/list
        either a collection of values for neighborhood radius (in voxels) or 
        a binary collection of the same dimension as the image, specifying the shape of the neighborhood to extract
    
    physical_coordinates : boolean
        whether voxel indices and offsets should be in voxel 
        or physical coordinates

    Returns
    -------
    dictionary w/ following key-value pairs:
        values : ndarray
            array of neighborhood values at the voxel

        indices : ndarray
            matrix providing the coordinates for each value

    Example
    -------
    >>> import ants
    >>> img = ants.image_read(ants.get_ants_data('r16'))
    >>> center = (2,2)
    >>> radius = (3,3)
    >>> retval = ants.get_neighborhood_at_voxel(img, center, radius)

def get_neighborhood_at_voxel(image, center, kernel, physical_coordinates=False):
    """
    Get a hypercube neighborhood at a voxel. Get the values in a local 
    neighborhood of an image.
    
    ANTsR function: `getNeighborhoodAtVoxel`

    Arguments
    ---------
    image : ANTsImage
        image to get values from.
    
    center : tuple/list
        indices for neighborhood center
    
    kernel : tuple/list
        either a collection of values for neighborhood radius (in voxels) or 
        a binary collection of the same dimension as the image, specifying the shape of the neighborhood to extract
    
    physical_coordinates : boolean
        whether voxel indices and offsets should be in voxel 
        or physical coordinates

    Returns
    -------
    dictionary w/ following key-value pairs:
        values : ndarray
            array of neighborhood values at the voxel

        indices : ndarray
            matrix providing the coordinates for each value

    Example
    -------
    >>> import ants
    >>> img = ants.image_read(ants.get_ants_data('r16'))
    >>> center = (2,2)
    >>> radius = (3,3)
    >>> retval = ants.get_neighborhood_at_voxel(img, center, radius)
    """
    if not isinstance(image, iio.ANTsImage):
        raise ValueError('image must be ANTsImage type')

    if (not isinstance(center, (tuple,list))) or (len(center) != image.dimension):
        raise ValueError('center must be tuple or list with length == image.dimension')

    if (not isinstance(kernel, (tuple,list))) or (len(kernel) != image.dimension):
        raise ValueError('kernel must be tuple or list with length == image.dimension')

    radius = [int((k-1)/2) for k in kernel]

    libfn = utils.get_lib_fn('getNeighborhood%s' % image._libsuffix)
    retvals = libfn(image.pointer, 
                    list(center), 
                    list(kernel), 
                    list(radius), 
                    int(physical_coordinates))
    for k in retvals.keys():
        retvals[k] = np.asarray(retvals[k])
    return retvals