Skip to content

Commit d23acb3

Browse files
committed
BUG: Update vedo notebook for package name change from vtkplotter
1 parent f55c139 commit d23acb3

File tree

3 files changed

+168
-77
lines changed

3 files changed

+168
-77
lines changed

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Interactive Jupyter_ widgets to visualize images, point sets, and meshes on the
4949
- `Dask array <https://docs.dask.org/en/latest/array.html>`_ images
5050
- `vtk.vtkImageData <https://vtk.org>`_
5151
- `pyvista.UniformGrid <https://pyvista.org>`_
52-
- `vtkplotter.Volume <https://vtkplotter.embl.es/index.html>`_
52+
- `vedo.Volume <https://vedo.embl.es/index.html>`_
5353
- `pyimagej ImageJ / Fiji / ImageJ2 images <https://github.com/imagej/pyimagej>`_
5454
- Additional NumPy array-like objects
5555
- `SimpleITK.Image <https://simpleitk-prototype.readthedocs.io/en/latest/user_guide/plot_image.html#sphx-glr-user-guide-plot-image-py>`_
@@ -71,8 +71,8 @@ Interactive Jupyter_ widgets to visualize images, point sets, and meshes on the
7171
- `pyvista.PolyData <https://docs.pyvista.org/core/points.html>`_
7272
- `pyvista.StructuredGrid <https://docs.pyvista.org/core/point-grids.html#structured-grid-creation>`_
7373
- `pyvista.UnstructuredGrid <https://docs.pyvista.org/core/point-grids.html#unstructured-grid-creation>`_
74-
- `vtkplotter.Actor <https://vtkplotter.embl.es/index.html>`_
75-
- `vtkplotter.Assembly <https://vtkplotter.embl.es/index.html>`_
74+
- `vedo.Actor <https://vedo.embl.es/index.html>`_
75+
- `vedo.Assembly <https://vedo.embl.es/index.html>`_
7676
- `skan.csr.Skeleton <https://jni.github.io/skan/api/skan.csr.html#module-skan.csr>`_
7777

7878
- Exquisite volume rendering
@@ -285,7 +285,7 @@ After installation, try the following examples that demonstrate how to visualize
285285
- `pyvista StructuredGrid <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/pyvista.StructuredGrid.ipynb>`_
286286
- `pyvista UnstructuredGrid <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/pyvista.UnstructuredGrid.ipynb>`_
287287
- `pyvista LiDAR <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/pyvistaLiDAR.ipynb>`_
288-
- `vtkplotter actors and volumes <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/vtkplotter.ipynb>`_
288+
- `vedo actors and volumes <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/vedo.ipynb>`_
289289
- `skan segmentation skeleton <https://github.com/InsightSoftwareConsortium/itkwidgets/blob/master/examples/SegmentationSkeleton.ipynb>`_
290290

291291
or how to:

examples/vedo.ipynb

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"name": "stdout",
10+
"output_type": "stream",
11+
"text": [
12+
"Collecting vedo\n",
13+
" Downloading vedo-2021.0.3.tar.gz (9.3 MB)\n",
14+
"\u001b[K |████████████████████████████████| 9.3 MB 7.0 MB/s eta 0:00:01\n",
15+
"\u001b[?25hRequirement already satisfied: vtk in /home/matt/bin/miniconda/envs/itkwidgets/lib/python3.8/site-packages (from vedo) (9.0.1)\n",
16+
"Requirement already satisfied: numpy in /home/matt/bin/miniconda/envs/itkwidgets/lib/python3.8/site-packages (from vedo) (1.20.2)\n",
17+
"Building wheels for collected packages: vedo\n",
18+
" Building wheel for vedo (setup.py) ... \u001b[?25ldone\n",
19+
"\u001b[?25h Created wheel for vedo: filename=vedo-2021.0.3-py3-none-any.whl size=9384218 sha256=a1d8ecc77dc48f4c4584c09d436170d04fd291ce4f864bb60ed6a9514b6ace30\n",
20+
" Stored in directory: /home/matt/.cache/pip/wheels/9c/6f/7c/c8f69d87d6f20bfd65e4af01498ac78836e12308ee46cbad58\n",
21+
"Successfully built vedo\n",
22+
"Installing collected packages: vedo\n",
23+
"Successfully installed vedo-2021.0.3\n"
24+
]
25+
}
26+
],
27+
"source": [
28+
"# Note: This example currently does not work in MyBinder.\n",
29+
"\n",
30+
"# Install dependencies for this example\n",
31+
"# Note: This does not include itkwidgets, itself\n",
32+
"import sys\n",
33+
"!{sys.executable} -m pip install -U vedo"
34+
]
35+
},
36+
{
37+
"cell_type": "code",
38+
"execution_count": 3,
39+
"metadata": {},
40+
"outputs": [
41+
{
42+
"name": "stdout",
43+
"output_type": "stream",
44+
"text": [
45+
"embedWindow(verbose=True): could not load ipyvtk_simple try:\n",
46+
"> pip install -U git+https://github.com/Kitware/ipyvtk-simple.git\n"
47+
]
48+
},
49+
{
50+
"data": {
51+
"text/plain": [
52+
"(Sphere)0x7f185a66fc40"
53+
]
54+
},
55+
"execution_count": 3,
56+
"metadata": {},
57+
"output_type": "execute_result"
58+
}
59+
],
60+
"source": [
61+
"from vedo import load, datadir, Sphere\n",
62+
"from itkwidgets import view\n",
63+
"\n",
64+
"embryo = load(datadir+'embryo.slc')\n",
65+
"\n",
66+
"sph = Sphere(r=50).pos(10,20,30)\n",
67+
"scals = sph.points()[:,2] # scalars are z coords\n",
68+
"sph.pointColors(scals)"
69+
]
70+
},
71+
{
72+
"cell_type": "code",
73+
"execution_count": 4,
74+
"metadata": {},
75+
"outputs": [
76+
{
77+
"name": "stdout",
78+
"output_type": "stream",
79+
"text": [
80+
"\u001b[34;1m_________________________________________________________________\u001b[0m\n",
81+
"\u001b[7m\u001b[1m\u001b[34;1mVolume\u001b[0m\n",
82+
"\u001b[1m\u001b[34;1m position: \u001b[0m\u001b[34;1m(0.0, 0.0, 0.0)\u001b[0m\n",
83+
"\u001b[1m\u001b[34;1m dimensions: \u001b[0m\u001b[34;1m(256, 256, 256)\u001b[0m\n",
84+
"\u001b[1m\u001b[34;1m spacing: \u001b[0m\u001b[34;1m(1.0, 1.0, 1.0)\u001b[0m\n",
85+
"\u001b[1m\u001b[34;1m data dimension: \u001b[0m\u001b[34;1m3\u001b[0m\n",
86+
"\u001b[1m\u001b[34;1m memory size: \u001b[0m\u001b[34;1m16 MB\u001b[0m\n",
87+
"\u001b[1m\u001b[34;1m scalar #bytes: \u001b[0m\u001b[34;1m1\u001b[0m\n",
88+
"\u001b[1m\u001b[34;1m bounds: \u001b[0m\u001b[34;1mx=(0, 255)\u001b[0m\u001b[34;1m y=(0, 255)\u001b[0m\u001b[34;1m z=(0, 255)\u001b[0m\n",
89+
"\u001b[1m\u001b[34;1m scalar range: \u001b[0m\u001b[34;1m(0.0, 197.0)\u001b[0m\n",
90+
"\u001b[34;1m(logscale) Histogram\t(entries=100000)\n",
91+
" 4.97\n",
92+
"0.00 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
93+
"23.12 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
94+
"46.25 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
95+
"69.38 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
96+
"92.50 | ▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆\n",
97+
"115.62| ▆▆▆▆▆▆▆▆▆▆▆▆\n",
98+
"138.75| ▆▆▆▆▆▆▆\n",
99+
"161.88| ▆▆\n",
100+
"\u001b[0m\n"
101+
]
102+
},
103+
{
104+
"data": {
105+
"text/plain": [
106+
"(Volume)0x7f185a66f9a0"
107+
]
108+
},
109+
"execution_count": 4,
110+
"metadata": {},
111+
"output_type": "execute_result"
112+
}
113+
],
114+
"source": [
115+
"embryo.printInfo()"
116+
]
117+
},
118+
{
119+
"cell_type": "code",
120+
"execution_count": 5,
121+
"metadata": {},
122+
"outputs": [
123+
{
124+
"data": {
125+
"application/vnd.jupyter.widget-view+json": {
126+
"model_id": "a29de347ee554ab5a2dbd5225f5a12d4",
127+
"version_major": 2,
128+
"version_minor": 0
129+
},
130+
"text/plain": [
131+
"Viewer(geometries=[{'vtkClass': 'vtkPolyData', 'points': {'vtkClass': 'vtkPoints', 'name': '_points', 'numberO…"
132+
]
133+
},
134+
"metadata": {},
135+
"output_type": "display_data"
136+
}
137+
],
138+
"source": [
139+
"view(actors=[embryo, sph])"
140+
]
141+
}
142+
],
143+
"metadata": {
144+
"kernelspec": {
145+
"display_name": "Python 3",
146+
"language": "python",
147+
"name": "python3"
148+
},
149+
"language_info": {
150+
"codemirror_mode": {
151+
"name": "ipython",
152+
"version": 3
153+
},
154+
"file_extension": ".py",
155+
"mimetype": "text/x-python",
156+
"name": "python",
157+
"nbconvert_exporter": "python",
158+
"pygments_lexer": "ipython3",
159+
"version": "3.8.8"
160+
}
161+
},
162+
"nbformat": 4,
163+
"nbformat_minor": 4
164+
}

examples/vtkplotter.ipynb

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)