Name | AFMReader JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Read and retrieve data from various AFM file formats. |
upload_time | 2024-05-29 11:10:24 |
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)
</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/) |
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 |
|-------------|---------------------------------------------------------|--------------------------------------------|
| `.gwy` | [Gwyddion](http://gwyddion.net/) | TopoStats supported, to be migrated (#1). |
| `.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.
### .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")
```
### .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/f9/c6/ac9420236249ec671d7823c2109d63d17760329e52b0d375d98d105f3aca/afmreader-0.0.1.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\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\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| `.gwy` | [Gwyddion](http://gwyddion.net/) | TopoStats supported, to be migrated (#1). |\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### .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### .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.1",
"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": "099ea50613300932b51ccc353b175a50ba622a38bbc9cb9fcac602fd19508d77",
"md5": "0748d603f40bd0ad6717a9561d4aeceb",
"sha256": "516640efb8f2609afe8ddfb911e64a50e284be70f9f57e48ddb39be82242beb0"
},
"downloads": -1,
"filename": "AFMReader-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0748d603f40bd0ad6717a9561d4aeceb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 28307,
"upload_time": "2024-05-29T11:10:22",
"upload_time_iso_8601": "2024-05-29T11:10:22.560133Z",
"url": "https://files.pythonhosted.org/packages/09/9e/a50613300932b51ccc353b175a50ba622a38bbc9cb9fcac602fd19508d77/AFMReader-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f9c6ac9420236249ec671d7823c2109d63d17760329e52b0d375d98d105f3aca",
"md5": "124d27bbff31dbdf22a168add7736ee2",
"sha256": "2a9fdce027188cd984ca228cc76f064d64c5e36dee39ccf116fc299132a2fcef"
},
"downloads": -1,
"filename": "afmreader-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "124d27bbff31dbdf22a168add7736ee2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 44159645,
"upload_time": "2024-05-29T11:10:24",
"upload_time_iso_8601": "2024-05-29T11:10:24.155245Z",
"url": "https://files.pythonhosted.org/packages/f9/c6/ac9420236249ec671d7823c2109d63d17760329e52b0d375d98d105f3aca/afmreader-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-29 11:10:24",
"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"
}