# Electron Microscopy Machine Learning (EMicroML)
[](https://github.com/mrfitzpa/emicroml/actions/workflows/test_library.yml)
[](https://github.com/mrfitzpa/emicroml/actions/workflows/measure_code_coverage.yml)
[](https://mrfitzpa.github.io/emicroml)
[](https://pypi.org/project/emicroml)
[](https://anaconda.org/conda-forge/emicroml)
[](https://www.gnu.org/licenses/gpl-3.0)
`emicroml` is a Python library for training machine learning models for
applications in electron microscopy.
Visit the `emicroml` [website](https://mrfitzpa.github.io/emicroml) for a web
version of the installation instructions, the reference guide, and the examples
archive.
The source code can be found in the [`emicroml` GitHub
repository](https://github.com/mrfitzpa/emicroml).
## Table of contents
- [Instructions for installing and uninstalling
`emicroml`](#instructions-for-installing-and-uninstalling-emicroml)
- [Installing `emicroml`](#installing-emicroml)
- [Installing `emicroml` using `pip`](#installing-emicroml-using-pip)
- [Installing `emicroml` using `conda`](#installing-emicroml-using-conda)
- [Uninstalling `emicroml`](#uninstalling-emicroml)
- [Learning how to use `emicroml`](#learning-how-to-use-emicroml)
- [Reproducing data of preprints and published
papers](#reproducing-data-of-preprints-and-published-papers)
- [arXiv:2509.01075 (2025)](#arxiv250901075-2025)
## Instructions for installing and uninstalling `emicroml`
### Installing `emicroml`
For all installation scenarios, first open up the appropriate command line
interface. On Unix-based systems, you could open e.g. a terminal. On Windows
systems you could open e.g. an Anaconda Prompt as an administrator.
Before installing `emicroml`, it is recommended that users install `PyTorch` in
the same environment that they intend to install `emicroml` according to the
instructions given [here](https://pytorch.org/get-started/locally/) for their
preferred PyTorch installation option.
#### Installing `emicroml` using `pip`
Before installing `emicroml`, make sure that you have activated the (virtual)
environment in which you intend to install said package. After which, simply run
the following command:
pip install emicroml
The above command will install the latest stable version of `emicroml`.
To install the latest development version from the main branch of the [emicroml
GitHub repository](https://github.com/mrfitzpa/emicroml), one must first clone
the repository by running the following command:
git clone https://github.com/mrfitzpa/emicroml.git
Next, change into the root of the cloned repository, and then run the following
command:
pip install .
Note that you must include the period as well. The above command executes a
standard installation of `emicroml`.
Optionally, for additional features in `emicroml`, one can install additional
dependencies upon installing `emicroml`. To install a subset of additional
dependencies (along with the standard installation), run the following command
from the root of the repository:
pip install .[<selector>]
where `<selector>` can be one of the following:
* `tests`: to install the dependencies necessary for running unit tests;
* `examples`: to install the dependencies necessary for executing files stored
in `<root>/examples`, where `<root>` is the root of the repository;
* `docs`: to install the dependencies necessary for documentation generation;
* `all`: to install all of the above optional dependencies.
Alternatively, one can run:
pip install emicroml[<selector>]
elsewhere in order to install the latest stable version of `emicroml`, along
with the subset of additional dependencies specified by `<selector>`. Note that
the Python library `pyprismatic>=2.0` must be installed prior to executing
either of the last two commands with `<selector>` set to `examples`. The easiest
way to install this additional dependency is within a `conda` virtual
environment, using the following command::
conda install -y pyprismatic=\*=gpu\* -c conda-forge
if CUDA version >= 11 is available on your machine, otherwise users should run
instead the following command::
conda install -y pyprismatic=\*=cpu\* -c conda-forge
For further discussions on running examples, see the pages [Prerequisites for
running example scripts or Jupyter notebooks without using a SLURM workload
manager](https://mrfitzpa.github.io/emicroml/examples/prerequisites_for_execution_without_slurm.html#examples-prerequisites-for-execution-without-slurm-sec)
and [Prerequisites for running example scripts or Jupyter notebooks using a
SLURM workload
manager](https://mrfitzpa.github.io/emicroml/examples/prerequisites_for_execution_with_slurm.html#examples-prerequisites-for-execution-with-slurm-sec).
#### Installing `emicroml` using `conda`
Before proceeding, make sure that you have activated the (virtual) `conda`
environment in which you intend to install said package. For Windows systems,
users must install `PyTorch` separately prior to following the remaining
instructions below.
To install `emicroml` using the `conda` package manager, run the following
command:
conda install -c conda-forge emicroml
The above command will install the latest stable version of `emicroml`.
### Uninstalling `emicroml`
If `emicroml` was installed using `pip`, then to uninstall, run the following
command from the root of the repository:
pip uninstall emicroml
If `emicroml` was installed using `conda`, then to uninstall, run the following
command from the root of the repository:
conda remove emicroml
## Learning how to use `emicroml`
For those new to the `emicroml` library, it is recommended that they take a look
at the [Examples](https://mrfitzpa.github.io/emicroml/examples.html) page, which
contain code examples that show how one can use the `emicroml` library. While
going through the examples, readers can consult the [emicroml reference
guide](https://mrfitzpa.github.io/emicroml/_autosummary/emicroml.html) to
understand what each line of code is doing.
## Reproducing data of preprints and published papers
### arXiv:2509.01075 (2025)
The majority of the data presented in
Ref. [Fitzpatrick1](https://mrfitzpa.github.io/emicroml/literature.html#fitzpatrick1)
can be reproduced by running all of the examples listed on the page [Examples of
distortion estimation of CBED
patterns](https://mrfitzpa.github.io/emicroml/examples/modelling/cbed/distortion/estimation.html#examples-modelling-cbed-distortion-estimation-sec).
Raw data
{
"_id": null,
"home_page": null,
"name": "emicroml",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "pytorch, electron microscopy, microscopy, diffraction, cbed, distortion measurement, distortion correction, machine learning, deep learning",
"author": null,
"author_email": "Matthew Fitzpatrick <matthew.rc.fitzpatrick@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/db/18/634ccf15389f51d82f718c7065b2c10eea69ab996b19dfd2ca7535644bfe/emicroml-0.0.4.tar.gz",
"platform": null,
"description": "# Electron Microscopy Machine Learning (EMicroML)\n\n[](https://github.com/mrfitzpa/emicroml/actions/workflows/test_library.yml)\n[](https://github.com/mrfitzpa/emicroml/actions/workflows/measure_code_coverage.yml)\n[](https://mrfitzpa.github.io/emicroml)\n[](https://pypi.org/project/emicroml)\n[](https://anaconda.org/conda-forge/emicroml)\n[](https://www.gnu.org/licenses/gpl-3.0)\n\n`emicroml` is a Python library for training machine learning models for\napplications in electron microscopy.\n\nVisit the `emicroml` [website](https://mrfitzpa.github.io/emicroml) for a web\nversion of the installation instructions, the reference guide, and the examples\narchive.\n\nThe source code can be found in the [`emicroml` GitHub\nrepository](https://github.com/mrfitzpa/emicroml).\n\n\n\n## Table of contents\n\n- [Instructions for installing and uninstalling\n `emicroml`](#instructions-for-installing-and-uninstalling-emicroml)\n - [Installing `emicroml`](#installing-emicroml)\n - [Installing `emicroml` using `pip`](#installing-emicroml-using-pip)\n - [Installing `emicroml` using `conda`](#installing-emicroml-using-conda)\n - [Uninstalling `emicroml`](#uninstalling-emicroml)\n- [Learning how to use `emicroml`](#learning-how-to-use-emicroml)\n- [Reproducing data of preprints and published\n papers](#reproducing-data-of-preprints-and-published-papers)\n - [arXiv:2509.01075 (2025)](#arxiv250901075-2025)\n\n\n\n## Instructions for installing and uninstalling `emicroml`\n\n\n\n### Installing `emicroml`\n\nFor all installation scenarios, first open up the appropriate command line\ninterface. On Unix-based systems, you could open e.g. a terminal. On Windows\nsystems you could open e.g. an Anaconda Prompt as an administrator.\n\nBefore installing `emicroml`, it is recommended that users install `PyTorch` in\nthe same environment that they intend to install `emicroml` according to the\ninstructions given [here](https://pytorch.org/get-started/locally/) for their\npreferred PyTorch installation option.\n\n\n\n#### Installing `emicroml` using `pip`\n\nBefore installing `emicroml`, make sure that you have activated the (virtual)\nenvironment in which you intend to install said package. After which, simply run\nthe following command:\n\n pip install emicroml\n\nThe above command will install the latest stable version of `emicroml`.\n\nTo install the latest development version from the main branch of the [emicroml\nGitHub repository](https://github.com/mrfitzpa/emicroml), one must first clone\nthe repository by running the following command:\n\n git clone https://github.com/mrfitzpa/emicroml.git\n\nNext, change into the root of the cloned repository, and then run the following\ncommand:\n\n pip install .\n\nNote that you must include the period as well. The above command executes a\nstandard installation of `emicroml`.\n\nOptionally, for additional features in `emicroml`, one can install additional\ndependencies upon installing `emicroml`. To install a subset of additional\ndependencies (along with the standard installation), run the following command\nfrom the root of the repository:\n\n pip install .[<selector>]\n\nwhere `<selector>` can be one of the following:\n\n* `tests`: to install the dependencies necessary for running unit tests;\n* `examples`: to install the dependencies necessary for executing files stored\n in `<root>/examples`, where `<root>` is the root of the repository;\n* `docs`: to install the dependencies necessary for documentation generation;\n* `all`: to install all of the above optional dependencies.\n\nAlternatively, one can run:\n\n pip install emicroml[<selector>]\n\nelsewhere in order to install the latest stable version of `emicroml`, along\nwith the subset of additional dependencies specified by `<selector>`. Note that\nthe Python library `pyprismatic>=2.0` must be installed prior to executing\neither of the last two commands with `<selector>` set to `examples`. The easiest\nway to install this additional dependency is within a `conda` virtual\nenvironment, using the following command::\n\n conda install -y pyprismatic=\\*=gpu\\* -c conda-forge\n\nif CUDA version >= 11 is available on your machine, otherwise users should run\ninstead the following command::\n\n conda install -y pyprismatic=\\*=cpu\\* -c conda-forge\n\nFor further discussions on running examples, see the pages [Prerequisites for\nrunning example scripts or Jupyter notebooks without using a SLURM workload\nmanager](https://mrfitzpa.github.io/emicroml/examples/prerequisites_for_execution_without_slurm.html#examples-prerequisites-for-execution-without-slurm-sec)\nand [Prerequisites for running example scripts or Jupyter notebooks using a\nSLURM workload\nmanager](https://mrfitzpa.github.io/emicroml/examples/prerequisites_for_execution_with_slurm.html#examples-prerequisites-for-execution-with-slurm-sec).\n\n\n\n#### Installing `emicroml` using `conda`\n\nBefore proceeding, make sure that you have activated the (virtual) `conda`\nenvironment in which you intend to install said package. For Windows systems,\nusers must install `PyTorch` separately prior to following the remaining\ninstructions below.\n\nTo install `emicroml` using the `conda` package manager, run the following\ncommand:\n\n conda install -c conda-forge emicroml\n\nThe above command will install the latest stable version of `emicroml`.\n\n\n\n### Uninstalling `emicroml`\n\nIf `emicroml` was installed using `pip`, then to uninstall, run the following\ncommand from the root of the repository:\n\n pip uninstall emicroml\n\nIf `emicroml` was installed using `conda`, then to uninstall, run the following\ncommand from the root of the repository:\n\n conda remove emicroml\n\n\n\n## Learning how to use `emicroml`\n\nFor those new to the `emicroml` library, it is recommended that they take a look\nat the [Examples](https://mrfitzpa.github.io/emicroml/examples.html) page, which\ncontain code examples that show how one can use the `emicroml` library. While\ngoing through the examples, readers can consult the [emicroml reference\nguide](https://mrfitzpa.github.io/emicroml/_autosummary/emicroml.html) to\nunderstand what each line of code is doing.\n\n\n\n## Reproducing data of preprints and published papers\n\n\n\n### arXiv:2509.01075 (2025)\n\nThe majority of the data presented in\nRef. [Fitzpatrick1](https://mrfitzpa.github.io/emicroml/literature.html#fitzpatrick1)\ncan be reproduced by running all of the examples listed on the page [Examples of\ndistortion estimation of CBED\npatterns](https://mrfitzpa.github.io/emicroml/examples/modelling/cbed/distortion/estimation.html#examples-modelling-cbed-distortion-estimation-sec).\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for training machine learning models for applications in electron microscopy.",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://mrfitzpa.github.io/emicroml",
"Repository": "https://github.com/mrfitzpa/emicroml"
},
"split_keywords": [
"pytorch",
" electron microscopy",
" microscopy",
" diffraction",
" cbed",
" distortion measurement",
" distortion correction",
" machine learning",
" deep learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "98bf3a9cd5acb8e4fb6a4bf7dd17fccc7b5c3a158504d02ce0f5435688795ee9",
"md5": "52cf7d39758839301d1859dac64dd434",
"sha256": "f2f7d0806f8170b697813cf2df6c50a6c46dd89f30419bd73e55851dbdf08cfc"
},
"downloads": -1,
"filename": "emicroml-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52cf7d39758839301d1859dac64dd434",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 130119,
"upload_time": "2025-10-24T17:31:08",
"upload_time_iso_8601": "2025-10-24T17:31:08.674069Z",
"url": "https://files.pythonhosted.org/packages/98/bf/3a9cd5acb8e4fb6a4bf7dd17fccc7b5c3a158504d02ce0f5435688795ee9/emicroml-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "db18634ccf15389f51d82f718c7065b2c10eea69ab996b19dfd2ca7535644bfe",
"md5": "fd953d13643f695ff4f37bc32a0de5a1",
"sha256": "44056459b3893a8815b9bcb6fffc81b29843dc44485a45acb569ff1d6ef760f0"
},
"downloads": -1,
"filename": "emicroml-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "fd953d13643f695ff4f37bc32a0de5a1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7889368,
"upload_time": "2025-10-24T17:31:10",
"upload_time_iso_8601": "2025-10-24T17:31:10.320590Z",
"url": "https://files.pythonhosted.org/packages/db/18/634ccf15389f51d82f718c7065b2c10eea69ab996b19dfd2ca7535644bfe/emicroml-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-24 17:31:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mrfitzpa",
"github_project": "emicroml",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "emicroml"
}