Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Small library for adding well described noise to images, with a command-line utility specifically for application on Nifti formatted images.

Installation

Simple! Just open your favourite terminal and type:

$ pip install onevox

Alongside installing the oneVoxel package, this will also ensure the dependencies are installed: numpy, scipy, nibabel, and nilearn.

For building this in Docker, you can run the following command:

$ docker build -t gkiar/onevox:local --network host .

Usage

From within Python this library can used to apply noise to arbitrary images:

[1]: import numpy as np
[2]: np.random.seed(1234)
[3]: data = np.random.random((10,10,10))  # Create data matrix
[4]: mask = data[:,:,0] > 0.4  # Define mask as values higher than 0.4 in the first 2D slice

[5]: from onevoxel import noise  # Load noise utils

[6]: # Generate noise locations from image and mask
[7]: loc = noise.generate_noise_params(data, mask, erode=0, mode='independent')
[8]: loc
[(3, 6, 0),
 (4, 4, 1),
 (9, 0, 2),
 (7, 9, 3),
 (1, 2, 4),
 (3, 1, 5),
 (0, 7, 6),
 (9, 0, 7),
 (3, 4, 8),
 (1, 9, 9)]

[9]: # Apply noise to the image and verify it's in the right spot
[10]: noisy_data, noisy_hash = noise.apply_noise_params(data, loc, scale=True, intensity=0.01)
[11]: sorted(list(zip(*np.where(noisy_data != data))), key=lambda elem: elem[2]) == loc
True

Contributing

Excited by the project and want to get involved?! Please check out our contributing guide, and look through the issues to start seeing where you can lend a hand. We look forward to approving your amazing contributions!

Metadata

Release files for onevox 0.3.0rc3

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

Source distribution (sdist)

Source distribution for onevox 0.3.0rc3
File Size Uploaded
onevox-0.3.0rc3.tar.gz 11.2 kB Details

Built distribution (wheel)

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

Total release size: 25.2 kB

Release files / onevox-0.3.0rc3.tar.gz

Download URL onevox-0.3.0rc3.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
20de1ac1fb24119009b7447e3a0841fd850320201d08b8b761c5fc09c9fcb9ce
BLAKE2b-256 checksum
How to use checksums
d4e7cffb3e8d77f8c4954dcaa65ae0cab73d0e73c58a94f74c5b8b3711170245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2

Release files / onevox-0.3.0rc3-py3-none-any.whl

Download URL onevox-0.3.0rc3-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcde823eb06a27c8ce11e45da971ff395b5b6eb4fa966a98e8994b9cce343e9e
BLAKE2b-256 checksum
How to use checksums
88e2bfed7e236ee8be93cf214407ab75bf6ce2c92de069b1766c95b9265ee4d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2
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