Skip to content

Commit a1a255a

Browse files
authored
Merge pull request #18 from thewtex/notebook
DOC: Add Jupyter notebook example
2 parents f5ba3f4 + 9bb34f8 commit a1a255a

4 files changed

+68
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@
3333

3434
# Cleaver Repository
3535
Cleaver2
36+
examples/.ipynb_checkpoints/
37+
examples/triangle_mesh.vtk
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "b7bb9849",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import itk"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 2,
16+
"id": "0f6fd33b",
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"image = itk.imread('./mickey.nrrd')"
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": 3,
26+
"id": "893f7367",
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"tet_mesh, triangle_mesh = itk.cleaver_image_to_mesh_filter(image)"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": 4,
36+
"id": "a17510da",
37+
"metadata": {},
38+
"outputs": [],
39+
"source": [
40+
"itk.meshwrite(triangle_mesh, './triangle_mesh.vtk')"
41+
]
42+
}
43+
],
44+
"metadata": {
45+
"kernelspec": {
46+
"display_name": "Python 3 (ipykernel)",
47+
"language": "python",
48+
"name": "python3"
49+
},
50+
"language_info": {
51+
"codemirror_mode": {
52+
"name": "ipython",
53+
"version": 3
54+
},
55+
"file_extension": ".py",
56+
"mimetype": "text/x-python",
57+
"name": "python",
58+
"nbconvert_exporter": "python",
59+
"pygments_lexer": "ipython3",
60+
"version": "3.9.10"
61+
}
62+
},
63+
"nbformat": 4,
64+
"nbformat_minor": 5
65+
}

examples/mickey.nrrd

489 KB
Binary file not shown.

examples/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
itk-cleaver

0 commit comments

Comments
 (0)