def slice_data(data, sub, block, subcond=None):
    """ pull symmetric matrix from data block (4D or 5D)
    
    Parameters
    ----------
    data : numpy array
        4D array (block, sub, nnode, nnode)
        5D array (subcond, block, sub, nnode, nnode)
    sub : int
        int representing subject to index in data
    block : int
        int representing block to index in data
    subcond : int
        int representing optional subcondition from 5D array

    Returns
    -------
    adjacency_matrix : numpy array
        symmetric numpy array (innode, nnode)
    """
    if subcond is None:
        return data[block, sub]
    return data[subcond, block, sub]