scenes.py 文件源码

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

项目:pyconnectome 作者: neurospin 项目源码 文件源码
def field_directions(field):
    """ Scene the shows the directions of a vector field.

    Parameters
    ----------
    field: array (X, Y, N, 3)
        the vector field to plot where N is the number of peaks.

    Returns
    ----------
    actors: list of vtkActor
        the scene actors.
    """
    actors = []
    for x in range(field.shape[0]):
        for y in range(field.shape[1]):
            line = numpy.zeros((2, 3), dtype=numpy.single)
            for vector in field[x, y]:
                line[1] = vector
                actors.append(pvtk.line(line, 0, linewidth=2))
                actors[-1].SetPosition((x, y, 0))
    return actors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号