Skip to content

Commit

Permalink
example loading ibw
Browse files Browse the repository at this point in the history
  • Loading branch information
SylviaWhittle committed Apr 23, 2024
1 parent 8001728 commit 8ba1248
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/example_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,47 @@
"source": [
"create_animation(file_name=\"sample_0\", frames=frames)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# IBW Files"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Import the load_ibw function from topofileformats\n",
"from topofileformats.ibw import load_ibw"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Load the IBW file as an image and pixel to nm scaling factor\n",
"FILE = \"../tests/resources/sample_0.ibw\"\n",
"image, pixel_to_nm_scaling = load_ibw(file_path=FILE, channel=\"sHeightTracee\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Plot the image\n",
"import matplotlib.pyplot as plt\n",
"\n",
"plt.imshow(image, cmap=\"afmhot\")\n",
"plt.show()"
]
}
],
"metadata": {
Expand Down

0 comments on commit 8ba1248

Please sign in to comment.