Skip to content

Commit 8ba1248

Browse files
committed
example loading ibw
1 parent 8001728 commit 8ba1248

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

examples/example_01.ipynb

+41
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,47 @@
2727
"source": [
2828
"create_animation(file_name=\"sample_0\", frames=frames)"
2929
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {},
34+
"source": [
35+
"# IBW Files"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": null,
41+
"metadata": {},
42+
"outputs": [],
43+
"source": [
44+
"# Import the load_ibw function from topofileformats\n",
45+
"from topofileformats.ibw import load_ibw"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": null,
51+
"metadata": {},
52+
"outputs": [],
53+
"source": [
54+
"# Load the IBW file as an image and pixel to nm scaling factor\n",
55+
"FILE = \"../tests/resources/sample_0.ibw\"\n",
56+
"image, pixel_to_nm_scaling = load_ibw(file_path=FILE, channel=\"sHeightTracee\")"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"metadata": {},
63+
"outputs": [],
64+
"source": [
65+
"# Plot the image\n",
66+
"import matplotlib.pyplot as plt\n",
67+
"\n",
68+
"plt.imshow(image, cmap=\"afmhot\")\n",
69+
"plt.show()"
70+
]
3071
}
3172
],
3273
"metadata": {

0 commit comments

Comments
 (0)