Name | AFMReader JSON |
Version |
0.0.3
JSON |
| download |
home_page | None |
Summary | Read and retrieve data from various AFM file formats. |
upload_time | 2024-12-05 11:38:10 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
afm
image processing
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# AFMReader
<div align="center">
[![PyPI version](https://badge.fury.io/py/AFMReader.svg)](https://badge.fury.io/py/AFMReader)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/AFMReader)
[![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)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Code style: flake8](https://img.shields.io/badge/code%20style-flake8-456789.svg)](https://github.com/psf/flake8)
<!-- [![codecov](https://codecov.io/gh/AFM-SPM/AFMReader/branch/dev/graph/badge.svg)]
(https://codecov.io/gh/AFM-SPM/AFMReader) -->
[![pre-commit.ci
status](https://results.pre-commit.ci/badge/github/AFM-SPM/AFMReader/main.svg)](https://results.pre-commit.ci/latest/github/AFM-SPM/AFMReader/main)
[![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)
</div>
<div align="center">
[![Downloads](https://static.pepy.tech/badge/afmreader)](https://pepy.tech/project/afmreader)
[![Downloads](https://static.pepy.tech/badge/afmreader/month)](https://pepy.tech/project/afmreader)
[![Downloads](https://static.pepy.tech/badge/afmreader/week)](https://pepy.tech/project/afmreader)
</div>
A library for loading various Atomic Force Microscopy (AFM) file formats into Python. This library is primarily intended
for use with [TopoStats](https://github.com/AFM-SPM/TopoStats).
Supported file formats
| File format | Description |
|-------------|----------------|
| `.asd` | High-speed AFM |
| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) |
| `.spm` | [Bruker's Format](https://www.bruker.com/) |
| `.jpk` | [Bruker](https://www.bruker.com/) |
| `.topostats`| [TopoStats](https://github.com/AFM-SPM/TopoStats) |
| `.gwy` | [Gwydion](<http://gwyddion.net>) |
Support for the following additional formats is planned. Some of these are already supported in TopoStats and are
awaiting refactoring to move their functionality into AFMReader these are denoted in bold below.
| File format | Description | Status |
|-------------|---------------------------------------------------------|--------------------------------------------|
| `.nhf` | [Nanosurf](https://www.nanosurf.com/en/) | To Be Implemented. |
| `.aris` | [Imaris Oxford Instruments](https://imaris.oxinst.com/) | To Be Implemented. |
| `.tiff` | [Park Systems](https://www.parksystems.com/) | To Be Implemented. |
## Usage
If you wish to process AFM images supported by `AFMReader` it is recommend you use
[TopoStats](https://github.com/AFM-SPM/TopoStats) to do so, however the library can be used on its own.
### .topostats
You can open `.topostats` files using the `load_topostats` function. Just pass in the path to the file.
```python
from AFMReader.topostats import load_topostats
image, pixel_to_nanometre_scaling_factor, metadata = load_topostats(file_path="./my_topostats_file.topostats")
```
### .spm
You can open `.spm` files using the `load_spm` function. Just pass in the path to the file and the
channel name that you want to use. (If in doubt use one of the following: "Height", "ZSensor",
"Height Sensor").
```python
from AFMReader.spm import load_spm
image, pixel_to_nanometre_scaling_factor = load_spm(file_path="./my_spm_file.spm", channel="Height")
```
### .gwy
You can open `.gwy` files using the `load_gwy` function. Just pass in the path to the file and the
channel name that you want to use. (If in doubt use one one of the following: "Height", "ZSensor",
"Height Sensor").
```python
from AFMReader.gwy import load_gwy
image, pixel_to_nanometre_scaling_factor = load_gwy(file_path="./my_gwy_file.gwy", channel="Height")
```
### .asd
You can open `.asd` files using the `load_asd` function. Just pass in the path to the file and the channel name that you
want to use. (If in doubt use the `"TP"` topography channel).
Note: For `.asd` files, there seem to only ever be two channels in one file. `"TP"` (topography) is the main one you
will want to use unless you know you specifically want something else.
Other channels: `"ER"` - Error, `"PH"` - Phase
```python
from AFMReader.asd import load_asd
frames, pixel_to_nanometre_scaling_factor, metadata = load_asd(file_path="./my_asd_file.asd", channel="TP")
```
### .ibw
You can open `.ibw` files using the `load_ibw` function. Just pass in the path to the file
and the channel name that you want to use. (If in doubt, use `HeightTracee` (yes, with the
extra 'e'), `ZSensorTrace`, or `ZSensor`).
```python
from AFMReader.ibw import load_ibw
image, pixel_to_nanometre_scaling_factor = load_ibw(file_path="./my_ibw_file.ibw", channel="HeightTracee")
```
### .jpk
You can open `.jpk` files using the `load_jpk` function. Just pass in the path
to the file and the channel name you want to use. (If in doubt, use `height_trace` or `measuredHeight_trace`).
```python
from AFMReader.jpk import load_jpk
image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk", channel="height_trace")
```
## Contributing
Bug reports and feature requests are welcome. Please search for existing issues, if none relating to your bug/feature
are found then feel free to create a new [issue](https://github.com/AFM-SPM/AFMReader/issues/new) detailing what
went wrong or the feature you would like to see implemented.
Pull requests are also welcome, please note that we have a [Code of
Conduct](https://github.com/AFM-SPM/AFMReader/blob/main/CODE_OF_CONDUCT.md).
### Setup
We use [pre-commit](https://pre-commit.com) to apply linting via [ruff](https://github.com/astral-sh/ruff) and
[pylint](https://pylint.pycqa.org/en/latest/index.html) pre-commit hooks and use the
[Black](https://github.com/psf/black) and [Flake8](https://github.com/psf/flake8) code styles. To set yourself up for
contributing after cloning the package and creating a Python virtual environment you should install the development
dependencies and `pre-commit` as shown below.
``` bash
# Activate your virtual environment, this will depend on which system you use e.g. conda or virtualenvwrapper
# Clone the repository
git clone git@github.com:AFM-SPM/AFMReader.git
# Change directories into the newly cloned directory
cd AFMReader
# Install the package along with the optional development (dev) dependencies
pip install -e .[dev]
# Install pre-commit
pre-commit install
```
This will ensure that any commits and pull requests you make will pass the [Pre-commit Continuous
Integration](https://pre-commit.ci). Where possible `ruff` will correct the changes it can, but it may require you to
address some issues manually, before adding any changes and attempting to commit again.
Raw data
{
"_id": null,
"home_page": null,
"name": "AFMReader",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "afm, image processing",
"author": null,
"author_email": "Sylvia Whittle <sylvia.whittle@sheffield.ac.uk>, Neil Shephard <n.shephard@sheffield.ac.uk>, TopoStats Team <topostats@sheffield.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/ac/6a/a1cbc0ca648e95c45885c3affd9d7bc9fa7241c53cacfad1f285b865f8bd/afmreader-0.0.3.tar.gz",
"platform": null,
"description": "# AFMReader\n\n<div align=\"center\">\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<!-- [![codecov](https://codecov.io/gh/AFM-SPM/AFMReader/branch/dev/graph/badge.svg)]\n(https://codecov.io/gh/AFM-SPM/AFMReader) -->\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</div>\n<div align=\"center\">\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</div>\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| `.ibw` | [WaveMetrics](https://www.wavemetrics.com/) |\n| `.spm` | [Bruker's Format](https://www.bruker.com/) |\n| `.jpk` | [Bruker](https://www.bruker.com/) |\n| `.topostats`| [TopoStats](https://github.com/AFM-SPM/TopoStats) |\n| `.gwy` | [Gwydion](<http://gwyddion.net>) |\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## 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",
"bugtrack_url": null,
"license": null,
"summary": "Read and retrieve data from various AFM file formats.",
"version": "0.0.3",
"project_urls": {
"Bug Tracker": "https://github.com/AFM-SPM/afmreader/issues",
"Homepage": "https://github.com/AFM-SPM/afmreader"
},
"split_keywords": [
"afm",
" image processing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe02d0c2ea00fa1fd70b77be23a0c9fe33ca00de7091f6cc4ed90d7a37c109aa",
"md5": "1dbf23bfaec95084fcdc0d919b7f9d07",
"sha256": "4c5e1b267a0f9fcecf41b253b3b9b55b58bca1237e37ea7a667b946fd5cff7e7"
},
"downloads": -1,
"filename": "AFMReader-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1dbf23bfaec95084fcdc0d919b7f9d07",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 32771,
"upload_time": "2024-12-05T11:38:08",
"upload_time_iso_8601": "2024-12-05T11:38:08.121665Z",
"url": "https://files.pythonhosted.org/packages/fe/02/d0c2ea00fa1fd70b77be23a0c9fe33ca00de7091f6cc4ed90d7a37c109aa/AFMReader-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac6aa1cbc0ca648e95c45885c3affd9d7bc9fa7241c53cacfad1f285b865f8bd",
"md5": "3c72fbec5b439d1ee46953c43bfc35b3",
"sha256": "acf7eae3d9c3a3a372667cdd440c3cc121c99f444d5e32f11fa53c31b4893ba1"
},
"downloads": -1,
"filename": "afmreader-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "3c72fbec5b439d1ee46953c43bfc35b3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 51480998,
"upload_time": "2024-12-05T11:38:10",
"upload_time_iso_8601": "2024-12-05T11:38:10.840116Z",
"url": "https://files.pythonhosted.org/packages/ac/6a/a1cbc0ca648e95c45885c3affd9d7bc9fa7241c53cacfad1f285b865f8bd/afmreader-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-05 11:38:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AFM-SPM",
"github_project": "afmreader",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "afmreader"
}