Skip to content

Commit c715de6

Browse files
committed
ENH: Add basic point set example notebook
1 parent b4d8c44 commit c715de6

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

examples/NumPyArrayPointSet.ipynb

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "492c7f7a-b291-4f01-9c85-9fea9da52fcc",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import sys\n",
11+
"!{sys.executable} -m pip install -q --pre itkwidgets"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": null,
17+
"id": "ee6c9cad-31f9-4adc-8740-6bb2103ade97",
18+
"metadata": {},
19+
"outputs": [],
20+
"source": [
21+
"import numpy as np\n",
22+
"from itkwidgets import view"
23+
]
24+
},
25+
{
26+
"cell_type": "code",
27+
"execution_count": null,
28+
"id": "684615f0-f389-460f-8de6-6e3fc986d022",
29+
"metadata": {},
30+
"outputs": [],
31+
"source": [
32+
"number_of_points = 3000\n",
33+
"gaussian_mean = [0.0, 0.0, 0.0]\n",
34+
"gaussian_cov = [[1.0, 0.0, 0.0], [0.0, 2.0, 0.0], [0.0, 0.0, 0.5]]\n",
35+
"point_set = np.random.multivariate_normal(gaussian_mean, gaussian_cov, number_of_points)"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": null,
41+
"id": "7571e8e2-5b3e-4204-9934-d30472e2f427",
42+
"metadata": {},
43+
"outputs": [],
44+
"source": [
45+
"view(point_sets=point_set)"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": null,
51+
"id": "4f8a0ef9-68fb-44f0-bd6d-7ad31615ee06",
52+
"metadata": {},
53+
"outputs": [],
54+
"source": []
55+
}
56+
],
57+
"metadata": {
58+
"kernelspec": {
59+
"display_name": "Python 3 (ipykernel)",
60+
"language": "python",
61+
"name": "python3"
62+
},
63+
"language_info": {
64+
"codemirror_mode": {
65+
"name": "ipython",
66+
"version": 3
67+
},
68+
"file_extension": ".py",
69+
"mimetype": "text/x-python",
70+
"name": "python",
71+
"nbconvert_exporter": "python",
72+
"pygments_lexer": "ipython3",
73+
"version": "3.8.10"
74+
}
75+
},
76+
"nbformat": 4,
77+
"nbformat_minor": 5
78+
}

0 commit comments

Comments
 (0)