IBW Modules
For decoding and loading .ibw AFM file format into Python Numpy arrays.
get_ibw_channels(file_path: Path | str) -> list[str]
Extract a list of available channels and their corresponding dictionary key ids from the .ibw file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path or str
|
Path to the .ibw file. |
required |
Returns:
| Type | Description |
|---|---|
list
|
List of available channels. |
Source code in AFMReader/ibw.py
load_ibw(file_path: Path | str, channel: str) -> AFMScan
Load image from Asylum Research (Igor) .ibw files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path | str
|
Path to the .ibw file. |
required |
channel
|
str
|
The channel to extract from the .ibw file. |
required |
Returns:
| Type | Description |
|---|---|
AFMScan
|
An AFMScan object containing the image, its pixel to nanometre scaling value, and z-axis units. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file is not found. |
ValueError
|
If the channel is not found in the .ibw file. |
Examples:
Load the image and pixel to nanometre scaling factor - 'HeightTracee' is the default channel name (the extra 'e' is not a typo!).
>>> from AFMReader.ibw import load_ibw
>>> afm_scan = load_ibw(file_path="./my_ibw_file.ibw", channel="HeightTracee")
>>> image = afm_scan.image
>>> pixel_to_nanometre_scaling_factor = afm_scan.pixel_to_nanometre_scaling
>>> z_units = afm_scan.z_units