{"id":23069135,"url":"https://github.com/afm-spm/afmreader","last_synced_at":"2025-10-16T11:56:35.062Z","repository":{"id":196560725,"uuid":"693884732","full_name":"AFM-SPM/AFMReader","owner":"AFM-SPM","description":"A library for loading various atomic force microscopy file formats.","archived":false,"fork":false,"pushed_at":"2025-09-22T21:26:10.000Z","size":71402,"stargazers_count":17,"open_issues_count":12,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-22T23:30:25.263Z","etag":null,"topics":["afm","atomic-force-microscopy","io"],"latest_commit_sha":null,"homepage":"https://afm-spm.github.io/AFMReader/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AFM-SPM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-19T23:00:51.000Z","updated_at":"2025-09-12T10:50:06.000Z","dependencies_parsed_at":"2025-09-01T22:29:15.093Z","dependency_job_id":null,"html_url":"https://github.com/AFM-SPM/AFMReader","commit_stats":null,"previous_names":["afm-spm/topofileformats","afm-spm/afmreader"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/AFM-SPM/AFMReader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFM-SPM%2FAFMReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFM-SPM%2FAFMReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFM-SPM%2FAFMReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFM-SPM%2FAFMReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AFM-SPM","download_url":"https://codeload.github.com/AFM-SPM/AFMReader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AFM-SPM%2FAFMReader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279187376,"owners_count":26122254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["afm","atomic-force-microscopy","io"],"created_at":"2024-12-16T06:13:31.453Z","updated_at":"2025-10-16T11:56:35.056Z","avatar_url":"https://github.com/AFM-SPM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AFMReader\n\n\u003cdiv align=\"center\"\u003e\n\n[![PyPI version](https://badge.fury.io/py/AFMReader.svg)](https://badge.fury.io/py/AFMReader)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/AFMReader)\n[![Code style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Code style: flake8](https://img.shields.io/badge/code%20style-flake8-456789.svg)](https://github.com/psf/flake8)\n\u003c!-- [![codecov](https://codecov.io/gh/AFM-SPM/AFMReader/branch/dev/graph/badge.svg)]\n(https://codecov.io/gh/AFM-SPM/AFMReader) --\u003e\n[![pre-commit.ci\nstatus](https://results.pre-commit.ci/badge/github/AFM-SPM/AFMReader/main.svg)](https://results.pre-commit.ci/latest/github/AFM-SPM/AFMReader/main)\n[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow)](https://fair-software.eu)\n\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\n[![Downloads](https://static.pepy.tech/badge/afmreader)](https://pepy.tech/project/afmreader)\n[![Downloads](https://static.pepy.tech/badge/afmreader/month)](https://pepy.tech/project/afmreader)\n[![Downloads](https://static.pepy.tech/badge/afmreader/week)](https://pepy.tech/project/afmreader)\n\n\u003c/div\u003e\n\nA library for loading various Atomic Force Microscopy (AFM) file formats into Python. This library is primarily intended\nfor use with [TopoStats](https://github.com/AFM-SPM/TopoStats).\n\nSupported file formats\n\n| File format     | Description                                       |\n|-----------------|---------------------------------------------------|\n| `.asd`          | High-speed AFM                                    |\n| `.gwy`          | [Gwydion](\u003chttp://gwyddion.net\u003e)                  |\n| `.h5-jpk`       | [Bruker](https://www.bruker.com/)                 |\n| `.ibw`          | [WaveMetrics](https://www.wavemetrics.com/)       |\n| `.jpk-qi-image` | [Bruker](https://www.bruker.com/)                 |\n| `.jpk`          | [Bruker](https://www.bruker.com/)                 |\n| `.spm`          | [Bruker's Format](https://www.bruker.com/)        |\n| `.stp`          | [WSXM AFM software files](http://www.wsxm.eu)     |\n| `.top`          | `.stp` variant                                    |\n| `.topostats`    | [TopoStats](https://github.com/AFM-SPM/TopoStats) |\n\nSupport for the following additional formats is planned. Some of these are already supported in TopoStats and are\nawaiting refactoring to move their functionality into AFMReader these are denoted in bold below.\n\n| File format | Description                                             | Status                                     |\n|-------------|---------------------------------------------------------|--------------------------------------------|\n| `.nhf`      | [Nanosurf](https://www.nanosurf.com/en/)                | To Be Implemented.                         |\n| `.aris`     | [Imaris Oxford Instruments](https://imaris.oxinst.com/) | To Be Implemented.                         |\n| `.tiff`     | [Park Systems](https://www.parksystems.com/)            | To Be Implemented.                         |\n\n## Usage\n\nIf you wish to process AFM images supported by `AFMReader` it is recommend you use\n[TopoStats](https://github.com/AFM-SPM/TopoStats) to do so, however the library can be used on its own.\n\n### .topostats\n\nYou can open `.topostats` files using the `load_topostats` function. Just pass in the path to the file.\n\n```python\nfrom AFMReader.topostats import load_topostats\n\nimage, pixel_to_nanometre_scaling_factor, metadata = load_topostats(file_path=\"./my_topostats_file.topostats\")\n```\n\n### .spm\n\nYou can open `.spm` files using the `load_spm` function. Just pass in the path to the file and the\nchannel name that you want to use. (If in doubt use one of the following: \"Height\", \"ZSensor\",\n\"Height Sensor\").\n\n```python\nfrom AFMReader.spm import load_spm\n\nimage, pixel_to_nanometre_scaling_factor = load_spm(file_path=\"./my_spm_file.spm\", channel=\"Height\")\n```\n\n### .gwy\n\nYou can open `.gwy` files using the `load_gwy` function. Just pass in the path to the file and the\nchannel name that you want to use. (If in doubt use one one of the following: \"Height\", \"ZSensor\",\n\"Height Sensor\").\n\n```python\nfrom AFMReader.gwy import load_gwy\n\nimage, pixel_to_nanometre_scaling_factor = load_gwy(file_path=\"./my_gwy_file.gwy\", channel=\"Height\")\n```\n\n### .asd\n\nYou can open `.asd` files using the `load_asd` function. Just pass in the path to the file and the channel name that you\nwant to use. (If in doubt use the `\"TP\"` topography channel).\n\nNote: For `.asd` files, there seem to only ever be two channels in one file. `\"TP\"` (topography) is the main one you\nwill want to use unless you know you specifically want something else.\n\nOther channels: `\"ER\"` - Error, `\"PH\"` - Phase\n\n```python\nfrom AFMReader.asd import load_asd\n\nframes, pixel_to_nanometre_scaling_factor, metadata = load_asd(file_path=\"./my_asd_file.asd\", channel=\"TP\")\n```\n\n### .ibw\n\nYou can open `.ibw` files using the `load_ibw` function. Just pass in the path to the file\nand the channel name that you want to use. (If in doubt, use `HeightTracee` (yes, with the\nextra 'e'), `ZSensorTrace`, or `ZSensor`).\n\n```python\nfrom AFMReader.ibw import load_ibw\n\nimage, pixel_to_nanometre_scaling_factor = load_ibw(file_path=\"./my_ibw_file.ibw\", channel=\"HeightTracee\")\n```\n\n### .jpk\n\nYou can open `.jpk` files using the `load_jpk` function. Just pass in the path\nto the file and the channel name you want to use. (If in doubt, use `height_trace` or `measuredHeight_trace`).\n\n```python\nfrom AFMReader.jpk import load_jpk\n\nimage, pixel_to_nanometre_scaling_factor = load_jpk(file_path=\"./my_jpk_file.jpk\", channel=\"height_trace\")\n```\n\n### .h5-jpk\n\nYou can open `.h5-jpk` files using the `load_h5jpk` function. Just pass in the path\nto the file and the channel name you want to use.\n(If in doubt, use `height_trace` or `measuredHeight_trace`).\n\nNote: Since `.h5-jpk` stores timeseries AFM data a dictionary of timestamps for each frame is also returned.\n\n```python\nfrom AFMReader.h5_jpk import load_h5jpk\n\nframes, pixel_to_nanometre_scaling_factor, timestamp_dict = load_h5jpk(file_path=\"./my_jpk_file.jpk\", channel=\"height_trace\")\n```\n\n### .stp\n\nYou can open `.stp` files using the `load_stp` function. Just pass in the path\nto the file you want to use.\n\n```python\nfrom AFMReader.stp import load_stp\n\nimage, pixel_to_nanometre_scaling_factor = load_stp(file_path=\"./my_stp_file.stp\")\n```\n\n### .top\n\nYou can open `.top` files using the `load_top` function. Just pass in the path\nto the file you want to use.\n\n```python\nfrom AFMReader.top import load_top\n\nimage, pixel_to_nanometre_scaling_factor = load_top(file_path=\"./my_top_file.top\")\n```\n\n## Contributing\n\nBug reports and feature requests are welcome. Please search for existing issues, if none relating to your bug/feature\nare found then feel free to create a new [issue](https://github.com/AFM-SPM/AFMReader/issues/new) detailing what\nwent wrong or the feature you would like to see implemented.\n\nPull requests are also welcome, please note that we have a [Code of\nConduct](https://github.com/AFM-SPM/AFMReader/blob/main/CODE_OF_CONDUCT.md).\n\n### Setup\n\nWe use [pre-commit](https://pre-commit.com) to apply linting via [ruff](https://github.com/astral-sh/ruff) and\n[pylint](https://pylint.pycqa.org/en/latest/index.html) pre-commit hooks and use the\n[Black](https://github.com/psf/black) and [Flake8](https://github.com/psf/flake8) code styles. To set yourself up for\ncontributing after cloning the package and creating a Python virtual environment you should install the development\ndependencies and `pre-commit` as shown below.\n\n``` bash\n# Activate your virtual environment, this will depend on which system you use e.g. conda or virtualenvwrapper\n# Clone the repository\ngit clone git@github.com:AFM-SPM/AFMReader.git\n# Change directories into the newly cloned directory\ncd AFMReader\n# Install the package along with the optional development (dev) dependencies\npip install -e .[dev]\n# Install pre-commit\npre-commit install\n```\n\nThis will ensure that any commits and pull requests you make will pass the [Pre-commit Continuous\nIntegration](https://pre-commit.ci). Where possible `ruff` will correct the changes it can, but it may require you to\naddress some issues manually, before adding any changes and attempting to commit again.\n\n## Citing\n\nIf you use or depend on AFMReader in your software please consider citing it in any derivative work that is\npublished. Citation details can be found in the [CITATION.cff](CITATION.cff) file in this repository.\n\nAlso, please let us know if you use AFMReader in your software. You can either make a Pull Request to add it to the list\nbelow or you can email us at [topostats@sheffield.ac.uk](mailto:topostats@sheffield.ac.uk) with details of your package.\n\n### Used By\n\nAFMReader is a dependency of the following packages.\n\n- [pNanoLocz](https://github.com/Heath-AFM-Lab/pNanoLocz/)\n- [TopoStats](https://github.com/AFM-SPM/TopoStats/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafm-spm%2Fafmreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafm-spm%2Fafmreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafm-spm%2Fafmreader/lists"}