TopoStats Modules
For decoding and loading .topostats (HDF5 format) AFM file format into Python Nympy arrays.
get_topostats_channels() -> list[str]
Get the available channels for a .topostats file.
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of available channels in the .topostats file. |
load_topostats(file_path: Path | str, channel: str) -> AFMScan
Extract image and pixel to nm scaling from the .topostats (HDF5 format) file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path | str
|
Path to the .topostats file. |
required |
channel
|
str
|
The channel to load. |
required |
Returns:
| Type | Description |
|---|---|
AFMScan
|
An AFMScan object containing the image, its pixel to nm scaling factor, and nested Numpy arrays representing the analyses performed on the data. |
Raises:
| Type | Description |
|---|---|
OSError
|
If the file is not found. |
Examples:
>>> afm_scan = load_topostats("path/to/topostats_file.topostats", channel="image")
>>> image = afm_scan.image
>>> pixel_to_nm_scaling = afm_scan.pixel_to_nanometre_scaling