fidder


Namefidder JSON
Version 0.0.8 PyPI version JSON
download
home_page
SummaryU-Net for 2D fiducial segmentation in cryo-EM
upload_time2023-05-16 19:24:17
maintainer
docs_urlNone
authorAlister Burt
requires_python>=3.8
licenseBSD 3-Clause License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # fidder

[![License](https://img.shields.io/pypi/l/fidder.svg?color=green)](https://github.com/teamtomo/fidder/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/fidder.svg?color=green)](https://pypi.org/project/fidder)
[![Python Version](https://img.shields.io/pypi/pyversions/fidder.svg?color=green)](https://python.org)
[![CI](https://github.com/teamtomo/fidder/actions/workflows/ci.yml/badge.svg)](https://github.com/teamtomo/fidder/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/teamtomo/fidder/branch/main/graph/badge.svg)](https://codecov.io/gh/teamtomo/fidder)


*fidder* is a Python package for detecting and erasing gold fiducials in cryo-EM
images.

<p align="center" width="100%">
    <img width="80%" src="https://user-images.githubusercontent.com/7307488/205998768-5808c399-6801-4ade-89ee-771a7202908f.png">
</p>

Fiducials are detected using a pre-trained residual 2D U-Net at 8 Å/px. Segmented regions are replaced with white 
noise matching the local mean and global standard deviation of the image.

The package can be used from both
[Python](usage/python.md)
and the
[command line](usage/command_line.md).

---

## Quickstart

### Python

```python
import mrcfile
import torch
from fidder.predict import predict_fiducial_mask
from fidder.erase import erase_masked_region

# load your image
image = torch.tensor(mrcfile.read('my_image_file.mrc'))

# use a pretrained model to predict a mask
mask, probabilities = predict_fiducial_mask(
    image, pixel_spacing=1.35, probability_threshold=0.5
)

# erase fiducials
erased_image = erase_masked_region(image=image, mask=mask)
```
### Command Line

```bash
# predict fiducial mask
fidder predict \
--input-image example.mrc \
--probability-threshold 0.5 \
--output-mask mask.mrc

# erase masked region
fidder erase \
--input-image example.mrc \
--input-mask mask.mrc \
--output-image erased.mrc

```

---

## Installation

pip:

```shell
pip install fidder
```

### Compatibility

If trying to use an `10.X` CUDA runtime you may have to install older versions of 
`torch` and `pytorch-lightning`, see 
[teamtomo/fidder#17](https://github.com/teamtomo/fidder/issues/17) for details.

## Notes

This package provides similar functionality to 
[BoxNet](http://www.warpem.com/warp/?page_id=135) from Warp
when 
[retrained for gold fiducial segmentation](http://www.warpem.com/warp/?page_id=137).

This package was developed to make this functionality available in a standalone, 
easy to install Python package. The architecture and training data 
preprocessing are based on the description in the 
[Warp paper](https://doi.org/10.1038/s41592-019-0580-y).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fidder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Alister Burt",
    "author_email": "alisterburt@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/59/11/ed509f30ddd9a0eeb1008024fc7c61f216a51659dcb9a20256441ed9cd0c/fidder-0.0.8.tar.gz",
    "platform": null,
    "description": "# fidder\n\n[![License](https://img.shields.io/pypi/l/fidder.svg?color=green)](https://github.com/teamtomo/fidder/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/fidder.svg?color=green)](https://pypi.org/project/fidder)\n[![Python Version](https://img.shields.io/pypi/pyversions/fidder.svg?color=green)](https://python.org)\n[![CI](https://github.com/teamtomo/fidder/actions/workflows/ci.yml/badge.svg)](https://github.com/teamtomo/fidder/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/teamtomo/fidder/branch/main/graph/badge.svg)](https://codecov.io/gh/teamtomo/fidder)\n\n\n*fidder* is a Python package for detecting and erasing gold fiducials in cryo-EM\nimages.\n\n<p align=\"center\" width=\"100%\">\n    <img width=\"80%\" src=\"https://user-images.githubusercontent.com/7307488/205998768-5808c399-6801-4ade-89ee-771a7202908f.png\">\n</p>\n\nFiducials are detected using a pre-trained residual 2D U-Net at 8 \u00c5/px. Segmented regions are replaced with white \nnoise matching the local mean and global standard deviation of the image.\n\nThe package can be used from both\n[Python](usage/python.md)\nand the\n[command line](usage/command_line.md).\n\n---\n\n## Quickstart\n\n### Python\n\n```python\nimport mrcfile\nimport torch\nfrom fidder.predict import predict_fiducial_mask\nfrom fidder.erase import erase_masked_region\n\n# load your image\nimage = torch.tensor(mrcfile.read('my_image_file.mrc'))\n\n# use a pretrained model to predict a mask\nmask, probabilities = predict_fiducial_mask(\n    image, pixel_spacing=1.35, probability_threshold=0.5\n)\n\n# erase fiducials\nerased_image = erase_masked_region(image=image, mask=mask)\n```\n### Command Line\n\n```bash\n# predict fiducial mask\nfidder predict \\\n--input-image example.mrc \\\n--probability-threshold 0.5 \\\n--output-mask mask.mrc\n\n# erase masked region\nfidder erase \\\n--input-image example.mrc \\\n--input-mask mask.mrc \\\n--output-image erased.mrc\n\n```\n\n---\n\n## Installation\n\npip:\n\n```shell\npip install fidder\n```\n\n### Compatibility\n\nIf trying to use an `10.X` CUDA runtime you may have to install older versions of \n`torch` and `pytorch-lightning`, see \n[teamtomo/fidder#17](https://github.com/teamtomo/fidder/issues/17) for details.\n\n## Notes\n\nThis package provides similar functionality to \n[BoxNet](http://www.warpem.com/warp/?page_id=135) from Warp\nwhen \n[retrained for gold fiducial segmentation](http://www.warpem.com/warp/?page_id=137).\n\nThis package was developed to make this functionality available in a standalone, \neasy to install Python package. The architecture and training data \npreprocessing are based on the description in the \n[Warp paper](https://doi.org/10.1038/s41592-019-0580-y).\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "U-Net for 2D fiducial segmentation in cryo-EM",
    "version": "0.0.8",
    "project_urls": {
        "homepage": "https://github.com/teamtomo/fidder",
        "repository": "https://github.com/teamtomo/fidder"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "759b01f49d68f1b18f28bef2569050924d0b0427fe3a0a50b122dc6e02bfcc97",
                "md5": "c653aa802a4d6d4b07bfd01d63da5cab",
                "sha256": "b4ebbdd89f1e7cefde0d06779d3216b6370996989c68caffc3ca2f4efd8fabc4"
            },
            "downloads": -1,
            "filename": "fidder-0.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c653aa802a4d6d4b07bfd01d63da5cab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24931,
            "upload_time": "2023-05-16T19:24:07",
            "upload_time_iso_8601": "2023-05-16T19:24:07.138030Z",
            "url": "https://files.pythonhosted.org/packages/75/9b/01f49d68f1b18f28bef2569050924d0b0427fe3a0a50b122dc6e02bfcc97/fidder-0.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5911ed509f30ddd9a0eeb1008024fc7c61f216a51659dcb9a20256441ed9cd0c",
                "md5": "818808a0697f1da2ec3dd44760a22804",
                "sha256": "09a3c82006b719a43250a72aa48c046b39459da529266336dcf0c8ebc010b5c2"
            },
            "downloads": -1,
            "filename": "fidder-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "818808a0697f1da2ec3dd44760a22804",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20982,
            "upload_time": "2023-05-16T19:24:17",
            "upload_time_iso_8601": "2023-05-16T19:24:17.806925Z",
            "url": "https://files.pythonhosted.org/packages/59/11/ed509f30ddd9a0eeb1008024fc7c61f216a51659dcb9a20256441ed9cd0c/fidder-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-16 19:24:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "teamtomo",
    "github_project": "fidder",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "fidder"
}
        
Elapsed time: 0.17895s