File: point_cloud.py

package info (click to toggle)
napari 0.6.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,036 kB
  • sloc: python: 112,264; xml: 72; makefile: 44; sh: 5
file content (25 lines) | stat: -rw-r--r-- 515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
Point cloud
===========

Display 3D points with combinations of different renderings.

.. tags:: visualization-basic
"""

import numpy as np

import napari

n_points = 100

points = np.random.normal(10, 100, (n_points, 3))
symbols = np.random.choice(['o', 's', '*'], n_points)
sizes = np.random.rand(n_points) * 10 + 10
colors = np.random.rand(n_points, 3)

viewer = napari.Viewer(ndisplay=3)
viewer.add_points(points, symbol=symbols, size=sizes, face_color=colors)

if __name__ == '__main__':
    napari.run()