Skip to content

Commit 7847443

Browse files
committed
DOC: Add JupyterLite Hello3DWorld example
1 parent 08f4f95 commit 7847443

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist/
33
Untitled.ipynb
44
examples/integrations/itk/005_32months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd
55
docs/_*
6+
docs/.jupyterlite.doit.db

docs/files/Hello3DWorld.ipynb

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"metadata": {
3+
"kernelspec": {
4+
"name": "python",
5+
"display_name": "Python (Pyodide)",
6+
"language": "python"
7+
},
8+
"language_info": {
9+
"codemirror_mode": {
10+
"name": "python",
11+
"version": 3
12+
},
13+
"file_extension": ".py",
14+
"mimetype": "text/x-python",
15+
"name": "python",
16+
"nbconvert_exporter": "python",
17+
"pygments_lexer": "ipython3",
18+
"version": "3.8"
19+
}
20+
},
21+
"nbformat_minor": 5,
22+
"nbformat": 4,
23+
"cells": [
24+
{
25+
"cell_type": "code",
26+
"source": "import piplite\nawait piplite.install('itkwidgets==1.0a5')",
27+
"metadata": {
28+
"trusted": true
29+
},
30+
"execution_count": 2,
31+
"outputs": [],
32+
"id": "e95388a9-93a6-4e29-bf44-e57a5c5683ab"
33+
},
34+
{
35+
"cell_type": "code",
36+
"source": "from itkwidgets import view\nimport imageio.v2 as imageio",
37+
"metadata": {
38+
"trusted": true
39+
},
40+
"execution_count": 3,
41+
"outputs": [],
42+
"id": "c3c5eb6e"
43+
},
44+
{
45+
"cell_type": "code",
46+
"source": "stent = imageio.imread('imageio:stent.npz')",
47+
"metadata": {
48+
"trusted": true
49+
},
50+
"execution_count": 4,
51+
"outputs": [],
52+
"id": "1bc45207"
53+
},
54+
{
55+
"cell_type": "code",
56+
"source": "viewer = view(stent, rotate=True)\nviewer",
57+
"metadata": {
58+
"trusted": true
59+
},
60+
"execution_count": 5,
61+
"outputs": [
62+
{
63+
"output_type": "display_data",
64+
"data": {
65+
"text/plain": "<IPython.core.display.Javascript object>",
66+
"application/javascript": "window.connectPlugin && window.connectPlugin(\"cabe680b-467f-411c-9d18-4af39bd42818\")"
67+
},
68+
"metadata": {}
69+
},
70+
{
71+
"output_type": "display_data",
72+
"data": {
73+
"text/plain": "<IPython.core.display.HTML object>",
74+
"text/html": "<div id=\"28428cf3-8ce6-4b09-bfcb-19c6345f165e\"></div>"
75+
},
76+
"metadata": {}
77+
},
78+
{
79+
"execution_count": 5,
80+
"output_type": "execute_result",
81+
"data": {
82+
"text/plain": "<itkwidgets.viewer.Viewer at 0x24e0c60>"
83+
},
84+
"metadata": {}
85+
}
86+
],
87+
"id": "26582452"
88+
},
89+
{
90+
"cell_type": "code",
91+
"source": "viewer.set_image_gradient_opacity(0.4)",
92+
"metadata": {
93+
"trusted": true
94+
},
95+
"execution_count": 7,
96+
"outputs": [],
97+
"id": "5ffa3b37-ae13-4c5d-93e1-64d36c99b196"
98+
},
99+
{
100+
"cell_type": "code",
101+
"source": "",
102+
"metadata": {},
103+
"execution_count": null,
104+
"outputs": [],
105+
"id": "9ac0de0c-7693-4a72-871b-0f7a9c4b2739"
106+
}
107+
]
108+
}

0 commit comments

Comments
 (0)