我必须绘制大脑区域的连接网络。我想获得类似于图 1的东西。
我能够将点放在 3D 空间中,并通过使用 python 和 mayavi 将它们与边缘链接。代码在这里:
import mayavi
# get data
xyz = getCoords(file_coords)
communities = getCommunities(file_communities)
mlab.figure(1, bgcolor=(0, 0, 0))
mlab.clf()
# plot points
pts = mlab.points3d(xyz[:,0], xyz[:,1], xyz[:,2],
communities,
colormap= "Blues",
scale_factor=7,
resolution=50)
# plot edges
pts.mlab_source.dataset.lines = np.array(list_of_edges)
tube = mlab.pipeline.tube(pts, tube_radius=0.1)
mlab.pipeline.surface(tube, color=(0.5, 0.5, 0.5))
mlab.show()
您可以在此处查看代码的输出,如图 2 所示:
如何创建 3D 大脑渲染以获得类似于图 1的内容: