roi_cache.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Waskom_PNAS_2017 作者: WagnerLabPapers 项目源码 文件源码
def create_3D_distance_matrix(vox_ijk, epi_fname):
    """Compute distance between voxels in the volume.

    Parameters
    ----------
    vox_ijk : n x 3 array
        Indices of voxels included in the ROI.
    epi_fname : file path
        Path to image defining the volume space.

    Returns
    -------
    dmat : array
        Dense square distance matrix.

    """
    aff = nib.load(epi_fname).affine
    vox_ras = nib.affines.apply_affine(aff, vox_ijk)
    dmat = squareform(pdist(vox_ras))

    return dmat
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号