Skip to main content

USAugment

Examples of each augmentation.

USAugment provides ultrasound-specific image transforms for training deep neural networks. It accompanies our article Revisiting Data Augmentation for Ultrasound Images.

Checkout the Wiki to find the documentation, usage examples, and contributing guidelines.

How to install USAugment

This package can be installed from PyPI by running:

pip install usaugment

Get started using USAugment

Here add a quick code demo showing how to compose a multiple augmentations together using Albumentations after the package is installed.

>>> import albumentations as A
>>> from usaugment.albumentations import DepthAttenuation, GaussianShadow, HazeArtifact, SpeckleReduction
>>> transform = A.Compose(
...     [
...         DepthAttenuation(p=0.5),
...         GaussianShadow(p=0.5),
...         HazeArtifact(p=0.5),
...         SpeckleReduction(p=0.5),
...     ],
...     additional_targets={"scan_mask": "mask"}
...)
>>> transformed = transform(image=image)

Checkout the Documentation for more detailed examples and information about scan masks.

Running the examples

There's a notebook in the notebooks directory that provides examples that visualize the effects of each augmentation. You can run these examples using Binder (see the tag at the top of page) or locally by installing the optional examples dependencies (Matplotlib and Jupyter Notebook):

pip install '.[examples]'

Contributing

I'd love for this package to grow and flourish into a resource that anyone with an interest in training deep neural networks for ultrasound analysis tasks can pick up and use quickly and easily. Any help addressing bugs, contributing new augmentations, or any other improvements are welcome and appreiciated! I only ask that you respect the community guidelines laid out in the CODE_OF_CONDUCT.md. For more information on how to contribute, checkout out the Documentation.

To ensure that your code meets the style guidelines etc., make sure you install the optional development dependencies:

pip install '.[dev]'
nbstripout --install
pre-commit install

How to cite USAugment

If you use the augmentations in USAugment in your research, please cite our article Revisiting Data Augmentation for Ultrasound Images. This helps more people find and use the package and encourages us to continue maintaining and improving it!

Metadata

Release files for usaugment 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for usaugment 1.0.0
File Size Uploaded
usaugment-1.0.0.tar.gz 2.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for usaugment 1.0.0
File Interpreter ABI Platform
usaugment-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.6 MB

Release files / usaugment-1.0.0.tar.gz

Download URL usaugment-1.0.0.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
1ddfee04275b6377e39e834ff3735be79a02100f8cf1c44eed37238f9e48c626
BLAKE2b-256 checksum
How to use checksums
5292dff000be5dbe16123e06254e5f33c234dc290a2122b1f7a3a59c594a4af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / usaugment-1.0.0-py3-none-any.whl

Download URL usaugment-1.0.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8e12e3ebba4491a1a613fb0d0000842915f5afd4ddf4be849f3ce594285f1a3
BLAKE2b-256 checksum
How to use checksums
e8aba02a4ce34dd4212a0eb81582437e3e5a2542731d575c906ecd88c730b73d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page